emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mentioning variable aliases in `describe-variable'


From: Juanma Barranquero
Subject: Re: mentioning variable aliases in `describe-variable'
Date: Tue, 16 Jul 2002 13:31:35 +0200

On Fri, 12 Jul 2002 11:25:33 -0400, "Stefan Monnier" 
<monnier+gnu/address@hidden> wrote:

> I think that defvaralias should be extended to allow a docstring
> (like I just did for defalias)

The defalias docstring precludes describe-function from finding the
argument list of built-ins, for example:

ELISP> (defalias 'test 'aref "No doc.")
aref
ELISP> (describe-function 'test)
#("test is an alias for `aref'.\n[Missing arglist.  Please make a bug 
report.]\n\nNo doc." 0 22 nil 22 26
  (help-args
   (aref)
   category #:help-function-button)
  26 27 nil 27 28 nil 28 29 nil 29 75 nil 75 76 nil 76 83 nil)

because the docstring for the alias does not have "\n\n(function ARGS)"
at the end.

Is that a bug or half a feature? I say "half" because you could do

(defalias 'new-aref
          'aref
          "New documentation.\n\n(aref TABLE INDEX)")

to change the name of the arguments in the alias, and you'll get

> new-aref is an alias for `aref'.
> (aref TABLE INDEX)
> 
> New documentation.

but the name in the argument list must still be the old one.

If it is a bug, AFAICS the only answers are either make `defalias' to
add the arglist to the end of the docstring of aliased built-ins (messy,
I think), or klugde `describe-function' to search the arglist of the
primitive function if the alias has a docstring (ugh).

Or document that you shouldn't add docstrings to aliases for built-ins :)

                                                           /L/e/k/t/u




reply via email to

[Prev in Thread] Current Thread [Next in Thread]