aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1998-08-10 02:02:56 +0000
committerRichard M. Stallman1998-08-10 02:02:56 +0000
commit3f8309db3c4d55544f7033a47cb55b1edbf34ff1 (patch)
tree66bd4fb234b7f63788a07a51cf79aa9b58759bca /lisp
parentb7f096eeeaacce0d73296ed647874b70c95f6cdf (diff)
downloademacs-3f8309db3c4d55544f7033a47cb55b1edbf34ff1.tar.gz
emacs-3f8309db3c4d55544f7033a47cb55b1edbf34ff1.zip
(describe-function-1): Handle macros properly.
Handle multiple levels of aliases.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/help.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/lisp/help.el b/lisp/help.el
index ba3c6d6d4cd..45d84b88970 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -585,6 +585,8 @@ C-w Display information on absence of warranty for GNU Emacs."
585 ((byte-code-function-p def) 585 ((byte-code-function-p def)
586 (concat beg "compiled Lisp function")) 586 (concat beg "compiled Lisp function"))
587 ((symbolp def) 587 ((symbolp def)
588 (while (symbolp (symbol-function def))
589 (setq def (symbol-function def)))
588 (format "alias for `%s'" def)) 590 (format "alias for `%s'" def))
589 ((eq (car-safe def) 'lambda) 591 ((eq (car-safe def) 'lambda)
590 (concat beg "Lisp function")) 592 (concat beg "Lisp function"))
@@ -625,14 +627,16 @@ C-w Display information on absence of warranty for GNU Emacs."
625 (if need-close (princ ")")) 627 (if need-close (princ ")"))
626 (princ ".") 628 (princ ".")
627 (terpri) 629 (terpri)
628 (let* ((inner-function (if (and (listp def) 'macro) 630 ;; Handle symbols aliased to other symbols.
629 (cdr def) 631 (setq def (indirect-function def))
630 def)) 632 ;; If definition is a macro, find the function inside it.
631 (arglist (cond ((byte-code-function-p inner-function) 633 (if (eq (car-safe def) 'macro)
632 (car (append inner-function nil))) 634 (setq def (cdr def)))
633 ((eq (car-safe inner-function) 'lambda) 635 (let ((arglist (cond ((byte-code-function-p def)
634 (nth 1 inner-function)) 636 (car (append def nil)))
635 (t t)))) 637 ((eq (car-safe def) 'lambda)
638 (nth 1 def))
639 (t t))))
636 (if (listp arglist) 640 (if (listp arglist)
637 (progn 641 (progn
638 (princ (cons function 642 (princ (cons function