help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to customize an option to a dynamic value (computed by lisp form


From: Jorge
Subject: Re: How to customize an option to a dynamic value (computed by lisp form)
Date: Thu, 25 Aug 2016 14:55:36 -0300

On 24 August 2016 at 14:50, Pascal J. Bourguignon <address@hidden> wrote:

> Since the customization system updates the source form
> customize-variables in your init file (actually, in the file indicated by
> the custom-file customization variable), and when it saves this source
> form, it saves the values of the variables, not the dynamic expressions
> you would use to compute them, you won't have much choice if you want to
> keep it simple.
>
> Just set the customization variables to your expressions after the
> customize-variables form.
OK.  I have moved the customization of these three options to my
org-init.el.  Instead of the simple setq, I used
customize-set-variable, because it respects the respective custom-set
property (if it exists).

There remain two problems:
1.  customize-set-variable does not do type checking.  I have just
tested it by setting org-agenda-files to 42 (an integer).
set-variable does type checking, but does not respect any custom-set
property.  How can I elegantly combine both?  And shouldn't elisp
provide a convenient command for this?
2.  If I forget that these options are changed manually (Emacs does
not warn), and configure them via customize, then the new value will
be added to the custom-set-variables form with static values.  This
has two problems:
      1. It will have static values.
      2. Since org-init.el is called after the custom-set-variables
form, the values set in the form will be overwritten.



reply via email to

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