unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: [drew.adams@oracle.com: Info on define-minor-mode -:init-valueor :initial-value?]
Date: Sat, 30 Jul 2005 06:58:27 -0700	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICMEAICLAA.drew.adams@oracle.com> (raw)
In-Reply-To: <200507300422.j6U4MiB22285@raven.dms.auburn.edu>

    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?

  reply	other threads:[~2005-07-30 13:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-27 14:57 [drew.adams@oracle.com: Info on define-minor-mode - :init-value or :initial-value?] Richard M. Stallman
2005-07-27 16:04 ` Luc Teirlinck
2005-07-28 16:58   ` Stefan Monnier
2005-07-28 17:43     ` [drew.adams@oracle.com: Info on define-minor-mode - :init-valueor :initial-value?] Drew Adams
2005-07-29  2:56       ` Luc Teirlinck
2005-07-30 23:44         ` Richard M. Stallman
2005-07-31  0:43           ` Luc Teirlinck
2005-07-31 14:58             ` Juanma Barranquero
2005-08-01  0:45             ` Richard M. Stallman
2005-08-01  1:47               ` Luc Teirlinck
2005-08-01  5:33               ` Juanma Barranquero
2005-08-01 16:46                 ` Richard M. Stallman
2005-07-31  1:02           ` Luc Teirlinck
2005-08-01  0:45             ` Richard M. Stallman
2005-07-29 15:59       ` Stefan Monnier
2005-07-29 17:43         ` Drew Adams
2005-07-30  4:22         ` Luc Teirlinck
2005-07-30 13:58           ` Drew Adams [this message]
2005-07-30 21:46             ` [drew.adams@oracle.com: Info on define-minor-mode -:init-valueor :initial-value?] Luc Teirlinck
2005-07-29  1:48     ` [drew.adams@oracle.com: Info on define-minor-mode - :init-value or :initial-value?] Luc Teirlinck
2005-07-29 17:10       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICMEAICLAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).