[Top][All Lists]

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

RE: address@hidden: Info on define-minor-mode -:init-valueor :initial-va

From: Drew Adams
Subject: RE: address@hidden: Info on define-minor-mode -:init-valueor :initial-value?]
Date: Sat, 30 Jul 2005 06:58:27 -0700

    What if I just document in the Elisp manual what the acceptable
    situations are for a non-nil :init-value and how it needs to be

    pre-load the file containing the define-minor-mode before startup.el
    and call the minor mode function (or custom-reevaluate-setting if the
    minor mode only has to be enabled conditionally) in startup.el for
    minor modes included with the Emacs distribution that affect Emacs
    "globally" and put (if foo-mode (foo-mode 1)) at the end of the file
    containing the define-minor-mode for minor modes that only affect
    features defined in that file (and that are in files that are not

FWIW, that's OK by me. In the user doc (Elisp), we should say "this is how
you create a minor mode..." and include the bit about (if foo-mode (foo-mode
1)) for non-nil init value. That is apparently an integral part of coding a
minor mode with a non-nil init value. If so, this should not be mentioned
only as an afterthought in an explanation of one of the examples.

And, since this is user doc, I would put the user bit first and the
"pre-load..." bit last, or remove the latter altogether. Most users reading
this will use define-minor-mode in their own libraries, not in stuff that is
part of Emacs. Or, if it is mentioned, perhaps mention it as a note to Emacs
maintainers/developers as an alternative for dealing with the issue in
internal code.

What about my suggestion of including this bit of code automatically, as
part of the expansion of define-minor-mode - perhaps by generating an
eval-after-load or something? Is that feasible? If so, would there be a
problem with such a hack?

reply via email to

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