all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ralf Angeli <angeli@caeruleus.net>
To: emacs-devel@gnu.org
Subject: Custom themes and simple variables
Date: Thu, 22 Oct 2009 23:11:34 +0200	[thread overview]
Message-ID: <hbsk24$ue6$1@ger.gmane.org> (raw)

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	other threads:[~2009-10-22 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-22 21:11 Ralf Angeli [this message]
2009-10-23 16:53 ` Custom themes and simple variables Chong Yidong
2009-10-23 17:05   ` Ralf Angeli
2009-10-23 17:35     ` Chong Yidong
2009-10-23 17:55       ` Ralf Angeli

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='hbsk24$ue6$1@ger.gmane.org' \
    --to=angeli@caeruleus.net \
    --cc=emacs-devel@gnu.org \
    /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.