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: John Paul Wallington
Subject: Re: 2-key prefix and Invalid Prefix keys in sequence
Date: Sun, 6 Mar 2005 02:45:03 +0000
User-agent: Mutt/1.5.8i

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

How about:

(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)

[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]

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




reply via email to

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