unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: `changed' theme.
Date: Sat, 13 May 2006 21:46:44 -0500 (CDT)	[thread overview]
Message-ID: <200605140246.k4E2ki2d007475@jane.dms.auburn.edu> (raw)

I know we discussed this before, but now things just seem too obvious.

This `changed' theme makes no sense and it makes Custom unnecessarily
complex.  Even after Chong's latest change it still causes bugs, which
I will report shortly.  But the bugs are just one illustration of why
it makes no sense.

The basic problem is the following.  Somebody sets an option outside
Custom, or uses add-hook, in .emacs or during a session.  Then he
loads a theme.  Or some Emacs feature, say a minor mode, sets an
option or adds a function to a hook because it _needs_ to do so for
correct functioning and then the user loads a theme that wants to set
the option or hook.  What should happen?

If the user deliberately sat an option _through Custom_ and then loads
a Theme containing tons of options, then the Theme does not override
the explicit user customization.  An explicit user setq or other
non_Custom customization should not be overridden for exactly the same
reasons.  If an Emacs feature sat the value because it needed that
value, the Theme should not override it and make the explicitly user
enabled feature malfunction.

The problem would be especially bad when users or Emacs features add
functions to hooks or elements to listvars, which is perfectly
legitimate for them to do.  When the user then loads a theme, that
theme could completely replace the value of the hook or listvar,
thereby making Emacs features, or maybe even all of Emacs,
malfunction, for instance by removing essential functions from hooks.

Actually, themes should, in the current situation, _never_ try to set
hooks, or listvars that have to be customized with add-to-list rather
than setq.  But they might easily try it anyway.  I see no mention in
the documentation that they should not do it.  Preventing themes from
overriding any user or program customizations (whether or not done
through Custom) could at least prevent most of the worst problems
(even though not all problems).

_If_ Themes are going to override user/program "rogue" customizations,
then at least they should not try to restore the old rogue value when
the Theme gets unloaded.  This can not be implemented in any remotely
reliable way, because too much could have happened in the meantime.
They should restore the "old" value as determined by Custom.  The
current implementation has bugs, that I will report separately.

Sincerely,

Luc.

             reply	other threads:[~2006-05-14  2:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-14  2:46 Luc Teirlinck [this message]
2006-05-14  3:53 ` `changed' theme Chong Yidong
2006-05-14  4:58   ` Luc Teirlinck
2006-05-14 19:32     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200605140246.k4E2ki2d007475@jane.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /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 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).