unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Richard M. Stallman" <rms@gnu.org>
Cc: lekktu@gmail.com, emacs-devel@gnu.org
Subject: Re: Argument names in Elisp Reference vs docstrings
Date: Sat, 17 Sep 2005 09:39:28 -0400	[thread overview]
Message-ID: <E1EGcue-0003jY-Aj@fencepost.gnu.org> (raw)
In-Reply-To: <874q8ku0h1.fsf@jurta.org> (message from Juri Linkov on Sat, 17 Sep 2005 01:16:38 +0300)

    > I don't like "collection" very much.

    "collection" is used in the Emacs Lisp Reference Manual for the
    functions `try-completion', `all-completions', `test-completion'
    and `completing-read'.

`collection' is the best name I could think of for this purpose,
but I don't think it is a very good one.  It would be nice to
find something better.

    Perhaps a better name for this argument is "completions".

It doesn't feel right to me, because usually we use plural
names as arguments when they refer to a list of values.
`completions' would be appropriate for a list of completions,
but it doesn't quite fit for an alist, an obarray, or a hash table,
or a function to test them.

    >       nospace, hide-spaces
    >
    > "nospace" and "hide-spaces" suggest different meanings.  I don't know
    > how they are actually used, but it is possible that it is better to
    > keep them both.

    Both argument names are used for the same function `all-completions':
    "hide-spaces" is used in the docstring, and "nospace" - in the
    Emacs Lisp Reference Manual.

I think `nospace' is clearer for this meaning.

    >       history, hist
    >
    > The only possible reason not to change "hist" to "history"
    > is to save space.

    If the meaning of "hist" is as clear as "history", then it could
    be used consistently in other functions as well.

`hist' is not quite as clear.  If there is plenty of space, `history'
is better than `hist'.

    >       require-match, mustmatch, must-match, existing
    >
    > This seems like a good case to standardize, but it is possible
    > that there is a reason to use "existing" in a specific case.

    "existing" is used only in the Emacs Lisp Reference Manual.

For the function `read-buffer', the name `existing' fits better
semantically, since t means the argument must name an existing buffer.
You could say that it "must match" the name of an existing buffer, but
that is not as natural.  Likewise for `read-file-name' and perhaps
other similar functions.

However, for `completing-read', the concept of `match' fits better.
So `must-match' would be the best name ot use.

  reply	other threads:[~2005-09-17 13:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 14:46 Argument names in Elisp Reference vs docstrings Juanma Barranquero
2005-09-14 14:08 ` Richard M. Stallman
2005-09-15 22:03   ` Juri Linkov
2005-09-16 12:02     ` Andreas Schwab
2005-09-16 22:14       ` Juri Linkov
2005-09-16 12:59     ` Richard M. Stallman
2005-09-16 22:16       ` Juri Linkov
2005-09-17 13:39         ` Richard M. Stallman [this message]
2005-09-17 14:30           ` Drew Adams
2005-09-17 20:20             ` Robert J. Chassell
2005-09-19 15:54               ` Drew Adams
2005-09-19 17:15                 ` Robert J. Chassell
2005-09-19  1:31             ` Richard M. Stallman
2005-09-19  8:04               ` Kim F. Storm
2005-09-16 14:59     ` Drew Adams
2005-09-16 15:28       ` Juanma Barranquero
2005-09-16 22:17       ` Juri Linkov
2005-09-16 23:19         ` Drew Adams
2005-09-16 23:48           ` Juri Linkov
2005-09-17  0:53             ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=E1EGcue-0003jY-Aj@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).