/[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.31 by jpw, Sat Apr 12 04:27:46 2003 UTC revision 1.32 by monnier, Sun May 4 00:30:34 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 nil 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) (not arglist))
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.

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

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