all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: nljlistbox2@gmail.com (N. Jackson)
To: Drew Adams <drew.adams@oracle.com>
Cc: 25428@debbugs.gnu.org
Subject: bug#25428: 25.1; Incorrect doc string for `delete-selection-mode'
Date: Wed, 16 Aug 2017 21:55:09 -0400	[thread overview]
Message-ID: <87efsbrm9u.fsf@moondust.localdomain> (raw)
In-Reply-To: <d267f610-34c9-4ef6-a984-d05e18848b06@default> (Drew Adams's message of "Thu, 12 Jan 2017 08:24:39 -0800 (PST)")

At 07:24 -0800 on Thursday 2017-01-12, Drew Adams wrote:

> The doc string says this:
>
>   If called from Lisp, enable the mode if ARG is omitted or nil.
>
> That is completely wrong. This is an ordinary minor mode,
> defined using `define-minor-mode', whose doc string says this:
>
>   When called from Lisp, the mode command toggles the mode if
>   the argument is ‘toggle’, disables the mode if the argument is
>   a non-positive integer, and enables the mode otherwise
>   (including if the argument is omitted or nil or a positive
>   integer).

Hi Drew,

I do not see any contradiction between these two statements. Maybe
one of us is misreading them?

In particular, I find that the behaviour of
`delete-selection-mode' (the function) when called from Lisp
matches both statements in every particular, so I don't see what
you mean by "completely wrong".

> E.g., `(delete-selection-mode t)' ENABLES the mode, even though the
> `delete-selection-mode' doc string says that it DISABLES it.

Yes, this enables the mode, but no, the doc string does *not* say
this disables it. (In fact, it is silent on how to disable it from
Lisp.)

Am I missing something?

Admittedly, the part of its doc string that says how to use the
`delete-selection-mode' function from Lisp seems inadequate: It
doesn't say how to toggle the mode, it doesn't say how to disable
the mode, and the methods it mentions for enabling the mode do not
include the most straightforward one (passing it `t').

[Temporary minor rant: Personally it seems absurd to me that a
`nil' argument doesn't turn a minor mode off; and that calling the
minor mode function with no argument doesn't toggle it. But that
is all history of course.]

Anyway, does it make sense to re-document the canonical behaviour
of minor mode commands in the doc string of every minor mode
command?

Maybe it would be better (as I think you might have suggested in
another bug report back in January) if the doc string of the each
minor mode command had a link to the documentation of the
canonical behaviour.

N.






  reply	other threads:[~2017-08-17  1:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 16:24 bug#25428: 25.1; Incorrect doc string for `delete-selection-mode' Drew Adams
2017-08-17  1:55 ` N. Jackson [this message]
2017-08-17  2:24   ` npostavs
2017-08-17  3:25   ` Drew Adams
2017-08-26  9:03     ` Eli Zaretskii

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=87efsbrm9u.fsf@moondust.localdomain \
    --to=nljlistbox2@gmail.com \
    --cc=25428@debbugs.gnu.org \
    --cc=drew.adams@oracle.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 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.