unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: d.love@dl.ac.uk, miles@gnu.org,
	monnier+gnu/emacs@rum.cs.yale.edu, emacs-devel@gnu.org
Subject: Re: problem of define-minor-mode while bootstrapping
Date: Mon, 30 Sep 2002 15:26:02 +0900 (JST)	[thread overview]
Message-ID: <200209300626.PAA04899@etlken.m17n.org> (raw)
In-Reply-To: <E17v898-000334-00@fencepost.gnu.org> (message from Richard Stallman on Fri, 27 Sep 2002 23:19:58 -0400)

In article <E17v898-000334-00@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:
>>  Would you please be more specific?  I have no idea what that refers
>>  to.  The start of this conversation was a week or more ago, and I
>>  don't remember it.  What exactly is the RT that we can't D?

>     What handa's complaining about -- just define the minor mode
>     defaulting to on as far as I understand it.

> That is very sketchy.  It is enough remind someone who already knows
> the issue which issue is meant, but nowhere near enough to explain it
> to a person who doesn't know.

> Could someone explain to me what the issue is?

Ok, I'll repeast.

In RC, if both :global and :init-value of define-minor-mode
is non-nil, define-minor-mode calls eval-after-load as below:

       ;; If the mode is global, call the function according to the default.
       ,(if (and globalp (null init-value))
	    `(if (and load-file-name ,mode)
		 (eval-after-load load-file-name '(,mode 1)))))))

And, eval-after-load calls load-symbol-file-load-history,
and load-symbol-file-load-history loads "fns-XX.YY.ZZ.el".
But, at bootstrapping time, as "fns-XX.YY.ZZ.el" is not yet
generated, it signals an error.  It may not be a bug of
define-minor-mode, but a bug of eval-after-load or
load-symbol-file-load-history.  In any case, it should be
fixed at somewhere.

In HEAD instead, define-minor-mode now has this code:

       ;; If the mode is global, call the function according to the default.
       ,(if globalp
	    `(if (and load-file-name (not (equal ,init-value ,mode)))
		 (eval-after-load load-file-name '(,mode (if ,mode 1 -1))))))))

As (equal ,init-value ,mode) is t at bootstrapping time,
eval-after-load is not called, thus the above error is not
revealed.  But, as the result, it is now the programmer's
responsibility to make the XXX-minor-mode's status
synchronize to the value of XXX-minor-mode, i.e., we must do:

(define-minor-mode 'XXX-mode "" :global t :init-value t ...)
(XXX-mode 1)

I don't argue that this new behaviour is good or bad.  At
least, it is not a bug if properly described in the
docstring of define-minor-mode.

---
Ken'ichi HANDA
handa@m17n.org

  reply	other threads:[~2002-09-30  6:26 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
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 [this message]
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=200209300626.PAA04899@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=d.love@dl.ac.uk \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    --cc=monnier+gnu/emacs@rum.cs.yale.edu \
    /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).