Mercurial > hg > xemacs-beta
diff lisp/cl-macs.el @ 5076:d555581e3cba
fix issues with display of argument docstrings
-------------------- ChangeLog entries follow: --------------------
lib-src/ChangeLog addition:
2010-02-25 Ben Wing <ben@xemacs.org>
* make-docfile.c:
* make-docfile.c (write_c_args):
Convert newlines to spaces so that argument lists are always on one
line, because that's what function-documentation-1 expects.
lisp/ChangeLog addition:
c2010-02-25 Ben Wing <ben@xemacs.org>
* autoload.el (make-autoload):
Call cl-function-arglist with one arg.
* cl-macs.el (cl-function-arglist):
* cl-macs.el (cl-transform-lambda):
Make cl-function-arglist take only one arg, the arglist; no
function name passed. Also make sure to print () instead of nil
when empty arglist, or function-documentation-1 won't recognize
the arguments: line.
* help.el (function-arglist): If empty arg, don't display extra
space after function name.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Thu, 25 Feb 2010 04:10:52 -0600 |
parents | cc74f60c150e |
children | 5502045ec510 |
line wrap: on
line diff
--- a/lisp/cl-macs.el Tue Feb 23 05:11:15 2010 -0600 +++ b/lisp/cl-macs.el Thu Feb 25 04:10:52 2010 -0600 @@ -297,27 +297,22 @@ (mapcar 'cl-upcase-arg arg))) (t arg))) ; Maybe we are in initializer -;; npak@ispras.ru +;; npak@ispras.ru, modified by ben@666.com ;;;###autoload -(defun cl-function-arglist (name arglist &optional omit-name) +(defun cl-function-arglist (arglist) "Returns string with printed representation of arguments list. Supports Common Lisp lambda lists." - ;; #### I would just change this so that OMIT-NAME is always true and - ;; eliminate the argument, but this function is autoloaded, which means - ;; someone might be using it somewhere. (if (not (or (listp arglist) (symbolp arglist))) "Not available" (check-argument-type #'true-list-p arglist) (let ((print-gensym nil)) (condition-case nil - (prin1-to-string - (let ((args (cond ((null arglist) nil) - ((listp arglist) (cl-upcase-arg arglist)) - ((symbolp arglist) - (cl-upcase-arg (list '&rest arglist))) - (t (wrong-type-argument 'listp arglist))))) - (if omit-name args - (cons (if (eq name 'cl-none) 'lambda name) args)))) + (let ((args (cond ((null arglist) nil) + ((listp arglist) (cl-upcase-arg arglist)) + ((symbolp arglist) + (cl-upcase-arg (list '&rest arglist))) + (t (wrong-type-argument 'listp arglist))))) + (if args (prin1-to-string args) "()")) (t "Not available"))))) (defun cl-transform-lambda (form bind-block) @@ -325,7 +320,7 @@ (bind-defs nil) (bind-enquote nil) (bind-inits nil) (bind-lets nil) (bind-forms nil) (header nil) (simple-args nil) - (complex-arglist (cl-function-arglist bind-block args t)) + (complex-arglist (cl-function-arglist args)) (doc "")) (while (or (stringp (car body)) (eq (car-safe (car body)) 'interactive)) (push (pop body) header)) @@ -352,7 +347,7 @@ ;; Add CL lambda list to documentation, if the CL lambda list differs ;; from the non-CL lambda list. npak@ispras.ru (unless (equal complex-arglist - (cl-function-arglist bind-block simple-args t)) + (cl-function-arglist simple-args)) (and (stringp (car header)) (setq doc (pop header))) ;; Stick the arguments onto the end of the doc string in a way that ;; will be recognized specially by `function-arglist'.