all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Karl Chen <quarl@hkn.eecs.berkeley.edu>
Subject: bug/feature - emacs doesn't tell you about keys with multiple prefixes
Date: Sun, 2 Feb 2003 00:59:01 -0800	[thread overview]
Message-ID: <15932.56789.564317.739477@hkn.eecs.berkeley.edu> (raw)


With the code below, if you do "C-h k M-b M-a" , Emacs will tell you that
mark-paragraph is on "M-h, M-a, M-b" ; it will not tell you that it is also on
M-b M-a or M-b M-b (even though you just pressed those keys to get to this
screen!). Same goes with the "matched:" message when you type M-x
mark-paragraph (before you hit RET).

Regardless of bad coding style etc I it is useful to have aliases for prefixes
- for example I like using M-v instead of/in addition to C-x v and the easiest
way to do this is to (global-set-key [ (meta v) ] vc-prefix-map). This
confusing behavior of displaying only keys under the first key bound to a
keymap exists in Emacs 21 for the "M-x ... [matched; <keys>]" message and in
Emacs CVS for describe-key as well.



(global-set-key [(meta a)] nil)
(global-set-key [(meta b)] nil)

(global-set-key [(meta a) (meta a)] 'mark-paragraph)
(global-set-key [(meta a) (meta b)] 'mark-paragraph)

;;; >>>>>>>>>>>>>>>>>>>>>
(global-set-key [(meta b)] (lookup-key (current-global-map) [(meta a)]))
;;; <<<<<<<<<<<<<<<<<<<<<

;; after the previos line, these two lines have no effect on the reverse key lookups.
(global-set-key [(meta b) (meta a)] 'mark-paragraph)
(global-set-key [(meta b) (meta b)] 'mark-paragraph)


-- 
Karl Chen / quarl@quarl.org

             reply	other threads:[~2003-02-02  8:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-02  8:59 Karl Chen [this message]
2003-03-16 10:14 ` bug/feature - emacs doesn't tell you about keys with multiple prefixes Stefan Monnier
2003-03-17  4:52   ` Richard Stallman
2003-03-17 16:35     ` Stefan Monnier
2003-03-18 13:21       ` Richard Stallman
2003-03-18 16:16         ` Stefan Monnier
2003-03-20  8:45           ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15932.56789.564317.739477@hkn.eecs.berkeley.edu \
    --to=quarl@hkn.eecs.berkeley.edu \
    --cc=quarl@quarl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.