unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: monnier+gnu/emacs@rum.cs.yale.edu, emacs-devel@gnu.org, d.love@dl.ac.uk
Subject: Re: problem of define-minor-mode while bootstrapping
Date: Sun, 22 Sep 2002 18:54:07 -0400	[thread overview]
Message-ID: <200209222254.g8MMs8I26785@rum.cs.yale.edu> (raw)
In-Reply-To: 200209210157.KAA05776@etlken.m17n.org

> > Do you mean that you'd rather see
> > 	,(if globalp
> > 	    `(if (and load-file-name (not (equal ,mode ,init-value)))
> > 	         (eval-after-load load-file-name
> > 	          '(,mode (if ,mode 1 -1)))))
> No.

Good ;-)

> > I'm not sure it's worth the trouble.  The reason for this little piece
> > of code is so as to call (foo-mode 1) when people do (setq foo-mode t)
> > in their .emacs and then load foo-mode.el.
> > But people shouldn't use (setq foo-mode t), they should use (foo-mode 1)
> > instead anyway.
> > So I'd rather use that code less often rather than more often.
> 
> What I want is to make this work well at bootstrapping time
> because now ucs-tables.el is preloaded.

Does it not work right now ?

> (define-minor-mode unify-8859-on-encoding-mode
>   "..."
>   :group 'mule
>   :global t
>   :init-value t
>   (if unify-8859-on-encoding-mode
>       (ucs-unify-8859 t)
>     (ucs-fragment-8859 t)))
> 
> When use-tables.el is loaded and this code run, it must run
> (if ...) after setting the variable
> unify-8859-on-encoding-mode to t.  Otherwise, the value of
> unify-8859-on-encoding-mode doesn't synchronize with the
> acutual status of the mode.

Sure.  That was the problem: unification was ON but
unify-8859-on-encoding-mode was still nil.  So I fixed the
init value to reflect reality.

> After your change, define-minor-mode never run (if ...),
> which is worse.

Why is it worse ?  It's the programmer's responsability to
make sure that the init-value is consistent with the state
of Emacs when the file is loaded.

If you want it to be automatic, then what's wrong with the code
suggested above to which you said "No" ?


	Stefan

  reply	other threads:[~2002-09-22 22:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-19 13:20 problem of define-minor-mode while bootstrapping Kenichi Handa
2002-09-19 13:46 ` Stefan Monnier
2002-09-20  0:06   ` Kenichi Handa
2002-09-20 18:38     ` Stefan Monnier
2002-09-21  1:57       ` Kenichi Handa
2002-09-22 22:54         ` Stefan Monnier [this message]
2002-09-23  2:08           ` Kenichi Handa
2002-09-23 18:27             ` Stefan Monnier
2002-09-24  3:06               ` Kenichi Handa
2002-09-24 15:33                 ` Stefan Monnier
2002-09-24 23:45                   ` Kenichi Handa
2002-09-21  2:00       ` Miles Bader
2002-09-22 15:55         ` Richard Stallman
2002-09-25 22:50           ` Dave Love
2002-09-26 21:45             ` Richard Stallman
2002-09-27 14:09               ` Dave Love
2002-09-28  3:19                 ` Richard Stallman
2002-09-30  6:26                   ` Kenichi Handa
2002-10-18  7:00                     ` Richard Stallman
2002-10-18  8:38                       ` Kenichi Handa
2002-10-20  5:34                         ` Richard Stallman
2002-10-02 22:49                   ` Dave Love
2002-10-04  3:49                     ` Richard Stallman
2002-09-22 21:40         ` 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=200209222254.g8MMs8I26785@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=d.love@dl.ac.uk \
    --cc=emacs-devel@gnu.org \
    /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).