help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2-key prefix and Invalid Prefix keys in sequence


From: Tim Johnson
Subject: Re: 2-key prefix and Invalid Prefix keys in sequence
Date: Sun, 06 Mar 2005 08:22:24 -0900
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)

John Paul Wallington wrote:
Tim Johnson wrote:

I'd like to map out a series of 3-key commands, with
control-c control-; as the prefix.
Initially I am attempting the following:
(global-set-key [(control \c\;) (b)] 'isearch-forward)
;; evaluation gives me the "Invalid Prefix Keys in sequence"
;; error message

Hi John:

(defvar foo-map (make-sparse-keymap)
  "Foo keymap.")
(define-prefix-command 'foo-map)
(global-set-key [(control c) (control \;)] 'foo-map)
(define-key foo-map "b" 'isearch-forward)

Great! Just what I was looking for! FYI I did find some examples
in keydefs.el, but haven't had time to try them. Your example is
very good and easy to implement. Thanks!

[FWIW, C-; may not be a good choice because many terminals won't pass
it to Emacs -- on my main desktop machine at home the Linux console
ignores C-; and the xterm program passes on a bare semi-colon]

Good point. My linux machine (RH 9.0) with xemacs handles both C-; and C-'. On this windows XP machine emacs and xemacs process this
code correctly.
But the whole idea of haveing a keymap bound to a prefix key (in my mind), is that you can change the mapping to suit the OS (or the keyboard) by altering code in just once place....

The section on Keymaps in the elisp info manual talks about defining
Prefix Keymaps.  Perhaps the emacs info manual should too.

I agree. I find the appropos regex service wonderful for looking up
documentation. I haven't found a similar regex feature for 'info.
Is there one?

Best Regards
tim




reply via email to

[Prev in Thread] Current Thread [Next in Thread]