Mercurial > emacs
comparison lisp/help.el @ 39786:f50214c096af
(describe-bindings-internal): New fun moved from keymap.c.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 11 Oct 2001 22:31:20 +0000 |
parents | 570d86d34c32 |
children | e511f555920c |
comparison
equal
deleted
inserted
replaced
39785:5c56451d877f | 39786:f50214c096af |
---|---|
317 (goto-address)) | 317 (goto-address)) |
318 | 318 |
319 (defun view-emacs-FAQ () | 319 (defun view-emacs-FAQ () |
320 "Display the Emacs Frequently Asked Questions (FAQ) file." | 320 "Display the Emacs Frequently Asked Questions (FAQ) file." |
321 (interactive) | 321 (interactive) |
322 ;;; (find-file-read-only (expand-file-name "FAQ" data-directory)) | 322 ;; (find-file-read-only (expand-file-name "FAQ" data-directory)) |
323 (info "(efaq)")) | 323 (info "(efaq)")) |
324 | 324 |
325 (defun view-emacs-problems () | 325 (defun view-emacs-problems () |
326 "Display info on known problems with Emacs and possible workarounds." | 326 "Display info on known problems with Emacs and possible workarounds." |
327 (interactive) | 327 (interactive) |
365 (with-current-buffer buffer | 365 (with-current-buffer buffer |
366 (describe-bindings-internal nil prefix)) | 366 (describe-bindings-internal nil prefix)) |
367 (with-current-buffer "*Help*" | 367 (with-current-buffer "*Help*" |
368 (help-setup-xref (list #'describe-bindings prefix buffer) | 368 (help-setup-xref (list #'describe-bindings prefix buffer) |
369 (interactive-p)))) | 369 (interactive-p)))) |
370 | |
371 ;; This function used to be in keymap.c. | |
372 (defun describe-bindings-internal (&optional menus prefix) | |
373 "Show a list of all defined keys, and their definitions. | |
374 We put that list in a buffer, and display the buffer. | |
375 | |
376 The optional argument MENUS, if non-nil, says to mention menu bindings. | |
377 \(Ordinarily these are omitted from the output.) | |
378 The optional argument PREFIX, if non-nil, should be a key sequence; | |
379 then we display only bindings that start with that prefix." | |
380 (interactive) | |
381 (let ((buf (current-buffer))) | |
382 (with-output-to-temp-buffer "*Help*" | |
383 (with-current-buffer standard-output | |
384 (describe-buffer-bindings buf prefix menus))))) | |
370 | 385 |
371 (defun where-is (definition &optional insert) | 386 (defun where-is (definition &optional insert) |
372 "Print message listing key sequences that invoke the command DEFINITION. | 387 "Print message listing key sequences that invoke the command DEFINITION. |
373 Argument is a command definition, usually a symbol with a function definition. | 388 Argument is a command definition, usually a symbol with a function definition. |
374 If INSERT (the prefix arg) is non-nil, insert the message in the buffer." | 389 If INSERT (the prefix arg) is non-nil, insert the message in the buffer." |
461 ;; in case the keymap depends on where you clicked. | 476 ;; in case the keymap depends on where you clicked. |
462 (if (or (memq 'click modifiers) (memq 'down modifiers) | 477 (if (or (memq 'click modifiers) (memq 'down modifiers) |
463 (memq 'drag modifiers)) | 478 (memq 'drag modifiers)) |
464 (setq window (posn-window (event-start (aref key 0))) | 479 (setq window (posn-window (event-start (aref key 0))) |
465 position (posn-point (event-start (aref key 0))))) | 480 position (posn-point (event-start (aref key 0))))) |
466 (if (windowp window) | 481 (when (windowp window) |
467 (progn | |
468 (set-buffer (window-buffer window)) | 482 (set-buffer (window-buffer window)) |
469 (goto-char position))) | 483 (goto-char position)) |
470 (let ((defn (or (string-key-binding key) (key-binding key)))) | 484 (let ((defn (or (string-key-binding key) (key-binding key)))) |
471 (if (or (null defn) (integerp defn)) | 485 (if (or (null defn) (integerp defn)) |
472 (message "%s is undefined" (key-description key)) | 486 (message "%s is undefined" (key-description key)) |
473 (with-output-to-temp-buffer "*Help*" | 487 (with-output-to-temp-buffer "*Help*" |
474 (princ (key-description key)) | 488 (princ (key-description key)) |