all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Semantics of autoload cookies on defcustoms
Date: Fri, 07 Jul 2006 00:15:03 -0400	[thread overview]
Message-ID: <E1Fyhk7-0000hu-MB@fencepost.gnu.org> (raw)
In-Reply-To: <jwvodw4d7s6.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Wed, 05 Jul 2006 00:01:49 -0400)

    What is the intended effect of adding an autoload cookie on a defcustom?

It puts a defvar and the custom-autoload call into loaddefs.

    I ask this question because I recently noticed that setting variables such
    as diary-file via custom causes calendar.el to be loaded at startup, even
    tho I can't see any reason why such a setting would justify eagerly loading
    calendar.el.

There was a reason for this, and I used to know it, but I have
forgotten.

In order to process the specified value, custom needs the defcustom
info.  So there are two options:

1. Save the value away and process it if/when the defcustom is loaded.
2. Load the defcustom now, and process the value right away.

#1 is the usual method.  That is fine for variables that aren't really
defined at all until the package is loaded.

But when a variable is autoloaded, that means its value is meaningful
already, and it could be used at any time.  So there is no correct
alternative except #2.

Putting the actual defcustom into loaddefs would also work.  We would
not want to do that for all autoloaded defcustoms.  For one thing,
there are defcustoms for which this won't work.  For others, it would
just waste space inside the dumped Emacs.  But there could be some
(perhaps diary-file is one) for which this would be better.

It would not be hard to implement this option.  How could we
specify whether to do #2 or this?

  reply	other threads:[~2006-07-07  4:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-05  4:01 Semantics of autoload cookies on defcustoms Stefan Monnier
2006-07-07  4:15 ` Richard Stallman [this message]
2006-07-07 13:33   ` T. V. Raman
2006-07-07 14:10     ` Stefan Monnier
2006-07-08  1:13     ` Richard Stallman
2006-07-07 14:08   ` Stefan Monnier
2006-07-08  1:13     ` Richard Stallman
2006-07-08  3:53       ` Stefan Monnier
2006-07-08 20:57         ` Richard Stallman
2006-07-09  5:32           ` Stefan Monnier
2006-07-09 19:04             ` Richard Stallman
2006-07-10 16:12               ` Stefan Monnier
2006-07-11  5:51                 ` Richard Stallman
2006-07-13 21:13             ` Stefan Monnier
2006-07-16  6:26               ` Richard Stallman
2006-07-23  3:43                 ` 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

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

  git send-email \
    --in-reply-to=E1Fyhk7-0000hu-MB@fencepost.gnu.org \
    --to=rms@gnu.org \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.