[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating submenu
From: |
Davis Herring |
Subject: |
Re: Creating submenu |
Date: |
Wed, 2 Dec 2009 10:49:42 -0800 (PST) |
User-agent: |
SquirrelMail/1.4.8-5.7.lanl7 |
> ;Make ^C-cg a key prefix for chars menu
> (global-set-key [?\C-c ?g] ctl-x-map)
You're reusing the keymap that C-x is normally bound to, so now C-c g is
an alias for C-x in every respect. Don't do that! Make a new keymap:
(defvar chars-map (make-sparse-keymap)
"Keymap for inserting special characters.")
(global-set-key [?\C-c ?g] chars-map)
You can omit "sparse-" if you're planning to bind lots of ASCII characters
(like, say, C-c g a, C-c g 0, etc.).
> (fset 'list-all-chars [?\C-x ?8 f1])
You can do this more idomatically with
(defun list-all-chars ()
"Describe the C-x 8 keybindings."
(interactive)
(describe-bindings "\C-x8"))
(`describe-bindings' is what implements `f1' after a prefix key.) But
there might be a better way: one that used the binding of C-x 8 directly
so that it would work even if the user had moved that binding elsewhere.
I don't know what it would be, though.
Hope this helps,
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.