Hrvoje Niksic <hniksic(a)iskon.hr> writes:
Why is macro arglist not displayed with `C-h f'? Case in point:
I'm
interested in `check-argument-type' macro. I press
[...]
Arglist is not printed anywhere, so this might imply that ARGUMENT
comes before PREDICATE, while in fact it doesn't.
So I wonder: why are arglists not printed for macros? Can we fix
that?
Yup. Here's the patch. After `cond' is indent changes.
2000-01-24 Yoshiki Hayashi <yoshiki(a)xemacs.org>
* help.el (function-arglist): Add case for macro.
Index: help.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/help.el,v
retrieving revision 1.26.2.8
diff -u -r1.26.2.8 help.el
--- help.el 1999/12/04 20:29:02 1.26.2.8
+++ help.el 2000/01/24 03:38:26
@@ -1018,24 +1018,27 @@
This function is used by `describe-function-1' to list function
arguments in the standard Lisp style."
- (let* ((fndef (indirect-function function))
+ (let* ((fnc (indirect-function function))
+ (fndef (if (eq (car-safe fnc) 'macro)
+ (cdr fnc)
+ fnc))
(arglist
- (cond ((compiled-function-p fndef)
- (compiled-function-arglist fndef))
- ((eq (car-safe fndef) 'lambda)
- (nth 1 fndef))
- ((subrp fndef)
- (let* ((doc (documentation function))
- (args (and (string-match
- "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'"
- doc)
- (match-string 1 doc))))
- ;; If there are no arguments documented for the
- ;; subr, rather don't print anything.
- (cond ((null args) t)
- ((equal args "") nil)
- (args))))
- (t t))))
+ (cond ((compiled-function-p fndef)
+ (compiled-function-arglist fndef))
+ ((eq (car-safe fndef) 'lambda)
+ (nth 1 fndef))
+ ((subrp fndef)
+ (let* ((doc (documentation function))
+ (args (and (string-match
+ "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'"
+ doc)
+ (match-string 1 doc))))
+ ;; If there are no arguments documented for the
+ ;; subr, rather don't print anything.
+ (cond ((null args) t)
+ ((equal args "") nil)
+ (args))))
+ (t t))))
(cond ((listp arglist)
(prin1-to-string
(cons function (mapcar (lambda (arg)
--
Yoshiki Hayashi