GNU bug report logs -
#38111
27.0.50; globalized-minor-mode not enabled on get-buffer-create
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Thu, 7 Nov 2019 22:59:02 UTC
Severity: normal
Found in version 27.0.50
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #21 received at 38111 <at> debbugs.gnu.org (full text, mbox):
>> Sounds like globalized-minor-mode machinery somehow doesn't support
>> the latter method of creating a buffer?
>
> Yep, globalized modes use `after-change-major-mode-hook' to call the
> buffer-local minor mode, and that hook is not triggered in these cases
> because, although new buffers are in `fundamental-mode' by default,
> the `fundamental-mode' function is not actually called, and so no mode
> change occurs.
>
> I believe this has cropped up in past discussion, but I don't recall
> where offhand.
>
> I agree that it's surprising when you are expecting the global mode(s)
> to be enabled (I first realised it when attempting to use a globalized
> mode for my custom key bindings, and discovering they were not being
> enabled in various buffers).
>
> If this were changed then there *might* be undesirable consequences to
> having lots of created-behind-the-scenes buffers suddenly doing things
> they never did before.
>
> If the current behaviour is kept, the documentation for globalized
> modes and for creating buffers should probably say something about the
> matter.
Thanks for referring to the documentation. It already explains this in
(info "(elisp) Defining Minor Modes")
-- Macro: define-globalized-minor-mode global-mode mode turn-on
keyword-args... body...
...
Globally enabling the mode also affects buffers subsequently
created by visiting files, and buffers that use a major mode other
than Fundamental mode; but it does not detect the creation of a new
buffer in Fundamental mode.
This bug report was last modified 4 years and 244 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.