# HG changeset patch # User Roland McGrath # Date 733612293 0 # Node ID 46fcbdb6cc3a8f9be531f30cd5f9d2c566048a52 # Parent b6c62e4abf59a8ea02abe0869a442f1ecf75b80c (describe-function): For Lisp functions, write a prototype call before the docstring, instead of an argument description after it. diff -r b6c62e4abf59 -r 46fcbdb6cc3a lisp/help.el --- a/lisp/help.el Wed Mar 31 10:55:33 1993 +0000 +++ b/lisp/help.el Wed Mar 31 21:11:33 1993 +0000 @@ -281,7 +281,9 @@ (princ ": ") (let* ((def (symbol-function function)) (beg (if (commandp def) "an interactive " "a "))) - (princ (cond ((stringp def) "a keyboard macro.") + (princ (cond ((or (stringp def) + (vectorp def)) + "a keyboard macro.") ((subrp def) (concat beg "built-in function.")) ((byte-code-function-p def) @@ -303,24 +305,25 @@ )) (t ""))) (terpri) + (let ((arglist (cond ((byte-code-function-p def) + (car (append def nil))) + ((eq (car-safe def) 'lambda) + (nth 1 def)) + (t t)))) + (if (listp arglist) + (progn + (princ (cons function + (mapcar (lambda (arg) + (if (memq arg '(&optional &rest)) + arg + (intern (upcase (symbol-name arg))))) + arglist))) + (terpri)))) (if (documentation function) (progn (terpri) (princ (documentation function))) (princ "not documented")) - (cond ((byte-code-function-p def) - (save-excursion - (set-buffer standard-output) - (or (eq (char-after (1- (point-max))) ?\n) - (terpri))) - (terpri) - (princ (car (append def nil)))) - ((eq (car-safe def) 'lambda) - (save-excursion - (set-buffer standard-output) - (or (eq (char-after (1- (point-max))) ?\n) - (terpri))) - (terpri) - (princ (nth 1 def))))) + ) (print-help-return-message) ;; Return the text we displayed. (save-excursion (set-buffer standard-output) (buffer-string))))