all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lektu@terra.es>
Subject: Re: mentioning variable aliases in `describe-variable'
Date: Tue, 16 Jul 2002 13:31:35 +0200	[thread overview]
Message-ID: <20020716131726.4190.LEKTU@terra.es> (raw)
In-Reply-To: <200207121525.g6CFPXc07608@rum.cs.yale.edu>

On Fri, 12 Jul 2002 11:25:33 -0400, "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> 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

  parent reply	other threads:[~2002-07-16 11:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-10  9:42 mentioning variable aliases in `describe-variable' John Paul Wallington
2002-07-11 19:25 ` Stefan Monnier
2002-07-12  0:30   ` John Paul Wallington
2002-07-12 10:17     ` Juanma Barranquero
2002-07-12 15:25       ` Stefan Monnier
2002-07-15 15:40         ` Juanma Barranquero
2002-07-16 11:31         ` Juanma Barranquero [this message]
2002-07-17  3:04           ` Richard Stallman
2002-07-17  8:02             ` Juanma Barranquero
2002-07-17 13:06               ` arglist in docstring (was: mentioning variable aliases in `describe-variable' ) Stefan Monnier
2002-07-17 13:51                 ` Juanma Barranquero
2002-07-17 14:33                   ` Stefan Monnier
2002-07-17 15:02                     ` Juanma Barranquero
2002-07-17 14:21                 ` Juanma Barranquero
2002-07-17 14:31                   ` Stefan Monnier
2002-07-17 15:15                     ` Juanma Barranquero
2002-07-18 14:55                   ` Richard Stallman
2002-07-18 15:25                     ` Juanma Barranquero
2002-07-18 21:14                       ` Richard Stallman
2002-07-19  6:28                         ` Juanma Barranquero
2002-07-12  7:18   ` mentioning variable aliases in `describe-variable' Juanma Barranquero
2002-07-12  7:55     ` John Paul Wallington
2002-07-12  8:00       ` Miles Bader
2002-07-12  8:47         ` John Paul Wallington
2002-07-12 10:26           ` Juanma Barranquero
2002-07-12 15:25         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020716131726.4190.LEKTU@terra.es \
    --to=lektu@terra.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.