emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autoloaded defcustoms


From: Lennart Borgman
Subject: Re: Autoloaded defcustoms
Date: Mon, 5 Jan 2009 23:22:53 +0100

On Mon, Jan 5, 2009 at 11:15 PM, Stefan Monnier
<address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]