summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-08-10 02:02:56 +0000
committerRichard M. Stallman <rms@gnu.org>1998-08-10 02:02:56 +0000
commitf643eaae77dbe8c25be5e71012310772070c684f (patch)
tree5989a268e3f29573b685edc7f98659aac2dda1c8
parent7f217c6e5d8341fc7a8c7d8f48232076c430ab30 (diff)
downloademacs-f643eaae77dbe8c25be5e71012310772070c684f.tar.gz
(describe-function-1): Handle macros properly.
Handle multiple levels of aliases.
-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."
((byte-code-function-p def)
(concat beg "compiled Lisp function"))
((symbolp def)
+ (while (symbolp (symbol-function def))
+ (setq def (symbol-function def)))
(format "alias for `%s'" def))
((eq (car-safe def) 'lambda)
(concat beg "Lisp function"))
@@ -625,14 +627,16 @@ C-w Display information on absence of warranty for GNU Emacs."
(if need-close (princ ")"))
(princ ".")
(terpri)
- (let* ((inner-function (if (and (listp def) 'macro)
- (cdr def)
- def))
- (arglist (cond ((byte-code-function-p inner-function)
- (car (append inner-function nil)))
- ((eq (car-safe inner-function) 'lambda)
- (nth 1 inner-function))
- (t t))))
+ ;; Handle symbols aliased to other symbols.
+ (setq def (indirect-function def))
+ ;; If definition is a macro, find the function inside it.
+ (if (eq (car-safe def) 'macro)
+ (setq def (cdr def)))
+ (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