Fix Bug#22736
[emacs.git] / lisp / help-fns.el
blob6e8a108b5068d9767e73e25b531638ec168c34b2
1 ;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*-
3 ;; Copyright (C) 1985-1986, 1993-1994, 1998-2016 Free Software
4 ;; Foundation, Inc.
6 ;; Maintainer: emacs-devel@gnu.org
7 ;; Keywords: help, internal
8 ;; Package: emacs
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25 ;;; Commentary:
27 ;; This file contains those help commands which are complicated, and
28 ;; which may not be used in every session. For example
29 ;; `describe-function' will probably be heavily used when doing elisp
30 ;; programming, but not if just editing C files. Simpler help commands
31 ;; are in help.el
33 ;;; Code:
35 (require 'cl-lib)
36 (require 'help-mode)
38 (defvar help-fns-describe-function-functions nil
39 "List of functions to run in help buffer in `describe-function'.
40 Those functions will be run after the header line and argument
41 list was inserted, and before the documentation will be inserted.
42 The functions will receive the function name as argument.")
44 ;; Functions
46 (defvar describe-function-orig-buffer nil
47 "Buffer that was current when `describe-function' was invoked.
48 Functions on `help-fns-describe-function-functions' can use this
49 to get buffer-local values.")
51 ;;;###autoload
52 (defun describe-function (function)
53 "Display the full documentation of FUNCTION (a symbol)."
54 (interactive
55 (let ((fn (function-called-at-point))
56 (enable-recursive-minibuffers t)
57 val)
58 (setq val (completing-read (if fn
59 (format "Describe function (default %s): " fn)
60 "Describe function: ")
61 obarray 'fboundp t nil nil
62 (and fn (symbol-name fn))))
63 (list (if (equal val "")
64 fn (intern val)))))
65 (or (and function (symbolp function))
66 (user-error "You didn't specify a function symbol"))
67 (or (fboundp function)
68 (user-error "Symbol's function definition is void: %s" function))
70 ;; We save describe-function-orig-buffer on the help xref stack, so
71 ;; it is restored by the back/forward buttons. 'help-buffer'
72 ;; expects (current-buffer) to be a help buffer when processing
73 ;; those buttons, so we can't change the current buffer before
74 ;; calling that.
75 (let ((describe-function-orig-buffer
76 (or describe-function-orig-buffer
77 (current-buffer))))
79 (help-setup-xref
80 (list (lambda (function buffer)
81 (let ((describe-function-orig-buffer
82 (if (buffer-live-p buffer) buffer)))
83 (describe-function function)))
84 function describe-function-orig-buffer)
85 (called-interactively-p 'interactive))
87 (save-excursion
88 (with-help-window (help-buffer)
89 (prin1 function)
90 ;; Use " is " instead of a colon so that
91 ;; it is easier to get out the function name using forward-sexp.
92 (princ " is ")
93 (describe-function-1 function)
94 (with-current-buffer standard-output
95 ;; Return the text we displayed.
96 (buffer-string))))
100 ;; Could be this, if we make symbol-file do the work below.
101 ;; (defun help-C-file-name (subr-or-var kind)
102 ;; "Return the name of the C file where SUBR-OR-VAR is defined.
103 ;; KIND should be `var' for a variable or `subr' for a subroutine."
104 ;; (symbol-file (if (symbolp subr-or-var) subr-or-var
105 ;; (subr-name subr-or-var))
106 ;; (if (eq kind 'var) 'defvar 'defun)))
107 ;;;###autoload
108 (defun help-C-file-name (subr-or-var kind)
109 "Return the name of the C file where SUBR-OR-VAR is defined.
110 KIND should be `var' for a variable or `subr' for a subroutine."
111 (let ((docbuf (get-buffer-create " *DOC*"))
112 (name (if (eq 'var kind)
113 (concat "V" (symbol-name subr-or-var))
114 (concat "F" (subr-name (advice--cd*r subr-or-var))))))
115 (with-current-buffer docbuf
116 (goto-char (point-min))
117 (if (eobp)
118 (insert-file-contents-literally
119 (expand-file-name internal-doc-file-name doc-directory)))
120 (let ((file (catch 'loop
121 (while t
122 (let ((pnt (search-forward (concat "\x1f" name "\n"))))
123 (re-search-backward "\x1fS\\(.*\\)")
124 (let ((file (match-string 1)))
125 (if (member file build-files)
126 (throw 'loop file)
127 (goto-char pnt))))))))
128 (if (string-match "^ns.*\\(\\.o\\|obj\\)\\'" file)
129 (setq file (replace-match ".m" t t file 1))
130 (if (string-match "\\.\\(o\\|obj\\)\\'" file)
131 (setq file (replace-match ".c" t t file))))
132 (if (string-match "\\.\\(c\\|m\\)\\'" file)
133 (concat "src/" file)
134 file)))))
136 (defcustom help-downcase-arguments nil
137 "If non-nil, argument names in *Help* buffers are downcased."
138 :type 'boolean
139 :group 'help
140 :version "23.2")
142 (defun help-highlight-arg (arg)
143 "Highlight ARG as an argument name for a *Help* buffer.
144 Return ARG in face `help-argument-name'; ARG is also downcased
145 if the variable `help-downcase-arguments' is non-nil."
146 (propertize (if help-downcase-arguments (downcase arg) arg)
147 'face 'help-argument-name))
149 (defun help-do-arg-highlight (doc args)
150 (with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table)
151 (modify-syntax-entry ?\- "w")
152 (dolist (arg args)
153 (setq doc (replace-regexp-in-string
154 ;; This is heuristic, but covers all common cases
155 ;; except ARG1-ARG2
156 (concat "\\<" ; beginning of word
157 "\\(?:[a-z-]*-\\)?" ; for xxx-ARG
158 "\\("
159 (regexp-quote arg)
160 "\\)"
161 "\\(?:es\\|s\\|th\\)?" ; for ARGth, ARGs
162 "\\(?:-[a-z0-9-]+\\)?" ; for ARG-xxx, ARG-n
163 "\\(?:-[{([<`\"‘].*?\\)?"; for ARG-{x}, (x), <x>, [x], `x', ‘x’
164 "\\>") ; end of word
165 (help-highlight-arg arg)
166 doc t t 1)))
167 doc))
169 (defun help-highlight-arguments (usage doc &rest args)
170 (when (and usage (string-match "^(" usage))
171 (with-temp-buffer
172 (insert usage)
173 (goto-char (point-min))
174 (let ((case-fold-search nil)
175 (next (not (or args (looking-at "\\["))))
176 (opt nil))
177 ;; Make a list of all arguments
178 (skip-chars-forward "^ ")
179 (while next
180 (or opt (not (looking-at " &")) (setq opt t))
181 (if (not (re-search-forward " \\([\\[(]*\\)\\([^] &).]+\\)" nil t))
182 (setq next nil)
183 (setq args (cons (match-string 2) args))
184 (when (and opt (string= (match-string 1) "("))
185 ;; A pesky CL-style optional argument with default value,
186 ;; so let's skip over it
187 (search-backward "(")
188 (goto-char (scan-sexps (point) 1)))))
189 ;; Highlight arguments in the USAGE string
190 (setq usage (help-do-arg-highlight (buffer-string) args))
191 ;; Highlight arguments in the DOC string
192 (setq doc (and doc (help-do-arg-highlight doc args))))))
193 ;; Return value is like the one from help-split-fundoc, but highlighted
194 (cons usage doc))
196 ;; The following function was compiled from the former functions
197 ;; `describe-simplify-lib-file-name' and `find-source-lisp-file' with
198 ;; some excerpts from `describe-function-1' and `describe-variable'.
199 ;; The only additional twists provided are (1) locate the defining file
200 ;; for autoloaded functions, and (2) give preference to files in the
201 ;; "install directory" (directories found via `load-path') rather than
202 ;; to files in the "compile directory" (directories found by searching
203 ;; the loaddefs.el file). We autoload it because it's also used by
204 ;; `describe-face' (instead of `describe-simplify-lib-file-name').
206 ;;;###autoload
207 (defun find-lisp-object-file-name (object type)
208 "Guess the file that defined the Lisp object OBJECT, of type TYPE.
209 OBJECT should be a symbol associated with a function, variable, or face;
210 alternatively, it can be a function definition.
211 If TYPE is `defvar', search for a variable definition.
212 If TYPE is `defface', search for a face definition.
213 If TYPE is not a symbol, search for a function definition.
215 The return value is the absolute name of a readable file where OBJECT is
216 defined. If several such files exist, preference is given to a file
217 found via `load-path'. The return value can also be `C-source', which
218 means that OBJECT is a function or variable defined in C. If no
219 suitable file is found, return nil."
220 (let* ((autoloaded (autoloadp type))
221 (file-name (or (and autoloaded (nth 1 type))
222 (symbol-file
223 ;; FIXME: Why do we have this weird "If TYPE is the
224 ;; value returned by `symbol-function' for a function
225 ;; symbol" exception?
226 object (or (if (symbolp type) type) 'defun)))))
227 (cond
228 (autoloaded
229 ;; An autoloaded function: Locate the file since `symbol-function'
230 ;; has only returned a bare string here.
231 (setq file-name
232 (locate-file file-name load-path '(".el" ".elc") 'readable)))
233 ((and (stringp file-name)
234 (string-match "[.]*loaddefs.el\\'" file-name))
235 ;; An autoloaded variable or face. Visit loaddefs.el in a buffer
236 ;; and try to extract the defining file. The following form is
237 ;; from `describe-function-1' and `describe-variable'.
238 (let ((location
239 (condition-case nil
240 (find-function-search-for-symbol object nil file-name)
241 (error nil))))
242 (when (cdr location)
243 (with-current-buffer (car location)
244 (goto-char (cdr location))
245 (when (re-search-backward
246 "^;;; Generated autoloads from \\(.*\\)" nil t)
247 (setq file-name
248 (locate-file
249 (file-name-sans-extension
250 (match-string-no-properties 1))
251 load-path '(".el" ".elc") 'readable))))))))
253 (cond
254 ((and (not file-name) (subrp type))
255 ;; A built-in function. The form is from `describe-function-1'.
256 (if (get-buffer " *DOC*")
257 (help-C-file-name type 'subr)
258 'C-source))
259 ((and (not file-name) (symbolp object)
260 (integerp (get object 'variable-documentation)))
261 ;; A variable defined in C. The form is from `describe-variable'.
262 (if (get-buffer " *DOC*")
263 (help-C-file-name object 'var)
264 'C-source))
265 ((not (stringp file-name))
266 ;; If we don't have a file-name string by now, we lost.
267 nil)
268 ;; Now, `file-name' should have become an absolute file name.
269 ;; For files loaded from ~/.foo.elc, try ~/.foo.
270 ;; This applies to config files like ~/.emacs,
271 ;; which people sometimes compile.
272 ((let (fn)
273 (and (string-match "\\`\\..*\\.elc\\'"
274 (file-name-nondirectory file-name))
275 (string-equal (file-name-directory file-name)
276 (file-name-as-directory (expand-file-name "~")))
277 (file-readable-p (setq fn (file-name-sans-extension file-name)))
278 fn)))
279 ;; When the Elisp source file can be found in the install
280 ;; directory, return the name of that file.
281 ((let ((lib-name
282 (if (string-match "[.]elc\\'" file-name)
283 (substring-no-properties file-name 0 -1)
284 file-name)))
285 (or (and (file-readable-p lib-name) lib-name)
286 ;; The library might be compressed.
287 (and (file-readable-p (concat lib-name ".gz")) lib-name))))
288 ((let* ((lib-name (file-name-nondirectory file-name))
289 ;; The next form is from `describe-simplify-lib-file-name'.
290 (file-name
291 ;; Try converting the absolute file name to a library
292 ;; name, convert that back to a file name and see if we
293 ;; get the original one. If so, they are equivalent.
294 (if (equal file-name (locate-file lib-name load-path '("")))
295 (if (string-match "[.]elc\\'" lib-name)
296 (substring-no-properties lib-name 0 -1)
297 lib-name)
298 file-name))
299 (src-file (locate-library file-name t nil 'readable)))
300 (and src-file (file-readable-p src-file) src-file))))))
302 (defun help-fns--key-bindings (function)
303 (when (commandp function)
304 (let ((pt2 (with-current-buffer standard-output (point)))
305 (remapped (command-remapping function)))
306 (unless (memq remapped '(ignore undefined))
307 (let ((keys (where-is-internal
308 (or remapped function) overriding-local-map nil nil))
309 non-modified-keys)
310 (if (and (eq function 'self-insert-command)
311 (vectorp (car-safe keys))
312 (consp (aref (car keys) 0)))
313 (princ "It is bound to many ordinary text characters.\n")
314 ;; Which non-control non-meta keys run this command?
315 (dolist (key keys)
316 (if (member (event-modifiers (aref key 0)) '(nil (shift)))
317 (push key non-modified-keys)))
318 (when remapped
319 (princ "Its keys are remapped to ")
320 (princ (if (symbolp remapped)
321 (format-message "`%s'" remapped)
322 "an anonymous command"))
323 (princ ".\n"))
325 (when keys
326 (princ (if remapped
327 "Without this remapping, it would be bound to "
328 "It is bound to "))
329 ;; If lots of ordinary text characters run this command,
330 ;; don't mention them one by one.
331 (if (< (length non-modified-keys) 10)
332 (princ (mapconcat 'key-description keys ", "))
333 (dolist (key non-modified-keys)
334 (setq keys (delq key keys)))
335 (if keys
336 (progn
337 (princ (mapconcat 'key-description keys ", "))
338 (princ ", and many ordinary text characters"))
339 (princ "many ordinary text characters"))))
340 (when (or remapped keys non-modified-keys)
341 (princ ".")
342 (terpri)))))
344 (with-current-buffer standard-output
345 (fill-region-as-paragraph pt2 (point))
346 (unless (looking-back "\n\n" (- (point) 2))
347 (terpri))))))
349 (defun help-fns--compiler-macro (function)
350 (let ((handler (function-get function 'compiler-macro)))
351 (when handler
352 (insert "\nThis function has a compiler macro")
353 (if (symbolp handler)
354 (progn
355 (insert (format-message " `%s'" handler))
356 (save-excursion
357 (re-search-backward (substitute-command-keys "`\\([^`']+\\)'")
358 nil t)
359 (help-xref-button 1 'help-function handler)))
360 ;; FIXME: Obsolete since 24.4.
361 (let ((lib (get function 'compiler-macro-file)))
362 (when (stringp lib)
363 (insert (format-message " in `%s'" lib))
364 (save-excursion
365 (re-search-backward (substitute-command-keys "`\\([^`']+\\)'")
366 nil t)
367 (help-xref-button 1 'help-function-cmacro function lib)))))
368 (insert ".\n"))))
370 (defun help-fns--signature (function doc real-def real-function buffer)
371 "Insert usage at point and return docstring. With highlighting."
372 (if (keymapp function)
373 doc ; If definition is a keymap, skip arglist note.
374 (let* ((advertised (gethash real-def advertised-signature-table t))
375 (arglist (if (listp advertised)
376 advertised (help-function-arglist real-def)))
377 (usage (help-split-fundoc doc function)))
378 (if usage (setq doc (cdr usage)))
379 (let* ((use (cond
380 ((and usage (not (listp advertised))) (car usage))
381 ((listp arglist)
382 (help--make-usage-docstring function arglist))
383 ((stringp arglist) arglist)
384 ;; Maybe the arglist is in the docstring of a symbol
385 ;; this one is aliased to.
386 ((let ((fun real-function))
387 (while (and (symbolp fun)
388 (setq fun (symbol-function fun))
389 (not (setq usage (help-split-fundoc
390 (documentation fun)
391 function)))))
392 usage)
393 (car usage))
394 ((or (stringp real-def)
395 (vectorp real-def))
396 (format "\nMacro: %s"
397 (help--docstring-quote
398 (format-kbd-macro real-def))))
399 (t "[Missing arglist. Please make a bug report.]")))
400 ;; Insert "`X", not "(\` X)", when documenting `X.
401 (use1 (replace-regexp-in-string
402 "\\`(\\\\=\\\\\\\\=` \\([^\n ]*\\))\\'"
403 "\\\\=`\\1" use t))
404 (high (if buffer
405 (let (subst-use1 subst-doc)
406 (with-current-buffer buffer
407 (setq subst-use1 (substitute-command-keys use1))
408 (setq subst-doc (substitute-command-keys doc)))
409 (help-highlight-arguments subst-use1 subst-doc))
410 (cons use1 doc))))
411 (let ((fill-begin (point))
412 (high-usage (car high))
413 (high-doc (cdr high)))
414 (insert high-usage "\n")
415 (fill-region fill-begin (point))
416 high-doc)))))
418 (defun help-fns--parent-mode (function)
419 ;; If this is a derived mode, link to the parent.
420 (let ((parent-mode (and (symbolp function)
421 (get function
422 'derived-mode-parent))))
423 (when parent-mode
424 (insert (substitute-command-keys "\nParent mode: `"))
425 (let ((beg (point)))
426 (insert (format "%s" parent-mode))
427 (make-text-button beg (point)
428 'type 'help-function
429 'help-args (list parent-mode)))
430 (insert (substitute-command-keys "'.\n")))))
432 (defun help-fns--obsolete (function)
433 ;; Ignore lambda constructs, keyboard macros, etc.
434 (let* ((obsolete (and (symbolp function)
435 (get function 'byte-obsolete-info)))
436 (use (car obsolete)))
437 (when obsolete
438 (insert "\nThis "
439 (if (eq (car-safe (symbol-function function)) 'macro)
440 "macro"
441 "function")
442 " is obsolete")
443 (when (nth 2 obsolete)
444 (insert (format " since %s" (nth 2 obsolete))))
445 (insert (cond ((stringp use) (concat ";\n" use))
446 (use (format-message ";\nuse `%s' instead." use))
447 (t "."))
448 "\n"))))
450 ;; We could use `symbol-file' but this is a wee bit more efficient.
451 (defun help-fns--autoloaded-p (function file)
452 "Return non-nil if FUNCTION has previously been autoloaded.
453 FILE is the file where FUNCTION was probably defined."
454 (let* ((file (file-name-sans-extension (file-truename file)))
455 (load-hist load-history)
456 (target (cons t function))
457 found)
458 (while (and load-hist (not found))
459 (and (caar load-hist)
460 (equal (file-name-sans-extension (caar load-hist)) file)
461 (setq found (member target (cdar load-hist))))
462 (setq load-hist (cdr load-hist)))
463 found))
465 (defun help-fns--interactive-only (function)
466 "Insert some help blurb if FUNCTION should only be used interactively."
467 ;; Ignore lambda constructs, keyboard macros, etc.
468 (and (symbolp function)
469 (not (eq (car-safe (symbol-function function)) 'macro))
470 (let* ((interactive-only
471 (or (get function 'interactive-only)
472 (if (boundp 'byte-compile-interactive-only-functions)
473 (memq function
474 byte-compile-interactive-only-functions)))))
475 (when interactive-only
476 (insert "\nThis function is for interactive use only"
477 ;; Cf byte-compile-form.
478 (cond ((stringp interactive-only)
479 (format ";\nin Lisp code %s" interactive-only))
480 ((and (symbolp 'interactive-only)
481 (not (eq interactive-only t)))
482 (format-message ";\nin Lisp code use `%s' instead."
483 interactive-only))
484 (t "."))
485 "\n")))))
487 (defun help-fns-short-filename (filename)
488 (let* ((abbrev (abbreviate-file-name filename))
489 (short abbrev))
490 (dolist (dir load-path)
491 (let ((rel (file-relative-name filename dir)))
492 (if (< (length rel) (length short))
493 (setq short rel)))
494 (let ((rel (file-relative-name abbrev dir)))
495 (if (< (length rel) (length short))
496 (setq short rel))))
497 short))
499 ;;;###autoload
500 (defun describe-function-1 (function)
501 (let* ((advised (and (symbolp function)
502 (featurep 'nadvice)
503 (advice--p (advice--symbol-function function))))
504 ;; If the function is advised, use the symbol that has the
505 ;; real definition, if that symbol is already set up.
506 (real-function
507 (or (and advised
508 (advice--cd*r (advice--symbol-function function)))
509 function))
510 ;; Get the real definition.
511 (def (if (symbolp real-function)
512 (or (symbol-function real-function)
513 (signal 'void-function (list real-function)))
514 real-function))
515 (aliased (or (symbolp def)
516 ;; Advised & aliased function.
517 (and advised (symbolp real-function))))
518 (real-def (cond
519 (aliased (let ((f real-function))
520 (while (and (fboundp f)
521 (symbolp (symbol-function f)))
522 (setq f (symbol-function f)))
524 ((subrp def) (intern (subr-name def)))
525 (t def)))
526 (sig-key (if (subrp def)
527 (indirect-function real-def)
528 real-def))
529 (file-name (find-lisp-object-file-name function def))
530 (pt1 (with-current-buffer (help-buffer) (point)))
531 (beg (if (and (or (byte-code-function-p def)
532 (keymapp def)
533 (memq (car-safe def) '(macro lambda closure)))
534 (stringp file-name)
535 (help-fns--autoloaded-p function file-name))
536 (if (commandp def)
537 "an interactive autoloaded "
538 "an autoloaded ")
539 (if (commandp def) "an interactive " "a "))))
541 ;; Print what kind of function-like object FUNCTION is.
542 (princ (cond ((or (stringp def) (vectorp def))
543 "a keyboard macro")
544 ((subrp def)
545 (if (eq 'unevalled (cdr (subr-arity def)))
546 (concat beg "special form")
547 (concat beg "built-in function")))
548 ;; Aliases are Lisp functions, so we need to check
549 ;; aliases before functions.
550 (aliased
551 (format-message "an alias for `%s'" real-def))
552 ((autoloadp def)
553 (format "%s autoloaded %s"
554 (if (commandp def) "an interactive" "an")
555 (if (eq (nth 4 def) 'keymap) "keymap"
556 (if (nth 4 def) "Lisp macro" "Lisp function"))))
557 ((or (eq (car-safe def) 'macro)
558 ;; For advised macros, def is a lambda
559 ;; expression or a byte-code-function-p, so we
560 ;; need to check macros before functions.
561 (macrop function))
562 (concat beg "Lisp macro"))
563 ((byte-code-function-p def)
564 (concat beg "compiled Lisp function"))
565 ((eq (car-safe def) 'lambda)
566 (concat beg "Lisp function"))
567 ((eq (car-safe def) 'closure)
568 (concat beg "Lisp closure"))
569 ((keymapp def)
570 (let ((is-full nil)
571 (elts (cdr-safe def)))
572 (while elts
573 (if (char-table-p (car-safe elts))
574 (setq is-full t
575 elts nil))
576 (setq elts (cdr-safe elts)))
577 (concat beg (if is-full "keymap" "sparse keymap"))))
578 (t "")))
580 (if (and aliased (not (fboundp real-def)))
581 (princ ",\nwhich is not defined. Please make a bug report.")
582 (with-current-buffer standard-output
583 (save-excursion
584 (save-match-data
585 (when (re-search-backward (substitute-command-keys
586 "alias for `\\([^`']+\\)'")
587 nil t)
588 (help-xref-button 1 'help-function real-def)))))
590 (when file-name
591 ;; We used to add .el to the file name,
592 ;; but that's completely wrong when the user used load-file.
593 (princ (format-message " in `%s'"
594 (if (eq file-name 'C-source)
595 "C source code"
596 (help-fns-short-filename file-name))))
597 ;; Make a hyperlink to the library.
598 (with-current-buffer standard-output
599 (save-excursion
600 (re-search-backward (substitute-command-keys "`\\([^`']+\\)'")
601 nil t)
602 (help-xref-button 1 'help-function-def function file-name))))
603 (princ ".")
604 (with-current-buffer (help-buffer)
605 (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point))
606 (point)))
607 (terpri)(terpri)
609 (let ((doc-raw (documentation function t))
610 (key-bindings-buffer (current-buffer)))
612 ;; If the function is autoloaded, and its docstring has
613 ;; key substitution constructs, load the library.
614 (and (autoloadp real-def) doc-raw
615 help-enable-auto-load
616 (string-match "\\([^\\]=\\|[^=]\\|\\`\\)\\\\[[{<]" doc-raw)
617 (autoload-do-load real-def))
619 (help-fns--key-bindings function)
620 (with-current-buffer standard-output
621 (let ((doc (help-fns--signature function doc-raw sig-key
622 real-function key-bindings-buffer)))
623 (run-hook-with-args 'help-fns-describe-function-functions function)
624 (insert "\n"
625 (or doc "Not documented."))
626 ;; Avoid asking the user annoying questions if she decides
627 ;; to save the help buffer, when her locale's codeset
628 ;; isn't UTF-8.
629 (unless (memq text-quoting-style '(straight grave))
630 (set-buffer-file-coding-system 'utf-8))))))))
632 ;; Add defaults to `help-fns-describe-function-functions'.
633 (add-hook 'help-fns-describe-function-functions #'help-fns--obsolete)
634 (add-hook 'help-fns-describe-function-functions #'help-fns--interactive-only)
635 (add-hook 'help-fns-describe-function-functions #'help-fns--parent-mode)
636 (add-hook 'help-fns-describe-function-functions #'help-fns--compiler-macro)
639 ;; Variables
641 ;;;###autoload
642 (defun variable-at-point (&optional any-symbol)
643 "Return the bound variable symbol found at or before point.
644 Return 0 if there is no such symbol.
645 If ANY-SYMBOL is non-nil, don't insist the symbol be bound."
646 (with-syntax-table emacs-lisp-mode-syntax-table
647 (or (condition-case ()
648 (save-excursion
649 (skip-chars-forward "'")
650 (or (not (zerop (skip-syntax-backward "_w")))
651 (eq (char-syntax (following-char)) ?w)
652 (eq (char-syntax (following-char)) ?_)
653 (forward-sexp -1))
654 (skip-chars-forward "'")
655 (let ((obj (read (current-buffer))))
656 (and (symbolp obj) (boundp obj) obj)))
657 (error nil))
658 (let* ((str (find-tag-default))
659 (sym (if str (intern-soft str))))
660 (if (and sym (or any-symbol (boundp sym)))
662 (save-match-data
663 (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str))
664 (setq sym (intern-soft (match-string 1 str)))
665 (and (or any-symbol (boundp sym)) sym)))))
666 0)))
668 (defun describe-variable-custom-version-info (variable)
669 (let ((custom-version (get variable 'custom-version))
670 (cpv (get variable 'custom-package-version))
671 (output nil))
672 (if custom-version
673 (setq output
674 (format "This variable was introduced, or its default value was changed, in\nversion %s of Emacs.\n"
675 custom-version))
676 (when cpv
677 (let* ((package (car-safe cpv))
678 (version (if (listp (cdr-safe cpv))
679 (car (cdr-safe cpv))
680 (cdr-safe cpv)))
681 (pkg-versions (assq package customize-package-emacs-version-alist))
682 (emacsv (cdr (assoc version pkg-versions))))
683 (if (and package version)
684 (setq output
685 (format (concat "This variable was introduced, or its default value was changed, in\nversion %s of the %s package"
686 (if emacsv
687 (format " that is part of Emacs %s" emacsv))
688 ".\n")
689 version package))))))
690 output))
692 ;;;###autoload
693 (defun describe-variable (variable &optional buffer frame)
694 "Display the full documentation of VARIABLE (a symbol).
695 Returns the documentation as a string, also.
696 If VARIABLE has a buffer-local value in BUFFER or FRAME
697 \(default to the current buffer and current frame),
698 it is displayed along with the global value."
699 (interactive
700 (let ((v (variable-at-point))
701 (enable-recursive-minibuffers t)
702 val)
703 (setq val (completing-read (if (symbolp v)
704 (format
705 "Describe variable (default %s): " v)
706 "Describe variable: ")
707 obarray
708 (lambda (vv)
709 (or (get vv 'variable-documentation)
710 (and (boundp vv) (not (keywordp vv)))))
711 t nil nil
712 (if (symbolp v) (symbol-name v))))
713 (list (if (equal val "")
714 v (intern val)))))
715 (let (file-name)
716 (unless (buffer-live-p buffer) (setq buffer (current-buffer)))
717 (unless (frame-live-p frame) (setq frame (selected-frame)))
718 (if (not (symbolp variable))
719 (message "You did not specify a variable")
720 (save-excursion
721 (let ((valvoid (not (with-current-buffer buffer (boundp variable))))
722 (permanent-local (get variable 'permanent-local))
723 val val-start-pos locus)
724 ;; Extract the value before setting up the output buffer,
725 ;; in case `buffer' *is* the output buffer.
726 (unless valvoid
727 (with-selected-frame frame
728 (with-current-buffer buffer
729 (setq val (symbol-value variable)
730 locus (variable-binding-locus variable)))))
731 (help-setup-xref (list #'describe-variable variable buffer)
732 (called-interactively-p 'interactive))
733 (with-help-window (help-buffer)
734 (with-current-buffer buffer
735 (prin1 variable)
736 (setq file-name (find-lisp-object-file-name variable 'defvar))
738 (if file-name
739 (progn
740 (princ (format-message
741 " is a variable defined in `%s'.\n"
742 (if (eq file-name 'C-source)
743 "C source code"
744 (file-name-nondirectory file-name))))
745 (with-current-buffer standard-output
746 (save-excursion
747 (re-search-backward (substitute-command-keys
748 "`\\([^`']+\\)'")
749 nil t)
750 (help-xref-button 1 'help-variable-def
751 variable file-name)))
752 (if valvoid
753 (princ "It is void as a variable.")
754 (princ "Its ")))
755 (if valvoid
756 (princ " is void as a variable.")
757 (princ (substitute-command-keys "'s ")))))
758 (unless valvoid
759 (with-current-buffer standard-output
760 (setq val-start-pos (point))
761 (princ "value is ")
762 (let ((from (point))
763 (line-beg (line-beginning-position))
764 (print-rep
765 (let ((rep
766 (let ((print-quoted t))
767 (prin1-to-string val))))
768 (if (and (symbolp val) (not (booleanp val)))
769 (format-message "`%s'" rep)
770 rep))))
771 (if (< (+ (length print-rep) (point) (- line-beg)) 68)
772 (insert print-rep)
773 (terpri)
774 (pp val)
775 (if (< (point) (+ 68 (line-beginning-position 0)))
776 (delete-region from (1+ from))
777 (delete-region (1- from) from)))
778 (let* ((sv (get variable 'standard-value))
779 (origval (and (consp sv)
780 (condition-case nil
781 (eval (car sv))
782 (error :help-eval-error)))))
783 (when (and (consp sv)
784 (not (equal origval val))
785 (not (equal origval :help-eval-error)))
786 (princ "\nOriginal value was \n")
787 (setq from (point))
788 (pp origval)
789 (if (< (point) (+ from 20))
790 (delete-region (1- from) from)))))))
791 (terpri)
792 (when locus
793 (cond
794 ((bufferp locus)
795 (princ (format "Local in buffer %s; "
796 (buffer-name buffer))))
797 ((framep locus)
798 (princ (format "It is a frame-local variable; ")))
799 ((terminal-live-p locus)
800 (princ (format "It is a terminal-local variable; ")))
802 (princ (format "It is local to %S" locus))))
803 (if (not (default-boundp variable))
804 (princ "globally void")
805 (let ((global-val (default-value variable)))
806 (with-current-buffer standard-output
807 (princ "global value is ")
808 (if (eq val global-val)
809 (princ "the same.")
810 (terpri)
811 ;; Fixme: pp can take an age if you happen to
812 ;; ask for a very large expression. We should
813 ;; probably print it raw once and check it's a
814 ;; sensible size before prettyprinting. -- fx
815 (let ((from (point)))
816 (pp global-val)
817 ;; See previous comment for this function.
818 ;; (help-xref-on-pp from (point))
819 (if (< (point) (+ from 20))
820 (delete-region (1- from) from)))))))
821 (terpri))
823 ;; If the value is large, move it to the end.
824 (with-current-buffer standard-output
825 (when (> (count-lines (point-min) (point-max)) 10)
826 ;; Note that setting the syntax table like below
827 ;; makes forward-sexp move over a `'s' at the end
828 ;; of a symbol.
829 (set-syntax-table emacs-lisp-mode-syntax-table)
830 (goto-char val-start-pos)
831 ;; The line below previously read as
832 ;; (delete-region (point) (progn (end-of-line) (point)))
833 ;; which suppressed display of the buffer local value for
834 ;; large values.
835 (when (looking-at "value is") (replace-match ""))
836 (save-excursion
837 (insert "\n\nValue:")
838 (set (make-local-variable 'help-button-cache)
839 (point-marker)))
840 (insert "value is shown ")
841 (insert-button "below"
842 'action help-button-cache
843 'follow-link t
844 'help-echo "mouse-2, RET: show value")
845 (insert ".\n")))
846 (terpri)
848 (let* ((alias (condition-case nil
849 (indirect-variable variable)
850 (error variable)))
851 (obsolete (get variable 'byte-obsolete-variable))
852 (use (car obsolete))
853 (safe-var (get variable 'safe-local-variable))
854 (doc (or (documentation-property
855 variable 'variable-documentation)
856 (documentation-property
857 alias 'variable-documentation)))
858 (extra-line nil))
860 ;; Mention if it's a local variable.
861 (cond
862 ((and (local-variable-if-set-p variable)
863 (or (not (local-variable-p variable))
864 (with-temp-buffer
865 (local-variable-if-set-p variable))))
866 (setq extra-line t)
867 (princ " Automatically becomes ")
868 (if permanent-local
869 (princ "permanently "))
870 (princ "buffer-local when set.\n"))
871 ((not permanent-local))
872 ((bufferp locus)
873 (setq extra-line t)
874 (princ
875 (substitute-command-keys
876 " This variable's buffer-local value is permanent.\n")))
878 (setq extra-line t)
879 (princ (substitute-command-keys
880 " This variable's value is permanent \
881 if it is given a local binding.\n"))))
883 ;; Mention if it's an alias.
884 (unless (eq alias variable)
885 (setq extra-line t)
886 (princ (format-message
887 " This variable is an alias for `%s'.\n"
888 alias)))
890 (when obsolete
891 (setq extra-line t)
892 (princ " This variable is obsolete")
893 (if (nth 2 obsolete)
894 (princ (format " since %s" (nth 2 obsolete))))
895 (princ (cond ((stringp use) (concat ";\n " use))
896 (use (format-message ";\n use `%s' instead."
897 (car obsolete)))
898 (t ".")))
899 (terpri))
901 (when (member (cons variable val)
902 (with-current-buffer buffer
903 file-local-variables-alist))
904 (setq extra-line t)
905 (if (member (cons variable val)
906 (with-current-buffer buffer
907 dir-local-variables-alist))
908 (let ((file (and (buffer-file-name buffer)
909 (not (file-remote-p
910 (buffer-file-name buffer)))
911 (dir-locals-find-file
912 (buffer-file-name buffer))))
913 (dir-file t))
914 (princ (substitute-command-keys
915 " This variable's value is directory-local"))
916 (if (null file)
917 (princ ".\n")
918 (princ ", set ")
919 (if (consp file) ; result from cache
920 ;; If the cache element has an mtime, we
921 ;; assume it came from a file.
922 (if (nth 2 file)
923 (setq file (expand-file-name
924 dir-locals-file (car file)))
925 ;; Otherwise, assume it was set directly.
926 (setq file (car file)
927 dir-file nil)))
928 (princ (substitute-command-keys
929 (if dir-file
930 "by the file\n `"
931 "for the directory\n `")))
932 (with-current-buffer standard-output
933 (insert-text-button
934 file 'type 'help-dir-local-var-def
935 'help-args (list variable file)))
936 (princ (substitute-command-keys "'.\n"))))
937 (princ (substitute-command-keys
938 " This variable's value is file-local.\n"))))
940 (when (memq variable ignored-local-variables)
941 (setq extra-line t)
942 (princ " This variable is ignored as a file-local \
943 variable.\n"))
945 ;; Can be both risky and safe, eg auto-fill-function.
946 (when (risky-local-variable-p variable)
947 (setq extra-line t)
948 (princ " This variable may be risky if used as a \
949 file-local variable.\n")
950 (when (assq variable safe-local-variable-values)
951 (princ (substitute-command-keys
952 " However, you have added it to \
953 `safe-local-variable-values'.\n"))))
955 (when safe-var
956 (setq extra-line t)
957 (princ " This variable is safe as a file local variable ")
958 (princ "if its value\n satisfies the predicate ")
959 (princ (if (byte-code-function-p safe-var)
960 "which is a byte-compiled expression.\n"
961 (format-message "`%s'.\n" safe-var))))
963 (if extra-line (terpri))
964 (princ "Documentation:\n")
965 (with-current-buffer standard-output
966 (insert (or doc "Not documented as a variable."))))
968 ;; Make a link to customize if this variable can be customized.
969 (when (custom-variable-p variable)
970 (let ((customize-label "customize"))
971 (terpri)
972 (terpri)
973 (princ (concat "You can " customize-label " this variable."))
974 (with-current-buffer standard-output
975 (save-excursion
976 (re-search-backward
977 (concat "\\(" customize-label "\\)") nil t)
978 (help-xref-button 1 'help-customize-variable variable))))
979 ;; Note variable's version or package version.
980 (let ((output (describe-variable-custom-version-info variable)))
981 (when output
982 (terpri)
983 (terpri)
984 (princ output))))
986 (with-current-buffer standard-output
987 ;; Return the text we displayed.
988 (buffer-string))))))))
991 (defvar help-xref-stack-item)
993 ;;;###autoload
994 (defun describe-symbol (symbol &optional buffer frame)
995 "Display the full documentation of SYMBOL.
996 Will show the info of SYMBOL as a function, variable, and/or face.
997 Optional arguments BUFFER and FRAME specify for which buffer and
998 frame to show the information about SYMBOL; they default to the
999 current buffer and the selected frame, respectively."
1000 (interactive
1001 (let* ((v-or-f (symbol-at-point))
1002 (found (cl-some (lambda (x) (funcall (nth 1 x) v-or-f))
1003 describe-symbol-backends))
1004 (v-or-f (if found v-or-f (function-called-at-point)))
1005 (found (or found v-or-f))
1006 (enable-recursive-minibuffers t)
1007 (val (completing-read (if found
1008 (format
1009 "Describe symbol (default %s): " v-or-f)
1010 "Describe symbol: ")
1011 obarray
1012 (lambda (vv)
1013 (cl-some (lambda (x) (funcall (nth 1 x) vv))
1014 describe-symbol-backends))
1015 t nil nil
1016 (if found (symbol-name v-or-f)))))
1017 (list (if (equal val "")
1018 v-or-f (intern val)))))
1019 (if (not (symbolp symbol))
1020 (user-error "You didn't specify a function or variable"))
1021 (unless (buffer-live-p buffer) (setq buffer (current-buffer)))
1022 (unless (frame-live-p frame) (setq frame (selected-frame)))
1023 (with-current-buffer (help-buffer)
1024 ;; Push the previous item on the stack before clobbering the output buffer.
1025 (help-setup-xref nil nil)
1026 (let* ((docs
1027 (nreverse
1028 (delq nil
1029 (mapcar (pcase-lambda (`(,name ,testfn ,descfn))
1030 (when (funcall testfn symbol)
1031 ;; Don't record the current entry in the stack.
1032 (setq help-xref-stack-item nil)
1033 (cons name
1034 (funcall descfn symbol buffer frame))))
1035 describe-symbol-backends))))
1036 (single (null (cdr docs))))
1037 (while (cdr docs)
1038 (goto-char (point-min))
1039 (let ((inhibit-read-only t)
1040 (name (caar docs)) ;Name of doc currently at BOB.
1041 (doc (cdr (cadr docs)))) ;Doc to add at BOB.
1042 (when doc
1043 (insert doc)
1044 (delete-region (point)
1045 (progn (skip-chars-backward " \t\n") (point)))
1046 (insert "\n\n"
1047 (eval-when-compile
1048 (propertize "\n" 'face '(:height 0.1 :inverse-video t)))
1049 "\n")
1050 (when name
1051 (insert (symbol-name symbol)
1052 " is also a " name "." "\n\n"))))
1053 (setq docs (cdr docs)))
1054 (unless single
1055 ;; Don't record the `describe-variable' item in the stack.
1056 (setq help-xref-stack-item nil)
1057 (help-setup-xref (list #'describe-symbol symbol) nil))
1058 (goto-char (point-min)))))
1060 ;;;###autoload
1061 (defun describe-syntax (&optional buffer)
1062 "Describe the syntax specifications in the syntax table of BUFFER.
1063 The descriptions are inserted in a help buffer, which is then displayed.
1064 BUFFER defaults to the current buffer."
1065 (interactive)
1066 (setq buffer (or buffer (current-buffer)))
1067 (help-setup-xref (list #'describe-syntax buffer)
1068 (called-interactively-p 'interactive))
1069 (with-help-window (help-buffer)
1070 (let ((table (with-current-buffer buffer (syntax-table))))
1071 (with-current-buffer standard-output
1072 (describe-vector table 'internal-describe-syntax-value)
1073 (while (setq table (char-table-parent table))
1074 (insert "\nThe parent syntax table is:")
1075 (describe-vector table 'internal-describe-syntax-value))))))
1077 (defun help-describe-category-set (value)
1078 (insert (cond
1079 ((null value) "default")
1080 ((char-table-p value) "deeper char-table ...")
1081 (t (condition-case nil
1082 (category-set-mnemonics value)
1083 (error "invalid"))))))
1085 ;;;###autoload
1086 (defun describe-categories (&optional buffer)
1087 "Describe the category specifications in the current category table.
1088 The descriptions are inserted in a buffer, which is then displayed.
1089 If BUFFER is non-nil, then describe BUFFER's category table instead.
1090 BUFFER should be a buffer or a buffer name."
1091 (interactive)
1092 (setq buffer (or buffer (current-buffer)))
1093 (help-setup-xref (list #'describe-categories buffer)
1094 (called-interactively-p 'interactive))
1095 (with-help-window (help-buffer)
1096 (let* ((table (with-current-buffer buffer (category-table)))
1097 (docs (char-table-extra-slot table 0)))
1098 (if (or (not (vectorp docs)) (/= (length docs) 95))
1099 (error "Invalid first extra slot in this category table\n"))
1100 (with-current-buffer standard-output
1101 (insert "Legend of category mnemonics (see the tail for the longer description)\n")
1102 (let ((pos (point)) (items 0) lines n)
1103 (dotimes (i 95)
1104 (if (aref docs i) (setq items (1+ items))))
1105 (setq lines (1+ (/ (1- items) 4)))
1106 (setq n 0)
1107 (dotimes (i 95)
1108 (let ((elt (aref docs i)))
1109 (when elt
1110 (string-match ".*" elt)
1111 (setq elt (match-string 0 elt))
1112 (if (>= (length elt) 17)
1113 (setq elt (concat (substring elt 0 14) "...")))
1114 (if (< (point) (point-max))
1115 (move-to-column (* 20 (/ n lines)) t))
1116 (insert (+ i ?\s) ?: elt)
1117 (if (< (point) (point-max))
1118 (forward-line 1)
1119 (insert "\n"))
1120 (setq n (1+ n))
1121 (if (= (% n lines) 0)
1122 (goto-char pos))))))
1123 (goto-char (point-max))
1124 (insert "\n"
1125 "character(s)\tcategory mnemonics\n"
1126 "------------\t------------------")
1127 (describe-vector table 'help-describe-category-set)
1128 (insert "Legend of category mnemonics:\n")
1129 (dotimes (i 95)
1130 (let ((elt (aref docs i)))
1131 (when elt
1132 (if (string-match "\n" elt)
1133 (setq elt (substring elt (match-end 0))))
1134 (insert (+ i ?\s) ": " elt "\n"))))
1135 (while (setq table (char-table-parent table))
1136 (insert "\nThe parent category table is:")
1137 (describe-vector table 'help-describe-category-set))))))
1140 ;;; Replacements for old lib-src/ programs. Don't seem especially useful.
1142 ;; Replaces lib-src/digest-doc.c.
1143 ;;;###autoload
1144 (defun doc-file-to-man (file)
1145 "Produce an nroff buffer containing the doc-strings from the DOC file."
1146 (interactive (list (read-file-name "Name of DOC file: " doc-directory
1147 internal-doc-file-name t)))
1148 (or (file-readable-p file)
1149 (error "Cannot read file `%s'" file))
1150 (pop-to-buffer (generate-new-buffer "*man-doc*"))
1151 (setq buffer-undo-list t)
1152 (insert ".TH \"Command Summary for GNU Emacs\"\n"
1153 ".AU Richard M. Stallman\n")
1154 (insert-file-contents file)
1155 (let (notfirst)
1156 (while (search-forward "\x1f" nil 'move)
1157 (if (looking-at "S")
1158 (delete-region (1- (point)) (line-end-position))
1159 (delete-char -1)
1160 (if notfirst
1161 (insert "\n.DE\n")
1162 (setq notfirst t))
1163 (insert "\n.SH ")
1164 (insert (if (looking-at "F") "Function " "Variable "))
1165 (delete-char 1)
1166 (forward-line 1)
1167 (insert ".DS L\n"))))
1168 (insert "\n.DE\n")
1169 (setq buffer-undo-list nil)
1170 (nroff-mode))
1172 ;; Replaces lib-src/sorted-doc.c.
1173 ;;;###autoload
1174 (defun doc-file-to-info (file)
1175 "Produce a texinfo buffer with sorted doc-strings from the DOC file."
1176 (interactive (list (read-file-name "Name of DOC file: " doc-directory
1177 internal-doc-file-name t)))
1178 (or (file-readable-p file)
1179 (error "Cannot read file `%s'" file))
1180 (let ((i 0) type name doc alist)
1181 (with-temp-buffer
1182 (insert-file-contents file)
1183 ;; The characters "@{}" need special treatment.
1184 (while (re-search-forward "[@{}]" nil t)
1185 (backward-char)
1186 (insert "@")
1187 (forward-char 1))
1188 (goto-char (point-min))
1189 (while (search-forward "\x1f" nil t)
1190 (unless (looking-at "S")
1191 (setq type (char-after)
1192 name (buffer-substring (1+ (point)) (line-end-position))
1193 doc (buffer-substring (line-beginning-position 2)
1194 (if (search-forward "\x1f" nil 'move)
1195 (1- (point))
1196 (point)))
1197 alist (cons (list name type doc) alist))
1198 (backward-char 1))))
1199 (pop-to-buffer (generate-new-buffer "*info-doc*"))
1200 (setq buffer-undo-list t)
1201 ;; Write the output header.
1202 (insert "\\input texinfo @c -*-texinfo-*-\n"
1203 "@setfilename emacsdoc.info\n"
1204 "@settitle Command Summary for GNU Emacs\n"
1205 "@finalout\n"
1206 "\n@node Top\n"
1207 "@unnumbered Command Summary for GNU Emacs\n\n"
1208 "@table @asis\n\n"
1209 "@iftex\n"
1210 "@global@let@ITEM@item\n"
1211 "@def@item{@filbreak@vskip5pt@ITEM}\n"
1212 "@font@tensy cmsy10 scaled @magstephalf\n"
1213 "@font@teni cmmi10 scaled @magstephalf\n"
1214 "@def\\{{@tensy@char110}}\n" ; this backslash goes with cmr10
1215 "@def|{{@tensy@char106}}\n"
1216 "@def@{{{@tensy@char102}}\n"
1217 "@def@}{{@tensy@char103}}\n"
1218 "@def<{{@teni@char62}}\n"
1219 "@def>{{@teni@char60}}\n"
1220 "@chardef@@64\n"
1221 "@catcode43=12\n"
1222 "@tableindent-0.2in\n"
1223 "@end iftex\n")
1224 ;; Sort the array by name; within each name, by type (functions first).
1225 (setq alist (sort alist (lambda (e1 e2)
1226 (if (string-equal (car e1) (car e2))
1227 (<= (cadr e1) (cadr e2))
1228 (string-lessp (car e1) (car e2))))))
1229 ;; Print each function.
1230 (dolist (e alist)
1231 (insert "\n@item "
1232 (if (char-equal (cadr e) ?\F) "Function" "Variable")
1233 " @code{" (car e) "}\n@display\n"
1234 (nth 2 e)
1235 "\n@end display\n")
1236 ;; Try to avoid a save size overflow in the TeX output routine.
1237 (if (zerop (setq i (% (1+ i) 100)))
1238 (insert "\n@end table\n@table @asis\n")))
1239 (insert "@end table\n"
1240 "@bye\n")
1241 (setq buffer-undo-list nil)
1242 (texinfo-mode)))
1244 (provide 'help-fns)
1246 ;;; help-fns.el ends here