From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Semantics of autoload cookies on defcustoms
Date: Sun, 09 Jul 2006 01:32:22 -0400 [thread overview]
Message-ID: <jwv1wsv73og.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1FzJrW-0001jm-Fh@fencepost.gnu.org> (Richard Stallman's message of "Sat, 08 Jul 2006 16:57:14 -0400")
> Perhaps a good way to implement that is to write another argument into
> the custom-autoload call. That optional argument, if non-nil, would
> specify this new combination of behaviors that I called #3.
> The decision could be based on the presence of :set.
Well, there's no need for an extra arg: we just then skip the
custom-autoload and that should be all there is to it.
How 'bout the patch below?
What it does is the following:
1 - remove the minor-mode stuff which is unnecessary anyway (since the
custom-autoload line added just above already ensures that the package
gets loaded (which adds the setter) before the variable is custom-set).
2 - only add the custom-autoload line for those defcustom that have a setter
since it seems to be the only ones that need it.
I guess this isn't quite right tho: the var should still cause autoloading
if we want customize it (since it needs to go fetch the :type at the very
least). Is that what you meant by an additional arg to custom-autoload?
Stefan
--- autoload.el 28 mai 2006 22:48:22 -0400 1.115
+++ autoload.el 09 jui 2006 01:27:08 -0400
@@ -124,17 +124,11 @@
)
`(progn
(defvar ,varname ,init ,doc)
- (custom-autoload ',varname ,file)
- ;; The use of :require in a defcustom can be annoying, especially
- ;; when defcustoms are moved from one file to another between
- ;; releases because the :require arg gets placed in the user's
- ;; .emacs. In order for autoloaded minor modes not to need the
- ;; use of :require, we arrange to store their :setter.
,(let ((setter (condition-case nil
(cadr (memq :set form))
(error nil))))
- (if (equal setter ''custom-set-minor-mode)
- `(put ',varname 'custom-set 'custom-set-minor-mode))))))
+ (when setter
+ `(custom-autoload ',varname ,file))))))
((eq car 'defgroup)
;; In Emacs this is normally handled separately by cus-dep.el, but for
next prev parent reply other threads:[~2006-07-09 5:32 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
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 [this message]
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
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=jwv1wsv73og.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--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).