GNU bug report logs - #38601
describe-mode never says the most important thing

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sat, 14 Dec 2019 01:22:01 UTC

Severity: wishlist

Tags: notabug

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Tomas Nordin <tomasn <at> posteo.net>
Cc: 38601 <at> debbugs.gnu.org
Subject: bug#38601: describe-mode never says the most important thing
Date: Mon, 16 Dec 2019 11:32:24 +1300
On 16/12/19 11:00 AM, Tomas Nordin wrote:
> Phil Sainty <psainty <at> 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))





This bug report was last modified 4 years and 92 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.