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

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

Re: Rebinding Escape


From: Mathias Dahl
Subject: Re: Rebinding Escape
Date: Mon, 07 Mar 2005 08:51:17 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt)

PT <mailshield.gg@mailnull.com> writes:

> In a special minor mode I want to allow the user to dismiss a popup
> help window quickly with the Escape key. I know it's prefix
> character, I only want to rebind it temporarily while the help
> window is shown.

> I searched for a solution to override the default behavior, but
> found only an XEmacs-specific solution (setting meta-prefix-char to
> negative), but it didn't work. Esc still retains its old behavior.

This works for me:

 (local-set-key [escape] (lambda ()
                           (interactive)
                           (message "Escape test")))

Of course you want to do something else then sending a message, maybe
something like (delete-frame) or (bury-buffer).

Also, you probably want to add the key to a certain key map. This is
what I do for my jabber client:

 (define-key jabber-chat-mode-map [escape] 
   'my-jabber-chat-delete-or-bury)

/Mathias


reply via email to

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