diff options
| author | Richard M. Stallman | 1993-05-22 18:23:31 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-05-22 18:23:31 +0000 |
| commit | 5f296b78d2c4e666a69414095301243837e50c75 (patch) | |
| tree | ef7c862fbf3f962c2822ab15de7fdc49929072a3 /lisp | |
| parent | d205953bff8106259ac290a9fa8d2dcba886c686 (diff) | |
| download | emacs-5f296b78d2c4e666a69414095301243837e50c75.tar.gz emacs-5f296b78d2c4e666a69414095301243837e50c75.zip | |
(describe-key, describe-key-briefly):
Discard the click or drag that follows a down event.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/help.el | 16 |
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 @@ | |||
| 101 | (defun describe-key-briefly (key) | 101 | (defun describe-key-briefly (key) |
| 102 | "Print the name of the function KEY invokes. KEY is a string." | 102 | "Print the name of the function KEY invokes. KEY is a string." |
| 103 | (interactive "kDescribe key briefly: ") | 103 | (interactive "kDescribe key briefly: ") |
| 104 | ;; If this key seq ends with a down event, discard the | ||
| 105 | ;; following click or drag event. Otherwise that would | ||
| 106 | ;; erase the message. | ||
| 107 | (let ((type (aref key (1- (length key))))) | ||
| 108 | (if (listp type) (setq type (car type))) | ||
| 109 | (and (symbolp type) | ||
| 110 | (memq 'down (event-modifiers type)) | ||
| 111 | (setq foo (read-event)))) | ||
| 104 | (let ((defn (key-binding key))) | 112 | (let ((defn (key-binding key))) |
| 105 | (if (or (null defn) (integerp defn)) | 113 | (if (or (null defn) (integerp defn)) |
| 106 | (message "%s is undefined" (key-description key)) | 114 | (message "%s is undefined" (key-description key)) |
| @@ -127,6 +135,14 @@ If FUNCTION is nil, applies `message' to it, thus printing it." | |||
| 127 | (defun describe-key (key) | 135 | (defun describe-key (key) |
| 128 | "Display documentation of the function invoked by KEY. KEY is a string." | 136 | "Display documentation of the function invoked by KEY. KEY is a string." |
| 129 | (interactive "kDescribe key: ") | 137 | (interactive "kDescribe key: ") |
| 138 | ;; If this key seq ends with a down event, discard the | ||
| 139 | ;; following click or drag event. Otherwise that would | ||
| 140 | ;; erase the message. | ||
| 141 | (let ((type (aref key (1- (length key))))) | ||
| 142 | (if (listp type) (setq type (car type))) | ||
| 143 | (and (symbolp type) | ||
| 144 | (memq 'down (event-modifiers type)) | ||
| 145 | (read-event))) | ||
| 130 | (let ((defn (key-binding key))) | 146 | (let ((defn (key-binding key))) |
| 131 | (if (or (null defn) (integerp defn)) | 147 | (if (or (null defn) (integerp defn)) |
| 132 | (message "%s is undefined" (key-description key)) | 148 | (message "%s is undefined" (key-description key)) |