unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Custom themes and simple variables
@ 2009-10-22 21:11 Ralf Angeli
  2009-10-23 16:53 ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Angeli @ 2009-10-22 21:11 UTC (permalink / raw)
  To: emacs-devel

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





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

end of thread, other threads:[~2009-10-23 17:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-22 21:11 Custom themes and simple variables Ralf Angeli
2009-10-23 16:53 ` Chong Yidong
2009-10-23 17:05   ` Ralf Angeli
2009-10-23 17:35     ` Chong Yidong
2009-10-23 17:55       ` Ralf Angeli

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).