all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Lennart Borgman" <lennart.borgman@gmail.com>
To: "Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: Autoloaded defcustoms
Date: Mon, 5 Jan 2009 23:22:53 +0100	[thread overview]
Message-ID: <e01d8a50901051422p26b2ca8cue1bae90fe9c476c2@mail.gmail.com> (raw)
In-Reply-To: <jwvsknxl7tu.fsf-monnier+emacs@gnu.org>

On Mon, Jan 5, 2009 at 11:15 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> If you add an autoload cookie to a defcustom
>>   ;;;###autoload
>>   (defcustom ourcomments-ido-ctrl-tab nil
>
>> and use get-file-autoloads on this then you get a load def
>
>>   (defvar ourcomments-ido-ctrl-tab nil "\
>>   bla bla doc")
>
>>   (custom-autoload 'ourcomments-ido-ctrl-tab "ourcomments-util" nil)
>
>> This does not take care of :set etc in the defcustom AFAICS. Shouldn't
>> it do that?
>
> It should and AFAIK it does.  But your notion of "take care of" might be
> different from mine.  So please be more specific.

If the load def above is run after custom-set-variables then the
custom-set part of the defcustom symbol is not run since
custom-autoload does not do that.

I suggest using something like this instead of custom-autoload

(defun nxhtml-custom-autoload (symbol load &optional noset)
  (custom-autoload symbol load noset)
  (let* ((standard (get symbol 'standard-value))
         (saved (get symbol 'saved-value))
         (need-set (get symbol 'custom-set)))
    (when (or need-set
              (equal standard saved))
      (custom-load-symbol symbol))))

But I am not sure about the details.

Jurij, could you please help with the details? What is necessary to do
in the function above?

>> (Is this the reason that minor modes defined in libraries
>> external to Emacs are not turned on properly?)
>
> I don't know what you're referring to.

Global minor modes have a custom-set symbol property that should be
run when setting the minor mode through custom.




  reply	other threads:[~2009-01-05 22:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05 18:21 Autoloaded defcustoms Lennart Borgman
2009-01-05 22:15 ` Stefan Monnier
2009-01-05 22:22   ` Lennart Borgman [this message]
2009-01-06  0:57     ` Juri Linkov
2009-01-06  2:16       ` Lennart Borgman
2009-01-06  3:20     ` Stefan Monnier
2009-01-06 12:27       ` Lennart Borgman
2009-01-06 14:54         ` Stefan Monnier
2009-01-06 15:00           ` Lennart Borgman
2009-01-06 15:07             ` Juri Linkov
2009-01-06 15:17               ` Lennart Borgman
2009-01-06 18:18                 ` Chetan Pandya
2009-01-06 18:21                   ` Lennart Borgman
2009-01-06 18:20                 ` 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=e01d8a50901051422p26b2ca8cue1bae90fe9c476c2@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.