all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim Johnson <tim@johnsons-web.com>
Subject: Re: 2-key prefix and Invalid Prefix keys in sequence
Date: Sun, 06 Mar 2005 08:22:24 -0900	[thread overview]
Message-ID: <112mf2gnkuip046@news.supernews.com> (raw)
In-Reply-To: <mailman.2729.1110078204.32256.help-gnu-emacs@gnu.org>

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

  parent reply	other threads:[~2005-03-06 17:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-05  3:38 2-key prefix and Invalid Prefix keys in sequence Tim Johnson
2005-03-06  2:45 ` John Paul Wallington
     [not found] ` <mailman.2729.1110078204.32256.help-gnu-emacs@gnu.org>
2005-03-06 17:22   ` Tim Johnson [this message]
2005-03-06 20:10     ` John Paul Wallington

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=112mf2gnkuip046@news.supernews.com \
    --to=tim@johnsons-web.com \
    /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.