unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: Per Abrahamsen <abraham@dina.kvl.dk>, emacs-devel@gnu.org
Subject: Re: More bugs in Custom themes
Date: Tue, 5 Jul 2005 22:32:47 -0500 (CDT)	[thread overview]
Message-ID: <200507060332.j663WlA21625@raven.dms.auburn.edu> (raw)
In-Reply-To: <E1Dpf9e-0004mg-A9@fencepost.gnu.org> (rms@gnu.org)

   but I think we already discussed the proper conflict resolution
   method.  What I suggested was that the themes are listed in an order,
   and later themes override earlier themes.

It is a little bit more complex than that.  The user can enable or
disable themes, save options through Custom, set them through Custom,
reset them to standard through Custom and change them using setq.  In
each possible situation, you need to decide how to determine the
actual value, saved-value, theme-value (or theme-face), backup-value
and customized-value.  Maybe the answers are obvious in each case, but
each combination of cases has to be thought about.

I believe that mainly the actual value (the case we have been worrying
about) is not completely trivial.  However, I also have my doubts
about the way the current code handles `saved-value'.  Related to the
latter problem is yet another design decision to be made.  When the
option has been set by a theme, the current code says that it has been
"Saved and set".  I believe that this is unhelpful and confusing and
that it should say instead that it has been set by a theme, preferably
saying which theme.  This probably requires handling saved-value
differently.

   Disabling any of the themes works by getting rid of all of them,
   then reloading the ones that remain enabled.

To me, that seems to be a contorted way to do it.  Also, do not forget
that when the user asks to disable a theme, the value you want to
restore will sometimes be a setq-ed value, thus not associated with any
theme, and that you also have to make sure that your method gets all
stored info right, not just the actual value.

   You've already got the function which turns them all off.

You mean `custom-do-theme-reset'?  That is the very last function I
would want to use, rely on or emulate if I were you.  It indeed turns
them _all_ off, but then _pretends_ that it only turned one off by
just removing one from theme-value (or theme-face).  Looks like a
badly messed up function to me, but since I have no idea what that
code is trying to _accomplish_ (although I know perfectly what it
_does_), I may be wrong.

   If you think it would be hard to write this, could you tell me which
   functions deal with this part of things?  Then I will try.

`custom-do-theme-reset' I am afraid.  Again, I would not take a lot of
my inspiration from that one if I were you.

I believe that a function to properly disable a theme has to be
written from scratch.  But you will probably have to rewrite plenty of
other stuff before you can begin to rewrite that one.

Of course, the function to enable themes will also have to be
rewritten to use unconditional loading instead of requiring, but that
is probably easier.

It is actually my impression that most of the code needs to be
rewritten.  Maybe some stuff can be recycled in one form or another
into the new design.

Sincerely,

Luc.

  parent reply	other threads:[~2005-07-06  3:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-30  1:52 More bugs in Custom themes Luc Teirlinck
2005-06-30 21:30 ` Richard M. Stallman
2005-07-01  1:04   ` Luc Teirlinck
2005-07-02 12:33     ` Richard M. Stallman
2005-07-02 13:46       ` David Kastrup
2005-07-03  1:55       ` Luc Teirlinck
2005-07-04  6:16         ` Richard M. Stallman
2005-07-03  2:15       ` Luc Teirlinck
2005-07-05  4:35         ` Richard M. Stallman
2005-07-06  2:39           ` Luc Teirlinck
2005-07-06  3:32           ` Luc Teirlinck [this message]
2005-07-11  5:34             ` Richard M. Stallman
2005-07-11  5:35             ` Richard M. Stallman
2005-07-25  1:04               ` Luc Teirlinck
2005-07-25 11:53                 ` Per Abrahamsen
2005-07-25 13:10                 ` Richard M. Stallman

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=200507060332.j663WlA21625@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=abraham@dina.kvl.dk \
    --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 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).