comparison lisp/help.el @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents abe6d1db359e
children e7ef97881643
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
49 :group 'help) 49 :group 'help)
50 50
51 (defvar help-map (let ((map (make-sparse-keymap))) 51 (defvar help-map (let ((map (make-sparse-keymap)))
52 (set-keymap-name map 'help-map) 52 (set-keymap-name map 'help-map)
53 (set-keymap-prompt 53 (set-keymap-prompt
54 map (purecopy (gettext "(Type ? for further options)"))) 54 map (gettext "(Type ? for further options)"))
55 map) 55 map)
56 "Keymap for characters following the Help key.") 56 "Keymap for characters following the Help key.")
57 57
58 ;; global-map definitions moved to keydefs.el 58 ;; global-map definitions moved to keydefs.el
59 (fset 'help-command help-map) 59 (fset 'help-command help-map)
302 (defun key-or-menu-binding (key &optional menu-flag) 302 (defun key-or-menu-binding (key &optional menu-flag)
303 "Return the command invoked by KEY. 303 "Return the command invoked by KEY.
304 Like `key-binding', but handles menu events and toolbar presses correctly. 304 Like `key-binding', but handles menu events and toolbar presses correctly.
305 KEY is any value returned by `next-command-event'. 305 KEY is any value returned by `next-command-event'.
306 MENU-FLAG is a symbol that should be set to t if KEY is a menu event, 306 MENU-FLAG is a symbol that should be set to t if KEY is a menu event,
307 or nil otherwise" 307 or nil otherwise."
308 (let (defn) 308 (let (defn)
309 (and menu-flag (set menu-flag nil)) 309 (and menu-flag (set menu-flag nil))
310 ;; If the key typed was really a menu selection, grab the form out 310 ;; If the key typed was really a menu selection, grab the form out
311 ;; of the event object and intuit the function that would be called, 311 ;; of the event object and intuit the function that would be called,
312 ;; and describe that instead. 312 ;; and describe that instead.
661 (recenter 0))) 661 (recenter 0)))
662 662
663 (defun describe-bindings (&optional prefix mouse-only-p) 663 (defun describe-bindings (&optional prefix mouse-only-p)
664 "Show a list of all defined keys, and their definitions. 664 "Show a list of all defined keys, and their definitions.
665 The list is put in a buffer, which is displayed. 665 The list is put in a buffer, which is displayed.
666 If the optional argument PREFIX is supplied, only commands which 666 If optional first argument PREFIX is supplied, only commands
667 start with that sequence of keys are described. 667 which start with that sequence of keys are described.
668 If the second argument (prefix arg, interactively) is non-null 668 If optional second argument MOUSE-ONLY-P (prefix arg, interactively)
669 then only the mouse bindings are displayed." 669 is non-nil then only the mouse bindings are displayed."
670 (interactive (list nil current-prefix-arg)) 670 (interactive (list nil current-prefix-arg))
671 (with-displaying-help-buffer 671 (with-displaying-help-buffer
672 (lambda () 672 (lambda ()
673 (describe-bindings-1 prefix mouse-only-p)) 673 (describe-bindings-1 prefix mouse-only-p))
674 (format "bindings for %s" major-mode))) 674 (format "bindings for %s" major-mode)))
881 \\[describe-no-warranty] Information on absence of warranty for XEmacs. 881 \\[describe-no-warranty] Information on absence of warranty for XEmacs.
882 \\[describe-copying] XEmacs copying permission (General Public License)." 882 \\[describe-copying] XEmacs copying permission (General Public License)."
883 help-map) 883 help-map)
884 884
885 (defmacro with-syntax-table (syntab &rest body) 885 (defmacro with-syntax-table (syntab &rest body)
886 "Evaluate BODY with the syntax-table SYNTAB" 886 "Evaluate BODY with the SYNTAB as the current syntax table."
887 `(let ((stab (syntax-table))) 887 `(let ((stab (syntax-table)))
888 (unwind-protect 888 (unwind-protect
889 (progn 889 (progn
890 (set-syntax-table (copy-syntax-table ,syntab)) 890 (set-syntax-table (copy-syntax-table ,syntab))
891 ,@body) 891 ,@body)
1162 ["Find %_Variable Source" (help-symbol-run-function 'find-variable)] 1162 ["Find %_Variable Source" (help-symbol-run-function 'find-variable)]
1163 )) 1163 ))
1164 1164
1165 (defvar help-symbol-function-and-variable-context-menu 1165 (defvar help-symbol-function-and-variable-context-menu
1166 '("---" 1166 '("---"
1167 ["View Function %_Documentation" (help-symbol-run-function 1167 ["View Function %_Documentation" (help-symbol-run-function
1168 'describe-function)] 1168 'describe-function)]
1169 ["View Variable D%_ocumentation" (help-symbol-run-function 1169 ["View Variable D%_ocumentation" (help-symbol-run-function
1170 'describe-variable)] 1170 'describe-variable)]
1171 ["Find %_Function Source" (help-symbol-run-function 'find-function)] 1171 ["Find %_Function Source" (help-symbol-run-function 'find-function)]
1172 ["Find %_Variable Source" (help-symbol-run-function 'find-variable)] 1172 ["Find %_Variable Source" (help-symbol-run-function 'find-variable)]