2

I want to define a minor mode whose global arg is set to t. To make sure the mode is actually active, I call describe-mode by typing C-h m. However, as soon as I add :global t the mode does not show in the list of active modes.

Here comes a minimal working example

(define-minor-mode test-mode
  " this is a test mode"
  ;; The initial value.
  nil
  ;; The indicator for the mode line.
  " test"
  ;; The minor mode bindings.
  nil)

(test-mode 1)

if I evaluate the above lines, "Test" appears in the list of active modes displayed by evaluating C-h m.

In contrast, when I evaluate

(define-minor-mode test-mode
  " this is a test mode"
  ;; The initial value.
  nil
  ;; The indicator for the mode line.
  " test"
  ;; The minor mode bindings.
  nil
  ;; Keyword args
  :global t)

(test-mode 1)

then I don't see "Test" in the list of active minor modes.

1 Answer 1

4
* Changes in Emacs 29.1

*** The 'C-h m' ('describe-mode') "*Help*" buffer has been reformatted.
It now only includes local minor modes at the start, and the global
minor modes are listed after the major mode.

Look for Global minor modes enabled: in the help buffer.

6
  • 2
    Good to know. I can understand why they moved all of that global minor mode doc to the end, but they should also have said, up front (where it lists the local minor modes) that global minor modes are described at the end. Poor UI.
    – Drew
    Apr 21 at 16:20
  • 1
    Yeah, it doesn't seem ideal. At least the buffer has page breaks, so if you C-x ] then the global mode info (being at the end of that first page) is just above.
    – phils
    Apr 21 at 17:16
  • debbugs.gnu.org/cgi/bugreport.cgi?bug=2473 is the reason for that change, and debbugs.gnu.org/cgi/bugreport.cgi?bug=64684 seems relevant as well. (With the latter these lists are gone completely from the UI; but you can S-TAB to collapse all the sections down to their headings -- which is then a list of all the enabled modes.)
    – phils
    Apr 21 at 17:21
  • Good to know the culprits. I think we agree that how/where to see such info should be pointed out at the top. It's too easy to read "Minor modes enabled in this buffer" as being the only description of the minor modes that are enabled. Global minor modes are also enabled in the buffer, and they're not listed there. IOW (1) Say "Local minor modes"... (not "Minor modes enabled in this buffer"), and (2) tell users where to see the info about the enabled global minor modes.
    – Drew
    Apr 21 at 20:41
  • In the list of global minor modes, however, it seems the modes are displayed according to the names and not according to the 'indicator for the mode line' variable, aren't they? At least changing this variable didn't change the how the mode was listed in the list of global minor modes.
    – Olmo
    Apr 30 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.