From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: Rebinding Escape Date: Mon, 07 Mar 2005 08:51:17 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1110181808 13067 80.91.229.2 (7 Mar 2005 07:50:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Mar 2005 07:50:08 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 07 08:50:07 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D8D05-0006Wx-N1 for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Mar 2005 08:50:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D8DJo-0004yK-FH for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Mar 2005 03:10:24 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-X-Trace: individual.net hTjP06Vz0LoKvamjvuWSqAp/f45FYOiVi05YZ7YWILjMH3H76s User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:BzTSFrTH0sjRU4hXTzxgO5a9RlQ= Original-Xref: shelby.stanford.edu gnu.emacs.help:129036 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: news.gmane.org gmane.emacs.help:24582 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24582 PT 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