Quoting t and nil in docstrings (was: [Emacs-diffs] master b952385: Revert "Fix typo in add-hook doc string")

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Quoting t and nil in docstrings (was: [Emacs-diffs] master b952385: Revert "Fix typo in add-hook doc string")

Stefan Monnier
>     Revert "Fix typo in add-hook doc string"
[...]
> -This makes the hook buffer-local, and it makes it a member of the
> +This makes the hook buffer-local, and it makes t a member of the

This is as good an opportunity as any to question our long-standing
convention that the symbols `nil` and `t` are treated specially in
docstrings in the sense that we don't surround them with the customary
`...'.

FWIW, I don't find this exception to be beneficial here, nor in cases
like:

    `foo' means ...
    `bar' means ...
    nil   means ...
    t     means ...

Or when a sentence starts with "nil" (where the lack of capital letter
looks like a typo).

I think we could at least change our convention to say that nil and
t don't have to be quoted rather than to say that they should not
be quoted.


        Stefan

Reply | Threaded
Open this post in threaded view
|

Re: Quoting t and nil in docstrings

Robert Pluim
Stefan Monnier <[hidden email]> writes:

>>     Revert "Fix typo in add-hook doc string"
> [...]
>> -This makes the hook buffer-local, and it makes it a member of the
>> +This makes the hook buffer-local, and it makes t a member of the
>
> This is as good an opportunity as any to question our long-standing
> convention that the symbols `nil` and `t` are treated specially in
> docstrings in the sense that we don't surround them with the customary
> `...'.
>
> FWIW, I don't find this exception to be beneficial here, nor in cases
> like:
>
>     `foo' means ...
>     `bar' means ...
>     nil   means ...
>     t     means ...
>
> Or when a sentence starts with "nil" (where the lack of capital letter
> looks like a typo).
>
> I think we could at least change our convention to say that nil and
> t don't have to be quoted rather than to say that they should not
> be quoted.

Aren't you supposed to say @code{t} in texinfo? That seems
inconsistent with not quoting in docstrings.

Robert

Reply | Threaded
Open this post in threaded view
|

RE: Quoting t and nil in docstrings (was: [Emacs-diffs] master b952385: Revert "Fix typo in add-hook doc string")

Drew Adams
In reply to this post by Stefan Monnier
> >     Revert "Fix typo in add-hook doc string"
> [...]
> > -This makes the hook buffer-local, and it makes it a member of the
> > +This makes the hook buffer-local, and it makes t a member of the
>
> This is as good an opportunity as any to question our long-standing
> convention that the symbols `nil` and `t` are treated specially in
> docstrings in the sense that we don't surround them with the customary
> `...'.
>
> FWIW, I don't find this exception to be beneficial here, nor in cases
> like:
>
>     `foo' means ...
>     `bar' means ...
>     nil   means ...
>     t     means ...
>
> Or when a sentence starts with "nil" (where the lack of capital letter
> looks like a typo).
>
> I think we could at least change our convention to say that nil and
> t don't have to be quoted rather than to say that they should not
> be quoted.

+1

The (new) convention could be discretionary.
There are likely some contexts where it is not
necessary (but it wouldn't hurt).

Reply | Threaded
Open this post in threaded view
|

Re: Quoting t and nil in docstrings (was: [Emacs-diffs] master b952385: Revert "Fix typo in add-hook doc string")

Richard Stallman
In reply to this post by Stefan Monnier
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > This is as good an opportunity as any to question our long-standing
  > convention that the symbols `nil` and `t` are treated specially in
  > docstrings in the sense that we don't surround them with the customary
  > `...'.

I decided on that exception because generally it is convenient.
Symbols as fundamental as t and nil don't need markup.

  > I think we could at least change our convention to say that nil and
  > t don't have to be quoted rather than to say that they should not
  > be quoted.

I would agree with saying it is ok to give them quotes in special cases
where that makes the text clearer.

--
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)