Mercurial > emacs
comparison lisp/help.el @ 22470:eec1f722bded
(help-map): C-h 4 i runs info-other-window.
(describe-key, describe-key-briefly):
Don't discard up event after down event.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 13 Jun 1998 05:59:46 +0000 |
parents | e78006d10683 |
children | e7684a1dd417 |
comparison
equal
deleted
inserted
replaced
22469:516ef6b2ceb9 | 22470:eec1f722bded |
---|---|
64 (define-key help-map "f" 'describe-function) | 64 (define-key help-map "f" 'describe-function) |
65 | 65 |
66 (define-key help-map "F" 'view-emacs-FAQ) | 66 (define-key help-map "F" 'view-emacs-FAQ) |
67 | 67 |
68 (define-key help-map "i" 'info) | 68 (define-key help-map "i" 'info) |
69 (define-key help-map "4i" 'info-other-window) | |
69 (define-key help-map "\C-f" 'Info-goto-emacs-command-node) | 70 (define-key help-map "\C-f" 'Info-goto-emacs-command-node) |
70 (define-key help-map "\C-k" 'Info-goto-emacs-key-command-node) | 71 (define-key help-map "\C-k" 'Info-goto-emacs-key-command-node) |
71 (define-key help-map "\C-i" 'info-lookup-symbol) | 72 (define-key help-map "\C-i" 'info-lookup-symbol) |
72 | 73 |
73 (define-key help-map "l" 'view-lossage) | 74 (define-key help-map "l" 'view-lossage) |
212 | 213 |
213 (defun describe-key-briefly (key &optional insert) | 214 (defun describe-key-briefly (key &optional insert) |
214 "Print the name of the function KEY invokes. KEY is a string. | 215 "Print the name of the function KEY invokes. KEY is a string. |
215 If INSERT (the prefix arg) is non-nil, insert the message in the buffer." | 216 If INSERT (the prefix arg) is non-nil, insert the message in the buffer." |
216 (interactive "kDescribe key briefly: \nP") | 217 (interactive "kDescribe key briefly: \nP") |
217 ;; If this key seq ends with a down event, discard the | |
218 ;; following click or drag event. Otherwise that would | |
219 ;; erase the message. | |
220 (let ((type (aref key (1- (length key))))) | |
221 (if (listp type) (setq type (car type))) | |
222 (and (symbolp type) | |
223 (memq 'down (event-modifiers type)) | |
224 (read-event))) | |
225 (save-excursion | 218 (save-excursion |
226 (let ((modifiers (event-modifiers (aref key 0))) | 219 (let ((modifiers (event-modifiers (aref key 0))) |
227 (standard-output (if insert (current-buffer) t)) | 220 (standard-output (if insert (current-buffer) t)) |
228 window position) | 221 window position) |
229 ;; For a mouse button event, go to the button it applies to | 222 ;; For a mouse button event, go to the button it applies to |
303 "\\[scroll-other-window] to scroll the help.")))))))) | 296 "\\[scroll-other-window] to scroll the help.")))))))) |
304 | 297 |
305 (defun describe-key (key) | 298 (defun describe-key (key) |
306 "Display documentation of the function invoked by KEY. KEY is a string." | 299 "Display documentation of the function invoked by KEY. KEY is a string." |
307 (interactive "kDescribe key: ") | 300 (interactive "kDescribe key: ") |
308 ;; If this key seq ends with a down event, discard the | |
309 ;; following click or drag event. Otherwise that would | |
310 ;; erase the message. | |
311 (let ((type (aref key (1- (length key))))) | |
312 (if (listp type) (setq type (car type))) | |
313 (and (symbolp type) | |
314 (memq 'down (event-modifiers type)) | |
315 (read-event))) | |
316 (save-excursion | 301 (save-excursion |
317 (let ((modifiers (event-modifiers (aref key 0))) | 302 (let ((modifiers (event-modifiers (aref key 0))) |
318 window position) | 303 window position) |
319 ;; For a mouse button event, go to the button it applies to | 304 ;; For a mouse button event, go to the button it applies to |
320 ;; to get the right key bindings. And go to the right place | 305 ;; to get the right key bindings. And go to the right place |