From: Phil Sainty <psainty@orcon.net.nz>
To: Tomas Nordin <tomasn@posteo.net>
Cc: 38601@debbugs.gnu.org
Subject: bug#38601: describe-mode never says the most important thing
Date: Mon, 16 Dec 2019 11:32:24 +1300 [thread overview]
Message-ID: <f6c8d26d-033a-a2a5-e85f-a2a657f86ebd@orcon.net.nz> (raw)
In-Reply-To: <877e2xtfkk.fsf@fliptop.i-did-not-set--mail-host-address--so-tickle-me>
On 16/12/19 11:00 AM, Tomas Nordin wrote:
> Phil Sainty <psainty@orcon.net.nz> writes:
>> (I do think there's an argument for showing the mode symbol rather
>> than a capitalised variant of the name in the `describe-mode' help;
>> but that's a different conversation.)
>
> A different conversation but I didn't see that so I take the
> opportunity to agree here. The capitalized variants of the command
> name was always confusing to me -- is it the command name, only
> with a big letter in the beginning, or is it some sort of doxy
> description that is not the same as the command name. Easy to check,
> but anyway.
For the major mode it's just the `mode-name' value.
For the minor modes it's the symbol name, sans "-minor-mode"/"-mode",
passed through `capitalize': "foo-bar-mode" becomes "Foo-Bar".
This is hard-coded in `describe-mode', which produces the following:
(pp-eval-expression
'(let (minor-modes)
;; Older packages do not register in minor-mode-list but only in
;; minor-mode-alist.
(dolist (x minor-mode-alist)
(setq x (car x))
(unless (memq x minor-mode-list)
(push x minor-mode-list)))
;; Find enabled minor mode we will want to mention.
(dolist (mode minor-mode-list)
;; Document a minor mode if it is listed in minor-mode-alist,
;; non-nil, and has a function definition.
(let ((fmode (or (get mode :minor-mode-function) mode)))
(and (boundp mode) (symbol-value mode)
(fboundp fmode)
(let ((pretty-minor-mode
(if (string-match "\\(\\(-minor\\)?-mode\\)?\\'"
(symbol-name fmode))
(capitalize
(substring (symbol-name fmode)
0 (match-beginning 0)))
fmode)))
(push (list fmode pretty-minor-mode
(format-mode-line
(assq mode minor-mode-alist)))
minor-modes)))))
minor-modes))
next prev parent reply other threads:[~2019-12-15 22:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-13 23:29 bug#38601: describe-mode never says the most important thing 積丹尼 Dan Jacobson
2019-12-14 7:42 ` Eli Zaretskii
2019-12-15 20:58 ` 積丹尼 Dan Jacobson
2021-04-18 16:43 ` Stefan Kangas
2019-12-15 2:09 ` Phil Sainty
2019-12-15 20:28 ` 積丹尼 Dan Jacobson
2019-12-15 22:00 ` Tomas Nordin
2019-12-15 22:32 ` Phil Sainty [this message]
2019-12-16 21:36 ` Juri Linkov
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=f6c8d26d-033a-a2a5-e85f-a2a657f86ebd@orcon.net.nz \
--to=psainty@orcon.net.nz \
--cc=38601@debbugs.gnu.org \
--cc=tomasn@posteo.net \
/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).