bug#47424: 28.0.50; enable-theme shows an empty list

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#47424: 28.0.50; enable-theme shows an empty list

Stefan Monnier
Package: Emacs
Version: 28.0.50


If I do

    emacs -Q
    M-x enable-theme RET TAB

I'd expect to see a list of available themes including at least thoese
in `etc/themes`, but that list is empty ;-(


        Stefan



In GNU Emacs 28.0.50 (build 1, i686-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-03-16 built on alfajor
Repository revision: e325e51217a5504dd61656eeaf1b7d62ecdc0248
Repository branch: work
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure -C --enable-checking --enable-check-lisp-object-type --with-modules --with-cairo --with-tiff=ifavailable
 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign'
 PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG
RSVG SOUND THREADS TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: fr_CH.UTF-8
  locale-coding-system: utf-8-unix

Major mode: InactiveMinibuffer

Minor modes in effect:
  shell-dirtrack-mode: t
  electric-pair-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  global-compact-docstrings-mode: t
  url-handler-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t

Load-path shadows:
/home/monnier/src/emacs/elpa/packages/ivy-hydra/ivy-hydra hides /home/monnier/src/emacs/elpa/packages/ivy/ivy-hydra
/home/monnier/src/emacs/elpa/packages/hyperbole/set hides /home/monnier/src/emacs/work/lisp/emacs-lisp/set
/home/monnier/src/emacs/elpa/packages/landmark/landmark hides /home/monnier/src/emacs/work/lisp/obsolete/landmark
/home/monnier/src/emacs/elpa/packages/crisp/crisp hides /home/monnier/src/emacs/work/lisp/obsolete/crisp

Features:
(rfc2104 smtpmail shadow sort mail-extr emacsbug adaptive-wrap
mm-archive url-dav cus-edit cus-start cus-load url-http-ntlm ntlm
hmac-md5 hex-util md4 gnutls network-stream url-http url-gw nsm
shr-color color html5-schema rng-xsd xsd-regexp rng-cmpct rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap sgml-mode nxml-util
nxml-enc xmltok sh-script make-mode tramp tramp-loaddefs trampver
tramp-integration tramp-compat ls-lisp gited-tests gited gited-ci ert
hideshow sml-mode package-x two-column typer-mode url-file url-dired
url-cache quail texinfo tex-mode mode-local bbdb-com crm bbdb bbdb-site
timezone tuareg tuareg-opam caml-types caml-help caml-emacs find-file
completion sendmail nroff-mode cperl-mode rx facemenu perl-mode epa-file
tuareg-jbuild-mode scheme edebug emms-source-file locate emms
emms-compat loadhist prefixed-core debug backtrace dabbrev grep ielm pp
autorevert filenotify files-x vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-svn
vc-cvs vc-rcs vc-dir ewoc pcase log-view ffap autoload cl-print enriched
shell dired-aux dired-x shortdoc help-fns radix-tree view cal-china
lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs
cal-french diary-lib diary-loaddefs mule-util cal-move org-element
avl-tree generator ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe
ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt speedbar imenu
ezimage dframe gnus-art mm-uu mml2015 mm-view mml-smime smime dig
gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus
dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time
gnus-spec gnus-int gnus-range gnus-win gnus nnheader wid-edit ol-docview
doc-view jka-compr image-mode exif ol-bibtex bibtex iso8601 ol-bbdb
ol-w3m org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete pcomplete org-list
org-faces org-entities org-version ob-emacs-lisp ob-core ob-eval
org-table ol org-keys org-compat advice org-macs org-loaddefs
format-spec find-func cal-menu calendar cal-loaddefs whitespace
sm-c-mode smie rect bug-reference log-edit message rmc puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config gnus-util
rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log misearch multi-isearch cl-extra
executable copyright smerge-mode diff vc vc-git diff-mode vc-dispatcher
filecache server time-date flymake-proc flymake compile
text-property-search comint ansi-color ring warnings noutline outline
easy-mmode flyspell ispell checkdoc lisp-mnt thingatpt help-mode edmacro
kmacro load-dir elec-pair reveal autoinsert savehist minibuf-eldef
disp-table compact-docstrings proof-site proof-autoloads cl-seq
gnu-elpa-features kotl-autoloads finder-inf url-auth info sly-autoloads
package browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source eieio eieio-core cl-macs gv eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame epa-hook jka-cmpr-hook simple minibuffer
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite
charscript charprop case-table help abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 8 2117642 359421)
 (symbols 24 58178 92) (strings 16 237236 31333) (string-bytes 1 8204470)
 (vectors 8 207462)
 (vector-slots 4 3873938 567298) (floats 8 1566 415)
 (intervals 28 319267 613)
 (buffers 564 655))




Reply | Threaded
Open this post in threaded view
|

bug#47424: 28.0.50; enable-theme shows an empty list

Emacs - Bugs mailing list
Stefan Monnier <[hidden email]> writes:

>
>
> If I do
>
>     emacs -Q
>     M-x enable-theme RET TAB
>
> I'd expect to see a list of available themes including at least thoese
> in `etc/themes`, but that list is empty ;-(
>

According to the documentation, `enable-theme' enables variable and face
settings of already loaded themes, so I think it makes sense that it
doesn't offer completions in emacs -Q, because there is no loaded theme
yet.

Perhaps you wanted to do M-x load-theme, which should properly complete
with themes from etc/themes, among other directories?



Reply | Threaded
Open this post in threaded view
|

bug#47424: 28.0.50; enable-theme shows an empty list

Stefan Monnier
> According to the documentation, `enable-theme' enables variable and face
> settings of already loaded themes, so I think it makes sense that it
> doesn't offer completions in emacs -Q, because there is no loaded theme
> yet.
>
> Perhaps you wanted to do M-x load-theme, which should properly complete
> with themes from etc/themes, among other directories?

I know it works as documented, but I don't think it's the behavior we
really want.  We should autoload themes, just like we autoload pretty
much everything else.


        Stefan




Reply | Threaded
Open this post in threaded view
|

bug#47424: 28.0.50; enable-theme shows an empty list

Stefan Monnier
>> According to the documentation, `enable-theme' enables variable and face
>> settings of already loaded themes, so I think it makes sense that it
>> doesn't offer completions in emacs -Q, because there is no loaded theme
>> yet.
>>
>> Perhaps you wanted to do M-x load-theme, which should properly complete
>> with themes from etc/themes, among other directories?
>
> I know it works as documented, but I don't think it's the behavior we
> really want.  We should autoload themes, just like we autoload pretty
> much everything else.

BTW, we already do some of that for themes in other cases.
E.g. `M-x customize-themes` is perfectly able to list the available
themes without having to load them beforehand, and so is
`M-x custom-theme-visit-theme` which will additionally autoload the
theme you choose to customize if needed.


        Stefan




Reply | Threaded
Open this post in threaded view
|

bug#47424: 28.0.50; enable-theme shows an empty list

Eli Zaretskii
In reply to this post by Stefan Monnier
severity 47424 wishlist
thanks

> From: Stefan Monnier <[hidden email]>
> Date: Fri, 26 Mar 2021 21:57:31 -0400
> Cc: [hidden email]
>
> > Perhaps you wanted to do M-x load-theme, which should properly complete
> > with themes from etc/themes, among other directories?
>
> I know it works as documented, but I don't think it's the behavior we
> really want.  We should autoload themes, just like we autoload pretty
> much everything else.

So you are asking for a new feature: autoload themes.

However, while autoloading commands, functions, and variables happens
when they are first used, what would be the trigger(s) for autoloading
themes?  If it's just enable-theme, I'm not sure autoloading themes is
justified.



Reply | Threaded
Open this post in threaded view
|

bug#47424: 28.0.50; enable-theme shows an empty list

Stefan Kangas
In reply to this post by Stefan Monnier
Stefan Monnier <[hidden email]> writes:

>> According to the documentation, `enable-theme' enables variable and face
>> settings of already loaded themes, so I think it makes sense that it
>> doesn't offer completions in emacs -Q, because there is no loaded theme
>> yet.
>>
>> Perhaps you wanted to do M-x load-theme, which should properly complete
>> with themes from etc/themes, among other directories?
>
> I know it works as documented, but I don't think it's the behavior we
> really want.  We should autoload themes, just like we autoload pretty
> much everything else.

I'm not exactly sure why we bother differentiating between loading a
theme and enabling it.  Technically, I understand that there is a
difference.  But why should a user have to fiddle around with it?

I have themes in the Emacs distribution or installed from some ELPA
repository.  I am now interested in exactly one thing: enable this
installed theme.  Or don't.  Load as necessary.  As a user, I am almost
completely indifferent to what symbols are defined in my Emacs session.

IOW, I'd be in favour of removing one of `enable-theme' or `load-theme'
and ensure we always DTRT and DWIM (which includes autoloading when
necessary).

(If someone needs a way to reload themes (besides `load-file', I
suppose), we could have a new function `theme-reload'.)



Reply | Threaded
Open this post in threaded view
|

bug#47424: 28.0.50; enable-theme shows an empty list

Eli Zaretskii
> From: Stefan Kangas <[hidden email]>
> Date: Sat, 3 Apr 2021 19:14:29 -0500
> Cc: [hidden email], Daniel Martín <[hidden email]>
>
> I'm not exactly sure why we bother differentiating between loading a
> theme and enabling it.  Technically, I understand that there is a
> difference.  But why should a user have to fiddle around with it?

For the same reason that loading a Lisp package shouldn't change the
Emacs state, until the user explicitly activates the features in the
package.  It's unclean to have loading activate stuff, and we've
invested an effort during the last years to remove that uncleanliness.

With themes, you can load several ones and then enable/disable any of
them whenever you see fit.  Under your proposal, disabling a theme
would be impossible without unloading it, and that might not be easy
to do cleanly.



Reply | Threaded
Open this post in threaded view
|

bug#47424: 28.0.50; enable-theme shows an empty list

Eli Zaretskii
> From: Stefan Kangas <[hidden email]>
> Date: Sun, 4 Apr 2021 04:05:43 -0500
> Cc: [hidden email], [hidden email], [hidden email]
>
> > With themes, you can load several ones and then enable/disable any of
> > them whenever you see fit.
>
> I don't see why a user would want/need to load a theme if she does not
> intend to use it.

The user does intend to use these themes, just not right away and not
all of them.  It's a valid use case to want to switch to another
theme, e.g. because someone wants one theme in the morning and another
in the evening.

> What am I missing?

I don't think you are missing anything, you just disregard everything
I say in response and keep repeating the same claims and questions.
That's not a useful discussion method.  I'm tempted to stop responding
because it just wastes my time.  Sorry for being blunt.

> > Under your proposal, disabling a theme would be impossible without
> > unloading it, and that might not be easy to do cleanly.
>
> I'm not sure I follow; I see no need to make it symmetrical in that
> sense.

So loading the theme will enable it, but disabling will not unload it?
Then how to I re-enable a theme that was disabled? by loading it the
second time?

> In the same way, we don't bother unloading a library just because
> the major-mode involved is not used in any buffer.  But we do
> provide a way to autoload major modes.

Themes are not like modes, they are in effect in the entire Emacs
session, in all of the buffers.  You cannot evade a theme by going to
another buffer like you do with modes.



Reply | Threaded
Open this post in threaded view
|

bug#47424: 28.0.50; enable-theme shows an empty list

Stefan Kangas
Eli Zaretskii <[hidden email]> writes:

> So loading the theme will enable it, but disabling will not unload it?
> Then how to I re-enable a theme that was disabled? by loading it the
> second time?

I suggest we take a step back from these details:

I'm saying that the user should not need to worry about whether or not
the theme is loaded.

To put this more concretely, I'd like to see two functions (and let's
disregard what we have now for the sake of argument):

    enable-theme
    disable-theme

Whatever happens technically (loading, autoloading, unloading, etc.) is
not interesting to the user.  What is interesting is that after you run
one of the above commands the specified theme is either enabled or
disabled.