unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: emacs-devel@gnu.org
Cc: info@protesilaos.com
Subject: Reloading themes in user option setters
Date: Fri, 25 Jun 2021 19:12:03 +0000	[thread overview]
Message-ID: <87eecpep30.fsf@posteo.net> (raw)


Hi,

in a recent discussion on the modus-themes issue tracker[0], the concept
of reloading a user theme in the :set function of a user option was
debated. The plan is to add this to the next version, that might or
might not be part of the next Emacs release.

For those who don't know, modus-themes provides a number of user options
to change details, e.g. the usage of variable-pitch outside of buffers
(modus-themes-variable-pitch-UI).

About a month ago I wanted to make it easier to explore the space for
customization, by adding a custom setter to all applicable options, that
reload the current modus-theme, when the value is changed[1].  The idea
was to resemble the way that Emacs immediately changes faces when the
user changes something. The feature worked and it was merged.

In the aforementioned thread[0], we noticed that this can result in a
significant increase of the time needed to load the theme. It turns out
that the combination of customizing user options by adding them to the
"user" theme and using load-theme results in the theme being reloaded
for every user option.

One way to avoid this is to in the setter check if `custom--inhibit-theme-enable' is
set to nil[2], before reloading the themes. This works,
because enable-theme sets the value to nil. The issue here is that
custom--inhibit-theme-enable is designated to be an internal variable,
so we were not sure whether or not this is a good solution, considering
that this change might eventually be added to the core.

For that reason we would be interested in hearing opinions from the
readers of this list on the proposed solution or on the feature
itself. I am uncertain if the behaviour should or should not be
considered a bug, but even if that were to be the case, modus-themes
cannot rely on a bug fix in the next version because it still targets
older versions.

[0] https://gitlab.com/protesilaos/modus-themes/-/issues/213
[1] https://gitlab.com/protesilaos/modus-themes/-/merge_requests/38
[2] https://gitlab.com/protesilaos/modus-themes/-/issues/213#note_606022214

-- 
	Philip K.



                 reply	other threads:[~2021-06-25 19:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87eecpep30.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=info@protesilaos.com \
    /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).