all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Changing a customizable variable programatically?
@ 2002-09-17 18:34 Joe Casadonte
  2002-09-18  8:00 ` Klaus Berndl
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Casadonte @ 2002-09-17 18:34 UTC (permalink / raw)



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!

--
Regards,

joe
Joe Casadonte
jcasadonte@northbound-train.com

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Changing a customizable variable programatically?
  2002-09-17 18:34 Changing a customizable variable programatically? Joe Casadonte
@ 2002-09-18  8:00 ` Klaus Berndl
  0 siblings, 0 replies; 2+ messages in thread
From: Klaus Berndl @ 2002-09-18  8:00 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-18  8:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-17 18:34 Changing a customizable variable programatically? Joe Casadonte
2002-09-18  8:00 ` Klaus Berndl

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.