1 ;;; help.el --- help commands for Emacs
3 ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000 Free Software Foundation, Inc.
6 ;; Keywords: help, internal
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 ;; This code implements GNU Emacs' on-line help system, the one invoked by
28 ;; `M-x help-for-help'.
32 ;; Get the macro make-help-screen when this is compiled,
33 ;; or run interpreted, but not when the compiled code is loaded.
34 (eval-when-compile (require 'help-macro
))
35 (eval-when-compile (require 'view
))
37 (defvar help-map
(make-sparse-keymap)
38 "Keymap for characters following the Help key.")
40 (defvar help-mode-map
(make-sparse-keymap)
41 "Keymap for help mode.")
43 (define-key global-map
(char-to-string help-char
) 'help-command
)
44 (define-key global-map
[help] 'help-command)
45 (define-key global-map [f1] 'help-command)
46 (fset 'help-command help-map)
48 (define-key help-map (char-to-string help-char) 'help-for-help)
49 (define-key help-map [help] 'help-for-help
)
50 (define-key help-map
[f1] 'help-for-help)
51 (define-key help-map "?" 'help-for-help)
53 (define-key help-map "\C-c" 'describe-copying)
54 (define-key help-map "\C-d" 'describe-distribution)
55 (define-key help-map "\C-w" 'describe-no-warranty)
56 (define-key help-map "\C-p" 'describe-project)
57 (define-key help-map "a" 'apropos-command)
59 (define-key help-map "b" 'describe-bindings)
61 (define-key help-map "c" 'describe-key-briefly)
62 (define-key help-map "k" 'describe-key)
64 (define-key help-map "d" 'describe-function)
65 (define-key help-map "f" 'describe-function)
67 (define-key help-map "F" 'view-emacs-FAQ)
69 (define-key help-map "i" 'info)
70 (define-key help-map "4i" 'info-other-window)
71 (define-key help-map "\C-f" 'Info-goto-emacs-command-node)
72 (define-key help-map "\C-k" 'Info-goto-emacs-key-command-node)
73 (define-key help-map "\C-i" 'info-lookup-symbol)
75 (define-key help-map "l" 'view-lossage)
77 (define-key help-map "m" 'describe-mode)
79 (define-key help-map "\C-n" 'view-emacs-news)
80 (define-key help-map "n" 'view-emacs-news)
82 (define-key help-map "p" 'finder-by-keyword)
83 (autoload 'finder-by-keyword "finder"
84 "Find packages matching a given keyword." t)
86 (define-key help-map "P" 'view-emacs-problems)
88 (define-key help-map "s" 'describe-syntax)
90 (define-key help-map "t" 'help-with-tutorial)
92 (define-key help-map "w" 'where-is)
94 (define-key help-map "v" 'describe-variable)
96 (define-key help-map "q" 'help-quit)
98 (define-key help-mode-map [mouse-2] 'help-follow-mouse)
99 (define-key help-mode-map "\C-c\C-b" 'help-go-back)
100 (define-key help-mode-map "\C-c\C-c" 'help-follow)
101 (define-key help-mode-map "\t" 'help-next-ref)
102 (define-key help-mode-map [backtab] 'help-previous-ref)
103 (define-key help-mode-map [(shift tab)] 'help-previous-ref)
104 ;; Documentation only, since we use minor-mode-overriding-map-alist.
105 (define-key help-mode-map "\r" 'help-follow)
107 (defvar help-xref-stack nil
108 "A stack of ways by which to return to help buffers after following xrefs.
109 Used by `help-follow' and `help-xref-go-back'.
110 An element looks like (POSITION FUNCTION ARGS...).
111 To use the element, do (apply FUNCTION ARGS) then (goto-char POSITION).")
112 (put 'help-xref-stack 'permanent-local t)
114 (defvar help-xref-stack-item nil
115 "An item for `help-follow' in this buffer to push onto `help-xref-stack'.
116 The format is (FUNCTION ARGS...).")
117 (put 'help-xref-stack-item 'permanent-local t)
119 (setq-default help-xref-stack nil help-xref-stack-item nil)
121 (defcustom help-mode-hook nil
122 "Hook run by `help-mode'."
127 "Major mode for viewing help text and navigating references in it.
128 Entry to this mode runs the normal hook `help-mode-hook'.
132 (kill-all-local-variables)
133 (use-local-map help-mode-map)
134 (setq mode-name "Help")
135 (setq major-mode 'help-mode)
136 (make-local-variable 'font-lock-defaults)
137 (setq font-lock-defaults nil) ; font-lock would defeat xref
139 (make-local-variable 'view-no-disable-on-exit)
140 (setq view-no-disable-on-exit t)
141 ;; `help-make-xrefs' would be run here if not invoked from
142 ;; `help-mode-maybe'.
143 (run-hooks 'help-mode-hook))
145 (defun help-mode-setup ()
147 (setq buffer-read-only nil))
149 (add-hook 'temp-buffer-setup-hook 'help-mode-setup)
151 (defun help-mode-finish ()
152 (when (eq major-mode 'help-mode)
153 ;; View mode's read-only status of existing *Help* buffer is lost
154 ;; by with-output-to-temp-buffer.
156 (help-make-xrefs (current-buffer)))
157 (setq view-return-to-alist
158 (list (cons (selected-window) help-return-method))))
160 (add-hook 'temp-buffer-show-hook 'help-mode-finish)
163 "Just exit from the Help command's command loop."
167 (defun help-with-tutorial (&optional arg)
168 "Select the Emacs learn-by-doing tutorial.
169 If there is a tutorial version written in the language
170 of the selected language environment, that version is used.
171 If there's no tutorial in that language, `TUTORIAL' is selected.
172 With arg, you are asked to choose which language."
175 (read-language-name 'tutorial "Language: " "English")
176 (if (get-language-info current-language-environment 'tutorial)
177 current-language-environment
180 (setq filename (get-language-info lang 'tutorial))
181 (setq file (expand-file-name (concat "~/" filename)))
182 (delete-other-windows)
183 (if (get-file-buffer file)
184 (switch-to-buffer (get-file-buffer file))
185 (switch-to-buffer (create-file-buffer file))
186 (setq buffer-file-name file)
187 (setq default-directory (expand-file-name "~/"))
188 (setq buffer-auto-save-file-name nil)
189 (insert-file-contents (expand-file-name filename data-directory))
190 (goto-char (point-min))
191 (search-forward "\n<<")
193 (delete-region (point) (progn (end-of-line) (point)))
194 (let ((n (- (window-height (selected-window))
195 (count-lines (point-min) (point))
199 ;; Some people get confused by the large gap.
201 (insert "[Middle of page left blank for didactic purposes. "
202 "Text continues below]")
203 (newline (- n (/ n 2)))))
204 (goto-char (point-min))
205 (set-buffer-modified-p nil))))
207 (defun mode-line-key-binding (key)
208 "Value is the binding of KEY in the mode line or nil if none."
209 (let (string-info defn)
210 (when (and (eq 'mode-line (aref key 0))
211 (consp (setq string-info (nth 4 (event-start (aref key 1))))))
212 (let* ((string (car string-info))
213 (pos (cdr string-info))
214 (local-map (and (> pos 0)
215 (< pos (length string))
216 (get-text-property pos 'local-map string))))
217 (setq defn (and local-map (lookup-key local-map key)))))
220 (defun describe-key-briefly (key &optional insert)
221 "Print the name of the function KEY invokes. KEY is a string.
222 If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
223 (interactive "kDescribe key briefly: \nP")
225 (let ((modifiers (event-modifiers (aref key 0)))
226 (standard-output (if insert (current-buffer) t))
228 ;; For a mouse button event, go to the button it applies to
229 ;; to get the right key bindings. And go to the right place
230 ;; in case the keymap depends on where you clicked.
231 (if (or (memq 'click modifiers) (memq 'down modifiers)
232 (memq 'drag modifiers))
233 (setq window (posn-window (event-start (aref key 0)))
234 position (posn-point (event-start (aref key 0)))))
237 (set-buffer (window-buffer window))
238 (goto-char position)))
239 ;; Ok, now look up the key and name the command.
240 (let ((defn (or (mode-line-key-binding key)
242 (key-desc (key-description key)))
243 (if (or (null defn) (integerp defn))
244 (princ (format "%s is undefined" key-desc))
245 (princ (format (if insert
248 "%s at that spot runs the command %s"
249 "%s runs the command %s"))
251 (if (symbolp defn) defn (prin1-to-string defn)))))))))
253 (defvar help-return-method nil
254 "What to do to \"exit\" the help buffer.
256 (WINDOW . t) delete the selected window, go to WINDOW.
257 (WINDOW . quit-window) do quit-window, then select WINDOW.
258 (WINDOW BUF START POINT) display BUF at START, POINT, then select WINDOW.")
260 (defun print-help-return-message (&optional function)
261 "Display or return message saying how to restore windows after help command.
262 Computes a message and applies the optional argument FUNCTION to it.
263 If FUNCTION is nil, applies `message' to it, thus printing it."
264 (and (not (get-buffer-window standard-output))
266 (cond ((special-display-p (buffer-name standard-output))
267 (setq help-return-method (cons (selected-window) t))
268 ;; If the help output buffer is a special display buffer,
269 ;; don't say anything about how to get rid of it.
270 ;; First of all, the user will do that with the window
271 ;; manager, not with Emacs.
272 ;; Secondly, the buffer has not been displayed yet,
273 ;; so we don't know whether its frame will be selected.
275 ((not (one-window-p t))
276 (setq help-return-method
277 (cons (selected-window) 'quit-window))
278 "Type \\[switch-to-buffer-other-window] RET to restore the other window.")
280 (setq help-return-method (cons (selected-window) t))
281 "Type \\[delete-other-windows] to remove help window.")
283 (setq help-return-method
284 (list (selected-window) (window-buffer)
285 (window-start) (window-point)))
286 "Type \\[switch-to-buffer] RET to remove help window."))))
287 (funcall (or function 'message)
290 (substitute-command-keys first-message)
292 (if first-message " " "")
293 ;; If the help buffer will go in a separate frame,
294 ;; it's no use mentioning a command to scroll, so don't.
295 (if (special-display-p (buffer-name standard-output))
297 (if (same-window-p (buffer-name standard-output))
298 ;; Say how to scroll this window.
299 (substitute-command-keys
300 "\\[scroll-up] to scroll the help.")
301 ;; Say how to scroll some other window.
302 (substitute-command-keys
303 "\\[scroll-other-window] to scroll the help."))))))))
305 (defun describe-key (key)
306 "Display documentation of the function invoked by KEY. KEY is a string."
307 (interactive "kDescribe key: ")
309 (let ((modifiers (event-modifiers (aref key 0)))
311 ;; For a mouse button event, go to the button it applies to
312 ;; to get the right key bindings. And go to the right place
313 ;; in case the keymap depends on where you clicked.
314 (if (or (memq 'click modifiers) (memq 'down modifiers)
315 (memq 'drag modifiers))
316 (setq window (posn-window (event-start (aref key 0)))
317 position (posn-point (event-start (aref key 0)))))
320 (set-buffer (window-buffer window))
321 (goto-char position)))
322 (let ((defn (or (mode-line-key-binding key) (key-binding key))))
323 (if (or (null defn) (integerp defn))
324 (message "%s is undefined" (key-description key))
325 (with-output-to-temp-buffer "*Help*"
326 (princ (key-description key))
328 (princ " at that spot"))
329 (princ " runs the command ")
331 (princ "\n which is ")
332 (describe-function-1 defn nil (interactive-p))
333 (print-help-return-message)))))))
335 (defun describe-mode ()
336 "Display documentation of current major mode and minor modes.
337 The major mode description comes first, followed by the minor modes,
338 each on a separate page.
340 For this to work correctly for a minor mode, the mode's indicator variable
341 \(listed in `minor-mode-alist') must also be a function whose documentation
342 describes the minor mode."
344 (with-output-to-temp-buffer "*Help*"
345 (when minor-mode-alist
346 (princ "The major mode is described first.
347 For minor modes, see following pages.\n\n"))
350 (princ (documentation major-mode))
351 (help-setup-xref (list #'help-xref-mode (current-buffer)) (interactive-p))
352 (let ((minor-modes minor-mode-alist))
354 (let* ((minor-mode (car (car minor-modes)))
355 (indicator (car (cdr (car minor-modes)))))
356 ;; Document a minor mode if it is listed in minor-mode-alist,
357 ;; bound locally in this buffer, non-nil, and has a function
359 (if (and (symbol-value minor-mode)
360 (fboundp minor-mode))
361 (let ((pretty-minor-mode minor-mode))
362 (if (string-match "-mode$" (symbol-name minor-mode))
363 (setq pretty-minor-mode
365 (substring (symbol-name minor-mode)
366 0 (match-beginning 0)))))
367 (while (and indicator (symbolp indicator)
369 (not (eq indicator (symbol-value indicator))))
370 (setq indicator (symbol-value indicator)))
372 (princ (format "%s minor mode (%s):\n"
375 (format "indicator%s" indicator)
377 (princ (documentation minor-mode)))))
378 (setq minor-modes (cdr minor-modes))))
379 (print-help-return-message)))
381 ;; So keyboard macro definitions are documented correctly
382 (fset 'defining-kbd-macro (symbol-function 'start-kbd-macro))
384 (defun describe-distribution ()
385 "Display info on how to obtain the latest version of GNU Emacs."
388 (expand-file-name "DISTRIB" data-directory)))
390 (defun describe-copying ()
391 "Display info on how you may redistribute copies of GNU Emacs."
394 (expand-file-name "COPYING" data-directory))
395 (goto-char (point-min)))
397 (defun describe-project ()
398 "Display info on the GNU project."
401 (expand-file-name "GNU" data-directory))
402 (goto-char (point-min)))
404 (defun describe-no-warranty ()
405 "Display info on all the kinds of warranty Emacs does NOT have."
408 (let (case-fold-search)
409 (search-forward "NO WARRANTY")
412 (defun describe-prefix-bindings ()
413 "Describe the bindings of the prefix used to reach this command.
414 The prefix described consists of all but the last event
415 of the key sequence that ran this command."
417 (let* ((key (this-command-keys)))
420 (substring key 0 (1- (length key)))
421 (let ((prefix (make-vector (1- (length key)) nil))
423 (while (< i (length prefix))
424 (aset prefix i (aref key i))
427 ;; Make C-h after a prefix, when not specifically bound,
428 ;; run describe-prefix-bindings.
429 (setq prefix-help-command 'describe-prefix-bindings)
431 (defun view-emacs-news (&optional arg)
432 "Display info on recent changes to Emacs.
433 With numeric argument display information on correspondingly older changes."
435 (let* ((arg (if arg (prefix-numeric-value arg) 0)))
437 (expand-file-name (concat (make-string arg ?O) "NEWS")
440 (defun view-emacs-FAQ ()
441 "Display the Emacs Frequently Asked Questions (FAQ) file."
443 ;;; (find-file-read-only (expand-file-name "FAQ" data-directory))
444 (info "(emacs-faq)"))
446 (defun view-emacs-problems ()
447 "Display info on known problems with Emacs and possible workarounds."
449 (view-file (expand-file-name "PROBLEMS" data-directory)))
451 (defun view-lossage ()
452 "Display last 100 input keystrokes."
454 (with-output-to-temp-buffer "*Help*"
455 (princ (mapconcat (function (lambda (key)
456 (if (or (integerp key)
459 (single-key-description key)
460 (prin1-to-string key nil))))
464 (set-buffer standard-output)
465 (goto-char (point-min))
466 (while (progn (move-to-column 50) (not (eobp)))
467 (search-forward " " nil t)
469 (setq help-xref-stack nil
470 help-xref-stack-item nil))
471 (print-help-return-message)))
473 (defalias 'help 'help-for-help)
474 (make-help-screen help-for-help
475 "a b c C f F C-f i I k C-k l L m n p s t v w C-c C-d C-n C-p C-w; ? for help:"
476 "You have typed %THIS-KEY%, the help character. Type a Help option:
477 \(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.)
479 a command-apropos. Give a substring, and see a list of commands
480 (functions interactively callable) that contain
481 that substring. See also the apropos command.
482 b describe-bindings. Display table of all key bindings.
483 c describe-key-briefly. Type a command key sequence;
484 it prints the function name that sequence runs.
485 C describe-coding-system. This describes either a specific coding system
486 (if you type its name) or the coding systems currently in use
487 (if you type just RET).
488 f describe-function. Type a function name and get documentation of it.
489 C-f Info-goto-emacs-command-node. Type a function name;
490 it takes you to the Info node for that command.
491 i info. The info documentation reader.
492 I describe-input-method. Describe a specific input method (if you type
493 its name) or the current input method (if you type just RET).
494 C-i info-lookup-symbol. Display the definition of a specific symbol
495 as found in the manual for the language this buffer is written in.
496 k describe-key. Type a command key sequence;
497 it displays the full documentation.
498 C-k Info-goto-emacs-key-command-node. Type a command key sequence;
499 it takes you to the Info node for the command bound to that key.
500 l view-lossage. Show last 100 characters you typed.
501 L describe-language-environment. This describes either the a
502 specific language environment (if you type its name)
503 or the current language environment (if you type just RET).
504 m describe-mode. Print documentation of current minor modes,
505 and the current major mode, including their special commands.
506 n view-emacs-news. Display news of recent Emacs changes.
507 p finder-by-keyword. Find packages matching a given topic keyword.
508 s describe-syntax. Display contents of syntax table, plus explanations
509 t help-with-tutorial. Select the Emacs learn-by-doing tutorial.
510 v describe-variable. Type name of a variable;
511 it displays the variable's documentation and value.
512 w where-is. Type command name; it prints which keystrokes
515 F Display the frequently asked questions file.
516 h Display the HELLO file which illustrates various scripts.
517 C-c Display Emacs copying permission (General Public License).
518 C-d Display Emacs ordering information.
519 C-n Display news of recent Emacs changes.
520 C-p Display information about the GNU project.
521 C-w Display information on absence of warranty for GNU Emacs."
524 (defun function-called-at-point ()
525 "Return a function around point or else called by the list containing point.
526 If that doesn't give a function, return nil."
527 (let ((stab (syntax-table)))
528 (set-syntax-table emacs-lisp-mode-syntax-table)
530 (or (condition-case ()
532 (or (not (zerop (skip-syntax-backward "_w")))
533 (eq (char-syntax (following-char)) ?w)
534 (eq (char-syntax (following-char)) ?_)
536 (skip-chars-forward "'")
537 (let ((obj (read (current-buffer))))
538 (and (symbolp obj) (fboundp obj) obj)))
543 (narrow-to-region (max (point-min) (- (point) 1000)) (point-max))
544 ;; Move up to surrounding paren, then after the open.
547 ;; If there is space here, this is probably something
548 ;; other than a real Lisp function call, so ignore it.
549 (if (looking-at "[ \t]")
550 (error "Probably not a Lisp function call"))
552 (setq obj (read (current-buffer)))
553 (and (symbolp obj) (fboundp obj) obj))))
555 (set-syntax-table stab))))
557 (defvar symbol-file-load-history-loaded nil
558 "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
559 That file records the part of `load-history' for preloaded files,
560 which is cleared out before dumping to make Emacs smaller.")
562 (defun symbol-file (function)
563 "Return the input source from which FUNCTION was loaded.
564 The value is normally a string that was passed to `load':
565 either an absolute file name, or a library name
566 \(with no directory name and no `.el' or `.elc' at the end).
567 It can also be nil, if the definition is not associated with any file."
568 (unless symbol-file-load-history-loaded
569 (load (expand-file-name
570 ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
571 (if (eq system-type 'ms-dos)
573 (format "fns-%s.el" emacs-version))
575 ;; The file name fns-%s.el already has a .el extension.
577 (setq symbol-file-load-history-loaded t))
578 (let ((files load-history)
581 (if (memq function (cdr (car files)))
582 (setq file (car (car files)) files nil))
583 (setq files (cdr files)))
586 (defun describe-function (function)
587 "Display the full documentation of FUNCTION (a symbol)."
589 (let ((fn (function-called-at-point))
590 (enable-recursive-minibuffers t)
592 (setq val (completing-read (if fn
593 (format "Describe function (default %s): " fn)
594 "Describe function: ")
595 obarray 'fboundp t nil nil (symbol-name fn)))
596 (list (if (equal val "")
599 (with-output-to-temp-buffer "*Help*"
601 ;; Use " is " instead of a colon so that
602 ;; it is easier to get out the function name using forward-sexp.
604 (describe-function-1 function nil (interactive-p))
605 (print-help-return-message)
607 (set-buffer standard-output)
608 ;; Return the text we displayed.
610 (message "You didn't specify a function")))
612 (defun describe-function-1 (function parens interactive-p)
613 (let* ((def (if (symbolp function)
614 (symbol-function function)
616 file-name string need-close
617 (beg (if (commandp def) "an interactive " "a ")))
619 (cond ((or (stringp def)
623 (concat beg "built-in function"))
624 ((byte-code-function-p def)
625 (concat beg "compiled Lisp function"))
627 (while (symbolp (symbol-function def))
628 (setq def (symbol-function def)))
629 (format "an alias for `%s'" def))
630 ((eq (car-safe def) 'lambda)
631 (concat beg "Lisp function"))
632 ((eq (car-safe def) 'macro)
634 ((eq (car-safe def) 'mocklisp)
635 "a mocklisp function")
636 ((eq (car-safe def) 'autoload)
637 (setq file-name (nth 1 def))
638 (format "%s autoloaded %s"
639 (if (commandp def) "an interactive" "an")
640 (if (eq (nth 4 def) 'keymap) "keymap"
641 (if (nth 4 def) "Lisp macro" "Lisp function"))
643 ;; perhaps use keymapp here instead
644 ((eq (car-safe def) 'keymap)
646 (elts (cdr-safe def)))
648 (if (char-table-p (car-safe elts))
651 (setq elts (cdr-safe elts)))
656 (when (and parens (not (equal string "")))
660 (with-current-buffer "*Help*"
663 (if (re-search-backward "alias for `\\([^`']+\\)'" nil t)
664 (help-xref-button 1 #'describe-function def
665 "mouse-2, RET: describe this function")))))
667 (setq file-name (symbol-file function)))
671 ;; We used to add .el to the file name,
672 ;; but that's completely wrong when the user used load-file.
675 ;; Make a hyperlink to the library.
676 (with-current-buffer "*Help*"
678 (re-search-backward "`\\([^`']+\\)'" nil t)
679 (help-xref-button 1 #'(lambda (arg)
681 (find-function-noselect arg)))
682 (pop-to-buffer (car location))
683 (goto-char (cdr location))))
685 "mouse-2, RET: find function's definition")))))
686 (if need-close (princ ")"))
689 ;; Handle symbols aliased to other symbols.
690 (setq def (indirect-function def))
691 ;; If definition is a macro, find the function inside it.
692 (if (eq (car-safe def) 'macro)
693 (setq def (cdr def)))
694 (let ((arglist (cond ((byte-code-function-p def)
695 (car (append def nil)))
696 ((eq (car-safe def) 'lambda)
698 ((and (eq (car-safe def) 'autoload)
699 (not (eq (nth 4 def) 'keymap)))
700 (concat "[Arg list not available until "
701 "function definition is loaded.]"))
703 (cond ((listp arglist)
704 (princ (cons (if (symbolp function) function "anonymous")
705 (mapcar (lambda (arg)
706 (if (memq arg '(&optional &rest))
708 (intern (upcase (symbol-name arg)))))
714 (let ((doc (documentation function)))
718 (with-current-buffer standard-output
720 ;; Builtins get the calling sequence at the end of
721 ;; the doc string. Move it to the same place as
722 ;; for other functions.
723 (when (looking-at (format "(%S[ )]" function))
724 (let ((start (point-marker)))
725 (goto-char (point-min))
727 (insert-buffer-substring (current-buffer) start)
729 (delete-region (1- start) (point-max))
730 (goto-char (point-max)))))
731 (help-setup-xref (list #'describe-function function)
733 (princ "not documented")))))
735 (defun variable-at-point ()
736 "Return the bound variable symbol found around point.
737 Return 0 if there is no such symbol."
739 (let ((stab (syntax-table)))
742 (set-syntax-table emacs-lisp-mode-syntax-table)
743 (or (not (zerop (skip-syntax-backward "_w")))
744 (eq (char-syntax (following-char)) ?w)
745 (eq (char-syntax (following-char)) ?_)
747 (skip-chars-forward "'")
748 (let ((obj (read (current-buffer))))
749 (or (and (symbolp obj) (boundp obj) obj)
751 (set-syntax-table stab)))
754 (defun describe-variable (variable)
755 "Display the full documentation of VARIABLE (a symbol).
756 Returns the documentation as a string, also."
758 (let ((v (variable-at-point))
759 (enable-recursive-minibuffers t)
761 (setq val (completing-read (if (symbolp v)
762 (format "Describe variable (default %s): " v)
763 "Describe variable: ")
764 obarray 'boundp t nil nil
765 (if (symbolp v) (symbol-name v))))
766 (list (if (equal val "")
768 (if (symbolp variable)
770 (with-output-to-temp-buffer "*Help*"
772 (if (not (boundp variable))
777 (princ "'s value is ")
779 (pp (symbol-value variable))
781 (if (local-variable-p variable)
783 (princ (format "Local in buffer %s; " (buffer-name)))
784 (if (not (default-boundp variable))
785 (princ "globally void")
786 (princ "global value is ")
788 (pp (default-value variable)))
792 (set-buffer standard-output)
793 (if (> (count-lines (point-min) (point-max)) 10)
795 (set-syntax-table emacs-lisp-mode-syntax-table)
796 (goto-char (point-min))
800 (delete-region (point) (progn (end-of-line) (point)))
801 (insert "'s value is shown below.\n\n")
803 (insert "\n\nValue:"))))))
804 (princ "Documentation:")
806 (let ((doc (documentation-property variable 'variable-documentation)))
807 (princ (or doc "not documented as a variable.")))
808 (help-setup-xref (list #'describe-variable variable) (interactive-p))
810 ;; Make a link to customize if this variable can be customized.
811 ;; Note, it is not reliable to test only for a custom-type property
812 ;; because those are only present after the var's definition
814 (if (or (get variable 'custom-type) ; after defcustom
815 (get variable 'custom-loads) ; from loaddefs.el
816 (get variable 'standard-value)) ; from cus-start.el
817 (let ((customize-label "customize"))
820 (princ (concat "You can " customize-label " this variable."))
821 (with-current-buffer "*Help*"
824 (concat "\\(" customize-label "\\)") nil t)
825 (help-xref-button 1 #'(lambda (v)
826 (customize-variable v))
828 "mouse-2, RET: customize variable")
830 ;; Make a hyperlink to the library if appropriate. (Don't
831 ;; change the format of the buffer's initial line in case
832 ;; anything expects the current format.)
833 (let ((file-name (symbol-file variable)))
835 (princ "\n\nDefined in `")
838 (with-current-buffer "*Help*"
840 (re-search-backward "`\\([^`']+\\)'" nil t)
844 (find-variable-noselect arg)))
845 (pop-to-buffer (car location))
846 (goto-char (cdr location))))
847 variable "mouse-2, RET: find variable's definition")))))
849 (print-help-return-message)
851 (set-buffer standard-output)
852 ;; Return the text we displayed.
854 (message "You did not specify a variable")))
856 (defun describe-bindings (&optional prefix buffer)
857 "Show a list of all defined keys, and their definitions.
858 We put that list in a buffer, and display the buffer.
860 The optional argument PREFIX, if non-nil, should be a key sequence;
861 then we display only bindings that start with that prefix.
862 The optional argument BUFFER specifies which buffer's bindings
863 to display (default, the current buffer)."
865 (or buffer (setq buffer (current-buffer)))
866 (with-current-buffer buffer
867 (describe-bindings-internal nil prefix))
868 (with-current-buffer "*Help*"
869 (help-setup-xref (list #'describe-bindings prefix buffer)
872 (defun where-is (definition &optional insert)
873 "Print message listing key sequences that invoke the command DEFINITION.
874 Argument is a command definition, usually a symbol with a function definition.
875 If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
877 (let ((fn (function-called-at-point))
878 (enable-recursive-minibuffers t)
880 (setq val (completing-read (if fn
881 (format "Where is command (default %s): " fn)
882 "Where is command: ")
883 obarray 'commandp t))
884 (list (if (equal val "")
886 current-prefix-arg)))
887 (let* ((keys (where-is-internal definition overriding-local-map nil nil))
888 (keys1 (mapconcat 'key-description keys ", "))
889 (standard-output (if insert (current-buffer) t)))
891 (if (> (length keys1) 0)
892 (princ (format "%s (%s)" keys1 definition))
893 (princ (format "M-x %s RET" definition)))
894 (if (> (length keys1) 0)
895 (princ (format "%s is on %s" definition keys1))
896 (princ (format "%s is not on any key" definition)))))
899 (defun locate-library (library &optional nosuffix path interactive-call)
900 "Show the precise file name of Emacs library LIBRARY.
901 This command searches the directories in `load-path' like `M-x load-library'
902 to find the file that `M-x load-library RET LIBRARY RET' would load.
903 Optional second arg NOSUFFIX non-nil means don't add suffixes `.elc' or `.el'
904 to the specified name LIBRARY.
906 If the optional third arg PATH is specified, that list of directories
907 is used instead of `load-path'.
909 When called from a program, the file name is normaly returned as a
910 string. When run interactively, the argument INTERACTIVE-CALL is t,
911 and the file name is displayed in the echo area."
912 (interactive (list (read-string "Locate library: ")
921 (let ((try (expand-file-name (concat library suf) dir)))
922 (and (file-readable-p try)
923 (null (file-directory-p try))
926 (throw 'answer try)))))
930 ;;; load doesn't handle this yet.
931 ;;; (let ((basic '(".elc" ".el" ""))
932 ;;; (compressed '(".Z" ".gz" "")))
933 ;;; ;; If autocompression mode is on,
934 ;;; ;; consider all combinations of library suffixes
935 ;;; ;; and compression suffixes.
936 ;;; (if (rassq 'jka-compr-handler file-name-handler-alist)
938 ;;; (mapcar (lambda (compelt)
939 ;;; (mapcar (lambda (baselt)
940 ;;; (concat baselt compelt))
945 (or path load-path)))
946 (and interactive-call
948 (message "Library is file %s" result)
949 (message "No library %s in search path" library)))
953 ;;; Grokking cross-reference information in doc strings and
956 ;; This may have some scope for extension and the same or something
957 ;; similar should be done for widget doc strings, which currently use
958 ;; another mechanism.
960 (defcustom help-highlight-p t
961 "*If non-nil, `help-make-xrefs' highlight cross-references.
962 Under a window system it highlights them with face defined by
963 `help-highlight-face'."
968 (defcustom help-highlight-face 'underline
969 "Face used by `help-make-xrefs' to highlight cross-references.
970 Must be previously-defined."
975 (defvar help-back-label (purecopy "[back]")
976 "Label to use by `help-make-xrefs' for the go-back reference.")
978 (defconst help-xref-symbol-regexp
979 (purecopy (concat "\\(\\<\\(\\(variable\\|option\\)\\|"
980 "\\(function\\|command\\)\\|"
981 "\\(symbol\\)\\)\\s-+\\)?"
982 ;; Note starting with word-syntax character:
983 "`\\(\\sw\\(\\sw\\|\\s_\\)+\\)'"))
984 "Regexp matching doc string references to symbols.
986 The words preceding the quoted symbol can be used in doc strings to
987 distinguish references to variables, functions and symbols.")
989 (defconst help-xref-info-regexp
990 (purecopy "\\<[Ii]nfo[ \t\n]+node[ \t\n]+`\\([^']+\\)'")
991 "Regexp matching doc string references to an Info node.")
993 (defun help-setup-xref (item interactive-p)
994 "Invoked from commands using the \"*Help*\" buffer to install some xref info.
996 ITEM is a (FUNCTION . ARGS) pair appropriate for recreating the help
997 buffer after following a reference. INTERACTIVE-P is non-nil if the
998 calling command was invoked interactively. In this case the stack of
999 items for help buffer \"back\" buttons is cleared."
1001 (setq help-xref-stack nil))
1002 (setq help-xref-stack-item item))
1004 (defun help-make-xrefs (&optional buffer)
1005 "Parse and hyperlink documentation cross-references in the given BUFFER.
1007 Find cross-reference information in a buffer and, if
1008 `help-highlight-p' is non-nil, highlight it with face defined by
1009 `help-highlight-face'; activate such cross references for selection
1010 with `help-follow'. Cross-references have the canonical form `...'
1011 and the type of reference may be disambiguated by the preceding
1012 word(s) used in `help-xref-symbol-regexp'.
1014 A special reference `back' is made to return back through a stack of
1015 help buffers. Variable `help-back-label' specifies the text for
1019 (set-buffer (or buffer (current-buffer)))
1020 (goto-char (point-min))
1021 ;; Skip the header-type info, though it might be useful to parse
1022 ;; it at some stage (e.g. "function in `library'").
1024 (let ((old-modified (buffer-modified-p)))
1025 (let ((stab (syntax-table))
1026 (case-fold-search t)
1027 (inhibit-read-only t))
1028 (set-syntax-table emacs-lisp-mode-syntax-table)
1029 ;; The following should probably be abstracted out.
1034 (while (re-search-forward help-xref-info-regexp nil t)
1035 (let ((data (match-string 1)))
1037 (unless (string-match "^([^)]+)" data)
1038 (setq data (concat "(emacs)" data))))
1039 (help-xref-button 1 #'info data
1040 "mouse-2, RET: read this Info node"))))
1043 (while (re-search-forward help-xref-symbol-regexp nil t)
1044 (let* ((data (match-string 6))
1045 (sym (intern-soft data)))
1048 ((match-string 3) ; `variable' &c
1049 (and (boundp sym) ; `variable' doesn't ensure
1050 ; it's actually bound
1052 6 #'describe-variable sym
1053 "mouse-2, RET: describe this variable")))
1054 ((match-string 4) ; `function' &c
1055 (and (fboundp sym) ; similarly
1057 6 #'describe-function sym
1058 "mouse-2, RET: describe this function")))
1059 ((match-string 5)) ; nothing for symbol
1060 ((and (boundp sym) (fboundp sym))
1061 ;; We can't intuit whether to use the
1062 ;; variable or function doc -- supply both.
1064 6 #'help-xref-interned sym
1065 "mouse-2, RET: describe this symbol"))
1068 6 #'describe-variable sym
1069 "mouse-2, RET: describe this variable"))
1072 6 #'describe-function sym
1073 "mouse-2, RET: describe this function")))))))
1074 ;; An obvious case of a key substitution:
1076 (while (re-search-forward
1077 ;; Assume command name is only word characters
1078 ;; and dashes to get things like `use M-x foo.'.
1079 "\\<M-x\\s-+\\(\\sw\\(\\sw\\|-\\)+\\)" nil t)
1080 (let ((sym (intern-soft (match-string 1))))
1083 1 #'describe-function sym
1084 "mouse-2, RET: describe this command")))))
1085 ;; Look for commands in whole keymap substitutions:
1087 ;; Make sure to find the first keymap.
1088 (goto-char (point-min))
1089 ;; Find a header and the column at which the command
1090 ;; name will be found.
1091 (while (re-search-forward "^key +binding\n\\(-+ +\\)-+\n\n"
1093 (let ((col (- (match-end 1) (match-beginning 1))))
1095 ;; Ignore single blank lines in table, but not
1096 ;; double ones, which should terminate it.
1097 (and (not (looking-at "\n\\s-*\n"))
1099 (and (eolp) (forward-line))
1101 (skip-chars-backward "^\t\n")
1102 (if (and (>= (current-column) col)
1103 (looking-at "\\(\\sw\\|-\\)+$"))
1104 (let ((sym (intern-soft (match-string 0))))
1107 0 #'describe-function sym
1108 "mouse-2, RET: describe this function"))))
1109 (zerop (forward-line)))))))))
1110 (set-syntax-table stab))
1111 ;; Make a back-reference in this buffer if appropriate.
1112 (when help-xref-stack
1113 (goto-char (point-max))
1115 (insert "\n\n" help-back-label))
1116 ;; Just to provide the match data:
1117 (looking-at (concat "\n\n\\(" (regexp-quote help-back-label) "\\)"))
1118 (help-xref-button 1 #'help-xref-go-back (current-buffer))))
1119 ;; View mode steals RET from us.
1120 (set (make-local-variable 'minor-mode-overriding-map-alist)
1121 (list (cons 'view-mode
1122 (let ((map (make-sparse-keymap)))
1123 (set-keymap-parent map view-mode-map)
1124 (define-key map "\r" 'help-follow)
1126 (set-buffer-modified-p old-modified))))
1128 (defun help-xref-button (match-number function data &optional help-echo)
1129 "Make a hyperlink for cross-reference text previously matched.
1131 MATCH-NUMBER is the subexpression of interest in the last matched
1132 regexp. FUNCTION is a function to invoke when the button is
1133 activated, applied to DATA. DATA may be a single value or a list.
1134 See `help-make-xrefs'.
1135 If optional arg HELP-ECHO is supplied, it is used as a help string."
1136 ;; Don't mung properties we've added specially in some instances.
1137 (unless (get-text-property (match-beginning match-number) 'help-xref)
1138 (add-text-properties (match-beginning match-number)
1139 (match-end match-number)
1140 (list 'mouse-face 'highlight
1141 'help-xref (cons function
1146 (put-text-property (match-beginning match-number)
1147 (match-end match-number)
1148 'help-echo help-echo))
1149 (if help-highlight-p
1150 (put-text-property (match-beginning match-number)
1151 (match-end match-number)
1152 'face help-highlight-face))))
1155 ;; Additional functions for (re-)creating types of help buffers.
1156 (defun help-xref-interned (symbol)
1157 "Follow a hyperlink which appeared to be an arbitrary interned SYMBOL.
1159 Both variable and function documentation are extracted into a single
1161 (let ((fdoc (when (fboundp symbol) (describe-function symbol))))
1162 (when (or (boundp symbol) (not fdoc))
1163 (describe-variable symbol)
1164 ;; We now have a help buffer on the variable. Insert the function
1167 (with-current-buffer "*Help*"
1168 (goto-char (point-min))
1169 (let ((inhibit-read-only t))
1170 (insert fdoc "\n\n" (symbol-name symbol) " is also a variable.\n\n"))
1171 (help-setup-xref (list #'help-xref-interned symbol) nil))))))
1173 (defun help-xref-mode (buffer)
1174 "Do a `describe-mode' for the specified BUFFER."
1179 ;;; Navigation/hyperlinking with xrefs
1181 (defun help-follow-mouse (click)
1182 "Follow the cross-reference that you click on."
1184 (let* ((start (event-start click))
1185 (window (car start))
1186 (pos (car (cdr start))))
1187 (with-current-buffer (window-buffer window)
1188 (help-follow pos))))
1190 (defun help-xref-go-back (buffer)
1191 "From BUFFER, go back to previous help buffer text using `help-xref-stack'."
1192 (let (item position method args)
1193 (with-current-buffer buffer
1194 (when help-xref-stack
1195 (setq help-xref-stack (cdr help-xref-stack)) ; due to help-follow
1196 (setq item (car help-xref-stack)
1200 (setq help-xref-stack (cdr help-xref-stack))))
1202 (goto-char position)))
1204 (defun help-go-back ()
1205 "Invoke the [back] button (if any) in the Help mode buffer."
1207 (help-follow (1- (point-max))))
1209 (defun help-follow (&optional pos)
1210 "Follow cross-reference at POS, defaulting to point.
1212 For the cross-reference format, see `help-make-xrefs'."
1217 (or (and (not (= pos (point-max)))
1218 (get-text-property pos 'help-xref))
1219 (and (not (= pos (point-min)))
1220 (get-text-property (1- pos) 'help-xref))
1221 ;; check if the symbol under point is a function or variable
1225 (goto-char pos) (skip-syntax-backward "w_")
1226 (buffer-substring (point)
1227 (progn (skip-syntax-forward "w_")
1229 (when (or (boundp sym) (fboundp sym))
1230 (list #'help-xref-interned sym)))))
1231 (method (car help-data))
1232 (args (cdr help-data)))
1234 (setq help-xref-stack (cons (cons (point) help-xref-stack-item)
1236 (setq help-xref-stack-item nil)
1237 ;; There is a reference at point. Follow it.
1238 (apply method args))))
1240 ;; For tabbing through buffer.
1241 (defun help-next-ref ()
1242 "Find the next help cross-reference in the buffer."
1246 (if (get-text-property (point) 'help-xref) ; move off reference
1247 (goto-char (or (next-single-property-change (point) 'help-xref)
1249 (cond ((setq pos (next-single-property-change (point) 'help-xref))
1250 (if pos (goto-char pos)))
1252 (message "No cross references in the buffer.")
1255 (goto-char (point-min)))))))
1257 (defun help-previous-ref ()
1258 "Find the previous help cross-reference in the buffer."
1262 (if (get-text-property (point) 'help-xref) ; move off reference
1263 (goto-char (or (previous-single-property-change (point) 'help-xref)
1265 (cond ((setq pos (previous-single-property-change (point) 'help-xref))
1266 (if pos (goto-char pos)))
1268 (message "No cross references in the buffer.")
1271 (goto-char (point-max)))))))
1274 ;;; Automatic resizing of temporary buffers.
1276 (defcustom temp-buffer-resize-mode nil
1277 "Non-nil means resize windows displaying temporary buffers.
1278 This makes the window the right height for its contents, but never
1279 more than `temp-buffer-max-height' nor less than `window-min-height'.
1280 This applies to `help', `apropos' and `completion' buffers, and some others.
1282 Setting this variable directly does not take effect;
1283 use either \\[customize] or the function `temp-buffer-resize-mode'."
1284 :get (lambda (symbol)
1285 (and (memq 'resize-temp-buffer-window temp-buffer-show-hook) t))
1286 :set (lambda (symbol value)
1287 (temp-buffer-resize-mode (if value 1 -1)))
1288 :initialize 'custom-initialize-default
1293 (defcustom temp-buffer-max-height (lambda (buffer) (/ (- (frame-height) 2) 2))
1294 "*Maximum height of a window displaying a temporary buffer.
1295 This is the maximum height (in text lines) which `resize-temp-buffer-window'
1296 will give to a window displaying a temporary buffer.
1297 It can also be a function which will be called with the object corresponding
1298 to the buffer to be displayed as argument and should return an integer
1300 :type '(choice integer function)
1304 (defun temp-buffer-resize-mode (arg)
1305 "Toggle the mode which that makes windows smaller for temporary buffers.
1306 With prefix argument ARG, turn the resizing of windows displaying temporary
1307 buffers on if ARG is positive or off otherwise.
1308 See the documentation of the variable `temp-buffer-resize-mode' for
1313 (not (memq 'resize-temp-buffer-window temp-buffer-show-hook))
1314 (> (prefix-numeric-value arg) 0))))
1317 ;; `help-mode-maybe' may add a `back' button and thus increase the
1318 ;; text size, so `resize-temp-buffer-window' must be run *after* it.
1319 (add-hook 'temp-buffer-show-hook 'resize-temp-buffer-window 'append)
1320 (setq temp-buffer-resize-mode t))
1321 (remove-hook 'temp-buffer-show-hook 'resize-temp-buffer-window)
1322 (setq temp-buffer-resize-mode nil))))
1324 (defun resize-temp-buffer-window ()
1325 "Resize the current window to fit its contents.
1326 Will not make it higher than `temp-buffer-max-height' nor smaller than
1327 `window-min-height'. Do nothing if it is the only window on its frame, if it
1328 is not as wide as the frame or if some of the window's contents are scrolled
1330 (unless (or (one-window-p 'nomini)
1331 (not (pos-visible-in-window-p (point-min)))
1332 (/= (frame-width) (window-width)))
1333 (let* ((max-height (if (functionp temp-buffer-max-height)
1334 (funcall temp-buffer-max-height (current-buffer))
1335 temp-buffer-max-height))
1336 (win-height (1- (window-height)))
1337 (min-height (1- window-min-height))
1338 (text-height (window-buffer-height(selected-window)))
1339 (new-height (max (min text-height max-height) min-height)))
1340 (enlarge-window (- new-height win-height)))))
1342 ;; `help-manyarg-func-alist' is defined primitively (in doc.c).
1343 ;; New primitives with `MANY' or `UNEVALLED' arglists should be added
1345 ;; The parens and function name are redundant, but it's messy to add
1346 ;; them in `documentation'.
1347 (defconst help-manyarg-func-alist
1349 '((list . "(list &rest OBJECTS)")
1350 (vector . "(vector &rest OBJECTS)")
1351 (make-byte-code . "(make-byte-code &rest ELEMENTS)")
1353 . "(call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)")
1354 (string . "(string &rest CHARACTERS)")
1355 (+ . "(+ &rest NUMBERS-OR-MARKERS)")
1356 (- . "(- &optional NUMBER-OR-MARKER &rest MORE-NUMBERS-OR-MARKERS)")
1357 (* . "(* &rest NUMBERS-OR-MARKERS)")
1358 (/ . "(/ DIVIDEND DIVISOR &rest DIVISORS)")
1359 (max . "(max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS)")
1360 (min . "(min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS)")
1361 (logand . "(logand &rest INTS-OR-MARKERS)")
1362 (logior . "(logior &rest INTS-OR-MARKERS)")
1363 (logxor . "(logxor &rest INTS-OR-MARKERS)")
1365 . "(encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE)")
1366 (insert . "(insert &rest ARGS)")
1367 (insert-before-markers . "(insert-before-markers &rest ARGS)")
1368 (message . "(message STRING &rest ARGUMENTS)")
1369 (message-box . "(message-box STRING &rest ARGUMENTS)")
1370 (message-or-box . "(message-or-box STRING &rest ARGUMENTS)")
1371 (propertize . "(propertize STRING &rest PROPERTIES)")
1372 (format . "(format STRING &rest OBJECTS)")
1373 (apply . "(apply FUNCTION &rest ARGUMENTS)")
1374 (run-hooks . "(run-hooks &rest HOOKS)")
1375 (funcall . "(funcall FUNCTION &rest ARGUMENTS)")
1376 (append . "(append &rest SEQUENCES)")
1377 (concat . "(concat &rest SEQUENCES)")
1378 (vconcat . "(vconcat vconcat)")
1379 (nconc . "(nconc &rest LISTS)")
1380 (widget-apply . "(widget-apply WIDGET PROPERTY &rest ARGS)")
1381 (make-hash-table . "(make-hash-table &rest KEYWORD-ARGS)")
1382 (insert-string . "(insert-string &rest ARGS)")
1383 (start-process . "(start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)")
1384 (setq-default . "(setq-default SYMBOL VALUE [SYMBOL VALUE...])")
1385 (save-excursion . "(save-excursion &rest BODY)")
1386 (save-current-buffer . "(save-current-buffer &rest BODY)")
1387 (save-restriction . "(save-restriction &rest BODY)")
1388 (or . "(or CONDITIONS ...)")
1389 (and . "(and CONDITIONS ...)")
1390 (if . "(if COND THEN ELSE...)")
1391 (cond . "(cond CLAUSES...)")
1392 (progn . "(progn BODY ...)")
1393 (prog1 . "(prog1 FIRST BODY...)")
1394 (prog2 . "(prog2 X Y BODY...)")
1395 (setq . "(setq SYM VAL SYM VAL ...)")
1396 (quote . "(quote ARG)")
1397 (function . "(function ARG)")
1398 (defun . "(defun NAME ARGLIST [DOCSTRING] BODY...)")
1399 (defmacro . "(defmacro NAME ARGLIST [DOCSTRING] BODY...)")
1400 (defvar . "(defvar SYMBOL [INITVALUE DOCSTRING])")
1401 (defconst . "(defconst SYMBOL INITVALUE [DOCSTRING])")
1402 (let* . "(let* VARLIST BODY...)")
1403 (let . "(let VARLIST BODY...)")
1404 (while . "(while TEST BODY...)")
1405 (catch . "(catch TAG BODY...)")
1406 (unwind-protect . "(unwind-protect BODYFORM UNWINDFORMS...)")
1407 (condition-case . "(condition-case VAR BODYFORM HANDLERS...)")
1408 (track-mouse . "(track-mouse BOFY ...)")
1409 (ml-if . "(ml-if COND THEN ELSE...)"))))
1411 ;;; help.el ends here