From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Karl Chen Newsgroups: gmane.emacs.devel Subject: setting to allow C-g to quit in C-h k Date: Fri, 27 Sep 2002 23:53:50 -0700 (PDT) Sender: emacs-devel-admin@gnu.org Message-ID: Reply-To: Karl Chen NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1033196103 30123 127.0.0.1 (28 Sep 2002 06:55:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 28 Sep 2002 06:55:03 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17vBVG-0007pg-00 for ; Sat, 28 Sep 2002 08:55:02 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17vCDq-0003yV-00 for ; Sat, 28 Sep 2002 09:41:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17vBVQ-0006Ie-00; Sat, 28 Sep 2002 02:55:12 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17vBTO-00066b-00 for emacs-devel@gnu.org; Sat, 28 Sep 2002 02:53:06 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17vBTH-00063r-00 for emacs-devel@gnu.org; Sat, 28 Sep 2002 02:53:05 -0400 Original-Received: from hkn.eecs.berkeley.edu ([128.32.47.228]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17vBTH-00063l-00 for emacs-devel@gnu.org; Sat, 28 Sep 2002 02:52:59 -0400 Original-Received: from quarl (helo=localhost) by hkn.eecs.berkeley.edu with local-esmtp id 17vBU6-0005HZ-00 for ; Fri, 27 Sep 2002 23:53:50 -0700 Original-To: emacs-devel@gnu.org Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:8220 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8220 Please consider this patch which adds a customizable variable to allow quitting `describe-key' (C-h k) with `keyboard-quit' (C-g) at the interactive prompt. The default behavior is unchanged. Index: help.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/help.el,v retrieving revision 1.252 diff -u -u -r1.252 help.el --- help.el 16 Jul 2002 16:08:44 -0000 1.252 +++ help.el 28 Sep 2002 06:48:18 -0000 @@ -506,6 +506,17 @@ (if (symbolp defn) defn (prin1-to-string defn))))))))) +(defcustom help-keyboard-quit-quits nil + "*If non-nil, hitting \\[keyboard-quit] in `describe-key' quits. + +If nil (default), hitting \\[keyboard-quit] describes `keyboard-quit'. +`describe-key' is not affected when called non-interactively with a key +binding for `keyboard-quit'. `describe-key-briefly' is never affected and +always briefly describes `keyboard-quit'." + :group 'help + :version "21.3" + :type 'boolean) + (defun describe-key (key &optional untranslated) "Display documentation of the function invoked by KEY. KEY should be a key sequence--when calling from a program, @@ -532,6 +543,10 @@ (let ((defn (or (string-key-binding key) (key-binding key)))) (if (or (null defn) (integerp defn) (equal defn 'undefined)) (message "%s is undefined" (help-key-description key untranslated)) + (if (and (interactive-p) + help-keyboard-quit-quits + (eq defn 'keyboard-quit)) + (keyboard-quit)) (help-setup-xref (list #'describe-function defn) (interactive-p)) (with-output-to-temp-buffer (help-buffer) (princ (help-key-description key untranslated)) -- Karl Chen / quarl@quarl.org