diff options
author | Roland McGrath <roland@gnu.org> | 1993-03-31 21:11:33 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1993-03-31 21:11:33 +0000 |
commit | 0cd615e522ca0242e337999fbf4841d4c6560361 (patch) | |
tree | e2d099faf89b21d2deabef2a5ce988f7d7b33b2e /lisp/help.el | |
parent | 414fa34dd22c726294e76e9360b211063940b105 (diff) | |
download | emacs-0cd615e522ca0242e337999fbf4841d4c6560361.tar.gz |
(describe-function): For Lisp functions, write a prototype call before
the docstring, instead of an argument description after it.
Diffstat (limited to 'lisp/help.el')
-rw-r--r-- | lisp/help.el | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/lisp/help.el b/lisp/help.el index a067e23e0f6..8bcdd350792 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -281,7 +281,9 @@ C-w print information on absence of warranty for GNU Emacs." (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 @@ C-w print information on absence of warranty for GNU Emacs." )) (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)))) |