* Making DOC argument of define-minor-mode optional
@ 2016-11-23 10:04 Philipp Stephani
2016-11-23 15:50 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Philipp Stephani @ 2016-11-23 10:04 UTC (permalink / raw)
To: Emacs developers
[-- Attachment #1: Type: text/plain, Size: 154 bytes --]
Hi,
the docstring created by define-minor-mode with nil DOC is useful and often
better than what users write. Should DOC therefore be optional?
Philipp
[-- Attachment #2: Type: text/html, Size: 223 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Making DOC argument of define-minor-mode optional
2016-11-23 10:04 Making DOC argument of define-minor-mode optional Philipp Stephani
@ 2016-11-23 15:50 ` Eli Zaretskii
2016-11-23 15:59 ` Nicolas Petton
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-11-23 15:50 UTC (permalink / raw)
To: Philipp Stephani; +Cc: emacs-devel
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Wed, 23 Nov 2016 10:04:13 +0000
>
> the docstring created by define-minor-mode with nil DOC is useful and often better than what users write.
> Should DOC therefore be optional?
Not sure we would like to educate Lisp programmers to stop thinking
about good doc strings.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Making DOC argument of define-minor-mode optional
2016-11-23 15:50 ` Eli Zaretskii
@ 2016-11-23 15:59 ` Nicolas Petton
2016-11-23 16:35 ` Drew Adams
0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Petton @ 2016-11-23 15:59 UTC (permalink / raw)
To: Eli Zaretskii, Philipp Stephani; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 298 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> the docstring created by define-minor-mode with nil DOC is useful and often better than what users write.
>> Should DOC therefore be optional?
>
> Not sure we would like to educate Lisp programmers to stop thinking
> about good doc strings.
I agree.
Nico
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Making DOC argument of define-minor-mode optional
2016-11-23 15:59 ` Nicolas Petton
@ 2016-11-23 16:35 ` Drew Adams
2016-11-27 21:13 ` Philipp Stephani
0 siblings, 1 reply; 7+ messages in thread
From: Drew Adams @ 2016-11-23 16:35 UTC (permalink / raw)
To: Nicolas Petton, Eli Zaretskii, Philipp Stephani; +Cc: emacs-devel
> >> the docstring created by define-minor-mode with nil DOC is useful
> >> and often better than what users write.
> >> Should DOC therefore be optional?
> >
> > Not sure we would like to educate Lisp programmers to stop
> > thinking about good doc strings.
>
> I agree.
Me too. And definers of user-facing things, such as
defcustom and defface, do require DOC. Other definers,
such as defconst and defvar, do not require it.
On the other hand, OP raises a real issue, I think.
I'd be in favor of (somehow) automatically having the
definer-provided DOC be augmented by a link that shows
the generic `define-minor-mode' doc, or similar.
IOW:
1. Definers should need to provide a DOC string (even if
they can fake it with "", which is not encouraged).
2. Users of the mode should have access to the generic
information also. It should be sufficient that the
DOC in the definition provides mode-specific information.
It should not need to tell users general things about
using a minor mode.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Making DOC argument of define-minor-mode optional
2016-11-23 16:35 ` Drew Adams
@ 2016-11-27 21:13 ` Philipp Stephani
2016-12-28 17:25 ` Philipp Stephani
0 siblings, 1 reply; 7+ messages in thread
From: Philipp Stephani @ 2016-11-27 21:13 UTC (permalink / raw)
To: Drew Adams, Nicolas Petton, Eli Zaretskii; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]
Drew Adams <drew.adams@oracle.com> schrieb am Mi., 23. Nov. 2016 um
17:35 Uhr:
> > >> the docstring created by define-minor-mode with nil DOC is useful
> > >> and often better than what users write.
> > >> Should DOC therefore be optional?
> > >
> > > Not sure we would like to educate Lisp programmers to stop
> > > thinking about good doc strings.
> >
> > I agree.
>
> Me too. And definers of user-facing things, such as
> defcustom and defface, do require DOC. Other definers,
> such as defconst and defvar, do not require it.
>
> On the other hand, OP raises a real issue, I think.
>
> I'd be in favor of (somehow) automatically having the
> definer-provided DOC be augmented by a link that shows
> the generic `define-minor-mode' doc, or similar.
>
> IOW:
>
> 1. Definers should need to provide a DOC string (even if
> they can fake it with "", which is not encouraged).
>
> 2. Users of the mode should have access to the generic
> information also. It should be sufficient that the
> DOC in the definition provides mode-specific information.
> It should not need to tell users general things about
> using a minor mode.
>
That sounds like a good approach.
[-- Attachment #2: Type: text/html, Size: 2149 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Making DOC argument of define-minor-mode optional
2016-11-27 21:13 ` Philipp Stephani
@ 2016-12-28 17:25 ` Philipp Stephani
2016-12-29 0:44 ` Drew Adams
0 siblings, 1 reply; 7+ messages in thread
From: Philipp Stephani @ 2016-12-28 17:25 UTC (permalink / raw)
To: Drew Adams, Nicolas Petton, Eli Zaretskii; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1994 bytes --]
Philipp Stephani <p.stephani2@gmail.com> schrieb am So., 27. Nov. 2016 um
22:13 Uhr:
> Drew Adams <drew.adams@oracle.com> schrieb am Mi., 23. Nov. 2016 um
> 17:35 Uhr:
>
> > >> the docstring created by define-minor-mode with nil DOC is useful
> > >> and often better than what users write.
> > >> Should DOC therefore be optional?
> > >
> > > Not sure we would like to educate Lisp programmers to stop
> > > thinking about good doc strings.
> >
> > I agree.
>
> Me too. And definers of user-facing things, such as
> defcustom and defface, do require DOC. Other definers,
> such as defconst and defvar, do not require it.
>
> On the other hand, OP raises a real issue, I think.
>
> I'd be in favor of (somehow) automatically having the
> definer-provided DOC be augmented by a link that shows
> the generic `define-minor-mode' doc, or similar.
>
> IOW:
>
> 1. Definers should need to provide a DOC string (even if
> they can fake it with "", which is not encouraged).
>
> 2. Users of the mode should have access to the generic
> information also. It should be sufficient that the
> DOC in the definition provides mode-specific information.
> It should not need to tell users general things about
> using a minor mode.
>
>
> That sounds like a good approach.
>
Do you have a good idea how to design the interface for this? I was
thinking about something like this: Create a new help type, "mode",
analogous to "variable" and "function". The documentation for the mode
would be different from the toggle command and the mode variable, which
would get a generic docstring. C-h o and C-h m would show the mode
docstring instead of the toggle command docstring. The mode docstring would
contain only a description of the mode itself, not the toggle command.
The primary downside is that many mode docstrings are written to be
applicable to the toggle command. Maybe `define-minor-mode' could grow a
:doc keyword argument for the mode docstring to preserve backward
compatibility.
[-- Attachment #2: Type: text/html, Size: 3503 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Making DOC argument of define-minor-mode optional
2016-12-28 17:25 ` Philipp Stephani
@ 2016-12-29 0:44 ` Drew Adams
0 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2016-12-29 0:44 UTC (permalink / raw)
To: Philipp Stephani, Nicolas Petton, Eli Zaretskii; +Cc: emacs-devel
[It's hard for me to follow the non plain-text messages you
send. In this case, it's not clear whom you are responding
to, and to whom you are asking the question. My part of the
thread was two quotes back - dunno who replied to me with
"That sounds like a good approach", to which you are replying.]
>> I'd be in favor of (somehow) automatically having the
>> definer-provided DOC be augmented by a link that shows
>> the generic `define-minor-mode' doc, or similar.
>>
>> IOW:
>>
>> 1. Definers should need to provide a DOC string (even if
>> they can fake it with "", which is not encouraged).
>>
>> 2. Users of the mode should have access to the generic
>> information also. It should be sufficient that the
>> DOC in the definition provides mode-specific information.
>> It should not need to tell users general things about
>> using a minor mode.
>
> Do you have a good idea how to design the interface for this?
I don't have an idea about the implementation; sorry.
> I was thinking about something like this: Create a new help
> type, "mode", analogous to "variable" and "function". The
> documentation for the mode would be different from the toggle
> command and the mode variable, which would get a generic
> docstring. C-h o and C-h m would show the mode docstring
> instead of the toggle command docstring. The mode docstring
> would contain only a description of the mode itself, not the
> toggle command.
>
> The primary downside is that many mode docstrings are written
> to be applicable to the toggle command. Maybe `define-minor-mode'
> could grow a :doc keyword argument for the mode docstring to
> preserve backward compatibility.
I do think that the doc for a minor mode should be accessible
in the same way as for other functions by a user: `C-h f'.
(It is also available from `C-h m'.)
I don't think the "toggle command" should get a different
doc string. In particular, it should not get only the
generic minor-mode doc string (e.g. how to toggle). It
should, as now, describe the mode. And a user should not
need to use a different key sequence to get different
bits of the relevant doc.
What I was suggesting was a bit the other way around:
have the specific mode doc have a link to generic doc
about toggling etc. Alternatively, include the generic
text (no link to it), with an indication that it is what
it is: description of the behavior of any minor mode.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-12-29 0:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-23 10:04 Making DOC argument of define-minor-mode optional Philipp Stephani
2016-11-23 15:50 ` Eli Zaretskii
2016-11-23 15:59 ` Nicolas Petton
2016-11-23 16:35 ` Drew Adams
2016-11-27 21:13 ` Philipp Stephani
2016-12-28 17:25 ` Philipp Stephani
2016-12-29 0:44 ` Drew Adams
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).