GNU bug report logs -
#4887
globalized-minor-modes in new fundamental mode buffers
Previous Next
Reported by: mark.lillibridge <at> hp.com
Date: Sun, 8 Nov 2009 05:40:05 UTC
Severity: normal
Tags: wontfix
Merged with 5153
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #25 received at 4887 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > Should linum use a different implementation method than
> > define-globalized-minor-mode? (does one exist?)
>
> You mean global-linum-mode? Yes, it could use a different method,
> e.g. setting global hooks instead, but that might prove tricky.
>
> > Should we instead fix define-globalized-minor-mode to work with all
> > buffers? Its documentation via ^h f claims it works in every buffer:
>
> That would be the best solution, yes.
I agree. Any fix that worked for global-linum-mode should
presumably be implemented as part of define-globalized-minor-mode so
that other global minor modes can benefit as well.
> Given the hooks we currently have, it's not very easy because buffers
> like *Shadows* get created without running any hook, so basically the
> first hook that would get triggered might be something like
> window-configuration-change-hook, but that hooks has no easy way to
> decide whether that buffer was just created recently or on the contrary
> has been around for a long while (in which case enabling linum-mode
> might be very wrong since the user may have turned it off there
> earlier).
I thought about using advice on get-buffer-create, but the manual
recommends creating a hook instead. Could we create a new-buffer hook?
That would certainly solve the problem and simplify
define-globalized-minor-mode. I wonder though, if this would call the
minor mode turn on function too early in some cases.
Alternatively, it doesn't look very hard to use
window-configuration-change-hook; we would have to add some storage to
remember which buffers we had already enabled any given minor mode in.
> An easier solution is to not change anything to
> define-globalized-minor-mode and to require Elisp code to explicitly set
> a major mode for any buffer that will be displayed. E.g. for *Shadows*
> the Elisp code should explicitly call fundamental-mode in it.
This would work as well; who makes the call on these sorts of things?
(This is a change of conventions more than a code patch.)
- Mark
This bug report was last modified 9 years and 198 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.