[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
handled:
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
pre-loaded).
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?
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], (continued)
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Richard M. Stallman, 2005/07/30
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Luc Teirlinck, 2005/07/30
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Juanma Barranquero, 2005/07/31
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Richard M. Stallman, 2005/07/31
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Luc Teirlinck, 2005/07/31
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Luc Teirlinck, 2005/07/30
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Richard M. Stallman, 2005/07/31
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Stefan Monnier, 2005/07/29
- RE: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Drew Adams, 2005/07/29
- Re: address@hidden: Info on define-minor-mode - :init-valueor :initial-value?], Luc Teirlinck, 2005/07/30
- RE: address@hidden: Info on define-minor-mode -:init-valueor :initial-value?],
Drew Adams <=
- Re: address@hidden: Info on define-minor-mode -:init-valueor :initial-value?], Luc Teirlinck, 2005/07/30
- Re: address@hidden: Info on define-minor-mode - :init-value or :initial-value?], Luc Teirlinck, 2005/07/28
- Re: address@hidden: Info on define-minor-mode - :init-value or :initial-value?], Stefan Monnier, 2005/07/29