emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How global is a define-global-minor-mode mode?


From: Stefan Monnier
Subject: Re: How global is a define-global-minor-mode mode?
Date: Tue, 23 Jan 2007 18:00:46 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

>> Isn't it the case that it works if the minor mode function
>> corresponding to the variable is autoloaded?  Otherwise, IIRC you need
>> to add a :require to the definition of the minor mode.

>     Not really: if the global minor mode is autoloaded, then :require is
>     a nuisance,

> I don't follow.  Could you explain why it is a nuisance?

The :require thingy is a risk: if you move the definition of the mode to
another file, then the user's customizations will be broken (it happened
with global-font-lock-mode).

> And how does this relate to the question of whether the globalized
> mode is autoloaded?

If it's autoloaded, then the :require is not necessary because the handling
of the autoload cookie will make sure that the minor mode function will be
called when the user has customized the mode (and will thus trigger loading
the relevant file).

>               so to do it automatically, define-global-minor-mode would have
>     to know whether it's autoloaded or not.  And in most/all cases it's
>     autoloaded anyway and if not, it should.

> Are you proposing that every use of define-global-minor-mode should
> have an autoload cookie?

As a general rule, yes.  I'm sure we can come up with counter examples, tho,
so there's no point trying to enforce it.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]