I am trying to write a global minor mode. The following illustrates my problem:
(define-minor-mode global-foo-mode :global t :lighter " FOO")
then run
M-x global-foo-mode
The message displayed is
Global-Foo mode disabled
The current buffer does not display the FOO lighter in its mode line, but every other buffer does. Subsequent invocations of M-x global-foo-mode
in various buffers seem to enable and disable the mode on the current buffer, but not globally as I would expect. Can anyone help me understand what I'm doing wrong here?