/[emacs]/emacs/lisp/help-fns.el
ViewVC logotype

Diff of /emacs/lisp/help-fns.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9.2.2 by miles, Fri Apr 4 06:20:06 2003 UTC revision 1.9.2.3 by miles, Tue Oct 14 23:51:05 2003 UTC
# Line 175  DEF is the function whose usage we're lo Line 175  DEF is the function whose usage we're lo
175  (defun help-add-fundoc-usage (doc arglist)  (defun help-add-fundoc-usage (doc arglist)
176    "Add the usage info to the docstring DOC.    "Add the usage info to the docstring DOC.
177  If DOC already has a usage info, then just return DOC unchanged.  If DOC already has a usage info, then just return DOC unchanged.
178  The usage info is built from ARGLIST.  DOC can be nil."  The usage info is built from ARGLIST.  DOC can be nil.
179    ARGLIST can also be t or a string of the form \"(fun ARG1 ARG2 ...)\"."
180    (unless (stringp doc) (setq doc "Not documented"))    (unless (stringp doc) (setq doc "Not documented"))
181    (if (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" doc)    (if (or (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" doc) (eq arglist t))
182        doc        doc
183      (format "%s%s%s" doc      (format "%s%s%s" doc
184              (if (string-match "\n?\n\\'" doc)              (if (string-match "\n?\n\\'" doc)
185                  (if (< (- (match-end 0) (match-beginning 0)) 2) "\n")                  (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "")
186                "\n\n")                "\n\n")
187              (help-make-usage 'fn arglist))))              (if (and (stringp arglist)
188                         (string-match "\\`([^ ]+\\(.*\\))\\'" arglist))
189                    (concat "(fn" (match-string 1 arglist) ")")
190                  (help-make-usage 'fn arglist)))))
191    
192  (defun help-function-arglist (def)  (defun help-function-arglist (def)
193    ;; Handle symbols aliased to other symbols.    ;; Handle symbols aliased to other symbols.
# Line 409  it is displayed along with the global va Line 413  it is displayed along with the global va
413                        (delete-region (1- from) from)))))                        (delete-region (1- from) from)))))
414              (terpri)              (terpri)
415              (when (local-variable-p variable)              (when (local-variable-p variable)
416                (princ (format "Local in buffer %s; " (buffer-name)))                (princ (format "%socal in buffer %s; "
417                                 (if (get variable 'permanent-local)
418                                     "Permanently l" "L")
419                                 (buffer-name)))
420                (if (not (default-boundp variable))                (if (not (default-boundp variable))
421                    (princ "globally void")                    (princ "globally void")
422                  (let ((val (default-value variable)))                  (let ((val (default-value variable)))
# Line 562  The descriptions are inserted in a buffe Line 569  The descriptions are inserted in a buffe
569    
570  (provide 'help-fns)  (provide 'help-fns)
571    
572    ;;; arch-tag: 9e10331c-ae81-4d13-965d-c4819aaab0b3
573  ;;; help-fns.el ends here  ;;; help-fns.el ends here

Legend:
Removed from v.1.9.2.2  
changed lines
  Added in v.1.9.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26