From: Karl Chen <quarl@hkn.eecs.berkeley.edu>
Subject: setting to allow C-g to quit in C-h k
Date: Fri, 27 Sep 2002 23:53:50 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.44.0209272347030.20119-100000@hkn.eecs.berkeley.edu> (raw)
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
next reply other threads:[~2002-09-28 6:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-28 6:53 Karl Chen [this message]
2002-09-29 18:44 ` setting to allow C-g to quit in C-h k Richard Stallman
2002-09-30 13:01 ` Karl Chen
2002-10-03 5:32 ` D. Goel
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=Pine.LNX.4.44.0209272347030.20119-100000@hkn.eecs.berkeley.edu \
--to=quarl@hkn.eecs.berkeley.edu \
--cc=quarl@quarl.org \
/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.