all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* setting to allow C-g to quit in C-h k
@ 2002-09-28  6:53 Karl Chen
  2002-09-29 18:44 ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Chen @ 2002-09-28  6:53 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: setting to allow C-g to quit in C-h k
  2002-09-28  6:53 setting to allow C-g to quit in C-h k Karl Chen
@ 2002-09-29 18:44 ` Richard Stallman
  2002-09-30 13:01   ` Karl Chen
  2002-10-03  5:32   ` D. Goel
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Stallman @ 2002-09-29 18:44 UTC (permalink / raw)
  Cc: emacs-devel

I don't see any advantage in this.
It does no great harm if C-h k C-g shows the documentation of C-g,
and it is useful for beginners to be able to see it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: setting to allow C-g to quit in C-h k
  2002-09-29 18:44 ` Richard Stallman
@ 2002-09-30 13:01   ` Karl Chen
  2002-10-03  5:32   ` D. Goel
  1 sibling, 0 replies; 4+ messages in thread
From: Karl Chen @ 2002-09-30 13:01 UTC (permalink / raw)
  Cc: emacs-devel

On Sun, 29 Sep 2002, Richard Stallman wrote:

> It does no great harm if C-h k C-g shows the documentation of C-g,
> and it is useful for beginners to be able to see it.
Yeah, so the default still shows the help for it. I often either type "C-h
k" and then change my mind, or type it by mistake, and will want to cancel
it. Once you're familiar with C-g it's just less keystrokes if you don't
have to do a C-x 1 afterwards. Just a suggestion, anyway - if you don't
like it I can always just override it in my own .emacs.

-- 
Karl Chen / quarl@quarl.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: setting to allow C-g to quit in C-h k
  2002-09-29 18:44 ` Richard Stallman
  2002-09-30 13:01   ` Karl Chen
@ 2002-10-03  5:32   ` D. Goel
  1 sibling, 0 replies; 4+ messages in thread
From: D. Goel @ 2002-10-03  5:32 UTC (permalink / raw)
  Cc: quarl, emacs-devel

Richard Stallman <rms@gnu.org> writes:

> I don't see any advantage in this.  It does no great harm if C-h k
> C-g shows the documentation of C-g, and it is useful for beginners
> to be able to see it.


Useful for beginners, true.  But a minor annoyance for advanced
users.. It often happens to me too-- C-h k, then change my mind and
want to quit. 



DG                                 http://deego.gnufans.org/~deego/
--

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-03  5:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-28  6:53 setting to allow C-g to quit in C-h k Karl Chen
2002-09-29 18:44 ` Richard Stallman
2002-09-30 13:01   ` Karl Chen
2002-10-03  5:32   ` D. Goel

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.