unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Richard M. Stallman" <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Use of "optional argument" in docstring
Date: Sat, 03 Dec 2005 10:58:09 -0500	[thread overview]
Message-ID: <E1EiZm5-0005uE-4J@fencepost.gnu.org> (raw)
In-Reply-To: <22334.1133559098@olgas.newt.com> (message from Bill Wohler on Fri, 02 Dec 2005 13:31:38 -0800)

    Is there a convention regarding the use of explicitly using the word
    "optional" when describing an optional argument in the docstring?

It is not a firm convention, and I would rather not make it one,
since that would entail a lot of changes all around Emacs.
So do what you think is best.

However, "second optional argument" could be misleading.
In 
      (log arg &optional base)

BASE is the second argument, but it is not the second optional
argument.  Therefore, the current text is bad.  "Optional second
argument" would avoid that problem.

However, when there are so few arguments, it is not particularly
helpful to mention the numeric position of an argument.  Thus,
deleting "second" would be good here.  I will do that.

    I also think the documentation often reads better if the number and the
    word "argument" is dropped. For example, in the example above, "If BASE
    is given..." 

I think that would be clear enough.  Howewer, I think "the optional
argument" doesn't hurt, and it reads well here.  So I see no reason
to delete it.

    I suspect that the convention of using "optional second argument" comes
    from a day before Emacs printed the function spec in the *Help* buffer.
    If that had been the case, that docstring convention would have been
    imperative. It seems possible that the reason to use "optional second
    argument" no longer exists.

That is what I recall, too.

      parent reply	other threads:[~2005-12-03 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-02 21:31 Use of "optional argument" in docstring Bill Wohler
2005-12-02 21:49 ` Nick Roberts
2005-12-02 21:55   ` Lennart Borgman
2005-12-02 22:25   ` Bill Wohler
2005-12-02 22:43     ` Nick Roberts
2005-12-03 15:58 ` Richard M. Stallman [this message]

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=E1EiZm5-0005uE-4J@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).