all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 36500@debbugs.gnu.org
Subject: bug#36500: 26.2; Minor mode doc strings - say what the current mode-variable value is
Date: Mon, 08 Jul 2019 22:42:08 +0200	[thread overview]
Message-ID: <87ef302r8f.fsf@mouse.gnus.org> (raw)
In-Reply-To: <4dc6d6ce-351c-426a-8371-3ce170c74f1a@default> (Drew Adams's message of "Thu, 4 Jul 2019 08:19:36 -0700 (PDT)")

Drew Adams <drew.adams@oracle.com> writes:

> Have the automatically provided part of a minor-mode doc string, from
> `define-minor-mode' do the following (or at least some of it):
>
> 1. Mention the mode variable (typically the same name as the mode,
>    but in any case the name is known to `define-minor-mode').
>    (The doc string currently mentions the keymap, but not the var.)
>
> 2. Show the current value of the variable, just as we do for the keymap.
>    If undefined so far then say so, just as we do for the keymap.

Here's the current output from a random minor mode defined by that
function:

---

epa-mail-mode is an autoloaded interactive compiled Lisp function in
‘epa-mail.el’.

(epa-mail-mode &optional ARG)

A minor-mode for composing encrypted/clearsigned mails.

If called interactively, enable epa-mail mode if ARG is positive, and
disable it if ARG is zero or negative.  If called from Lisp,
also enable the mode if ARG is omitted or nil, and toggle it
if ARG is ‘toggle’; disable the mode otherwise.

---

No mention of a keymap?

> 3. Say whether the variable is global (an option, customizable), or
>    buffer-local.

Yes, that makes sense.  Currently a number of these modes say so
themselves, so that should also be adjusted:

---

auto-insert-mode is an autoloaded interactive compiled Lisp function
in ‘autoinsert.el’.

(auto-insert-mode &optional ARG)

Toggle Auto-insert mode, a global minor mode.

[...]

---

> 4. Maybe mention that the variable is set/reset automatically when you
>    toggle the mode.  If the var is global mention that you can set/reset
>    it manually using Customize.

Yup.

> 5. Any particularities, e.g. from using `:variable' should be taken into
>    account, so the doc string is correct for all cases.

Makes sense.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2019-07-08 20:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04 15:19 bug#36500: 26.2; Minor mode doc strings - say what the current mode-variable value is Drew Adams
2019-07-08 20:42 ` Lars Ingebrigtsen [this message]
2019-07-08 21:26   ` Drew Adams
2021-06-22 14:07 ` Lars Ingebrigtsen
2021-06-22 15:10   ` bug#36500: [External] : " 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

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

  git send-email \
    --in-reply-to=87ef302r8f.fsf@mouse.gnus.org \
    --to=larsi@gnus.org \
    --cc=36500@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.