emacs-devel
[Top][All Lists]
Advanced

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

Custom themes and simple variables


From: Ralf Angeli
Subject: Custom themes and simple variables
Date: Thu, 22 Oct 2009 23:11:34 +0200

Hi,

in AUCTeX we've traditionally had files one could `require' to enable
various settings for different TeX systems and platforms.  For example
if the user loaded tex-mik.el the viewer Yap provided by MiKTeX would be
configured to be used for previewing DVI files instead of xdvi.

I thought something like this could be handled in a more flexible way
with custom themes.  However, it seems that variables defined with
`defvar' in contrast to `defcustom' are not supported because the
`defvar' statement "overwrites" the value set by an active theme.

Here is a simple test case:

$ echo "(deftheme foo \"foo theme\") (custom-theme-set-variables 'foo '(foo 
\"original\")) (provide-theme 'foo)" > foo-theme.el
$ emacs -Q --eval "(progn (add-to-list 'load-path \".\") (load-theme 'foo) 
(defvar foo \"changed\") (describe-variable 'foo))"

The first command defines a theme called "foo" and writes it to disk as
the file foo-theme.el.  The second command calls Emacs, tells it to load
the theme, define the variable `foo' (for which the theme also contains
a value) and show the value of it.  This will be "changed".  If you do
the same thing using `defcustom' instead of `defvar' the value will be
"original".

I assume the problem is due to a variable defined with `defvar' not
being supported by the Custom machinery, so this is likely not a bug.
Would there nevertheless be a possibility to handle such variables
cleanly with custom themes?

-- 
Ralf





reply via email to

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