summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-05-22 18:23:31 +0000
committerRichard M. Stallman <rms@gnu.org>1993-05-22 18:23:31 +0000
commit26ca84812c0c2944f770c081288beda79b82fe9d (patch)
tree274934237cb78b3e72ca51d4e0d96cea4f519bbd /lisp/help.el
parent7acd636d07a1f0ae3e231b09c3a0bcb947d19122 (diff)
downloademacs-26ca84812c0c2944f770c081288beda79b82fe9d.tar.gz
(describe-key, describe-key-briefly):
Discard the click or drag that follows a down event.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/help.el b/lisp/help.el
index b832ffb6c75..1d3c16754f5 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -101,6 +101,14 @@
(defun describe-key-briefly (key)
"Print the name of the function KEY invokes. KEY is a string."
(interactive "kDescribe key briefly: ")
+ ;; If this key seq ends with a down event, discard the
+ ;; following click or drag event. Otherwise that would
+ ;; erase the message.
+ (let ((type (aref key (1- (length key)))))
+ (if (listp type) (setq type (car type)))
+ (and (symbolp type)
+ (memq 'down (event-modifiers type))
+ (setq foo (read-event))))
(let ((defn (key-binding key)))
(if (or (null defn) (integerp defn))
(message "%s is undefined" (key-description key))
@@ -127,6 +135,14 @@ If FUNCTION is nil, applies `message' to it, thus printing it."
(defun describe-key (key)
"Display documentation of the function invoked by KEY. KEY is a string."
(interactive "kDescribe key: ")
+ ;; If this key seq ends with a down event, discard the
+ ;; following click or drag event. Otherwise that would
+ ;; erase the message.
+ (let ((type (aref key (1- (length key)))))
+ (if (listp type) (setq type (car type)))
+ (and (symbolp type)
+ (memq 'down (event-modifiers type))
+ (read-event)))
(let ((defn (key-binding key)))
(if (or (null defn) (integerp defn))
(message "%s is undefined" (key-description key))