unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Reloading themes in user option setters
@ 2021-06-25 19:12 Philip Kaludercic
  0 siblings, 0 replies; only message in thread
From: Philip Kaludercic @ 2021-06-25 19:12 UTC (permalink / raw)
  To: emacs-devel; +Cc: info


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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-25 19:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 19:12 Reloading themes in user option setters Philip Kaludercic

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).