From: Klaus Berndl <Klaus.Berndl@raibau.raiffeisen.at>
Subject: Re: Changing a customizable variable programatically?
Date: 18 Sep 2002 10:00:32 +0200 [thread overview]
Message-ID: <uwupjralb.fsf@raibau.raiffeisen.at> (raw)
In-Reply-To: ur8fsbh3h.fsf@terrapin.northbound-train.com
On 17 Sep 2002, Joe Casadonte wrote:
>
> Is there any way to change a defcustom'ed variable programatically,
> and then have it saved via the custom mechanism for future use? I
> basically want to give users two ways to change this particular
> variable, one via a custom buffer, and one "in context". Is it as
> simple as calling `custom-save-variables'? Any comments on breaking
> the paradigm in this way? Thanks!
>
It is so simple! Look into the file the option *custom-file* points to
(if nil then the file the variable *user-init-file* points to) and you will
see there is nothing else then onw big `custom-set-variables' call.
The only important thing for changing defcustom-options via elisp is not to
use `setq' (or `let') because then all the :set, :initialize (and other)
clauses of the defcustom-form will no be evaluated which can result in
unwanted effects!
But i strongly recommend always using the customize-feature of Emacs for
changing defcustom-options!
BTW, just for my interest: What do you mean with "in context"??
Ciao,
klaus
--
Klaus Berndl mailto: klaus.berndl@sdm.de
sd&m AG http://www.sdm.de
software design & management
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220
prev parent reply other threads:[~2002-09-18 8:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-17 18:34 Changing a customizable variable programatically? Joe Casadonte
2002-09-18 8:00 ` Klaus Berndl [this message]
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=uwupjralb.fsf@raibau.raiffeisen.at \
--to=klaus.berndl@raibau.raiffeisen.at \
/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.