[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 <pjb@informatimago.com> 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.
- How to customize an option to a dynamic value (computed by lisp form), Jorge, 2016/08/24
- Re: How to customize an option to a dynamic value (computed by lisp form), Pascal J. Bourguignon, 2016/08/24
- Re: How to customize an option to a dynamic value (computed by lisp form),
Jorge <=
- RE: How to customize an option to a dynamic value (computed by lisp form), Drew Adams, 2016/08/25
- Re: How to customize an option to a dynamic value (computed by lisp form), Jorge, 2016/08/26
- Re: How to customize an option to a dynamic value (computed by lisp form), Jorge, 2016/08/26
- RE: How to customize an option to a dynamic value (computed by lisp form), Drew Adams, 2016/08/26
- Re: How to customize an option to a dynamic value (computed by lisp form), Jorge, 2016/08/26
- Re: How to customize an option to a dynamic value (computed by lisp form), Jorge, 2016/08/26
- RE: How to customize an option to a dynamic value (computed by lisp form), Drew Adams, 2016/08/26
- Re: How to customize an option to a dynamic value (computed by lisp form), tomas, 2016/08/27
- Re: How to customize an option to a dynamic value (computed by lisp form), Jorge, 2016/08/30