Subject: bug#65145: ‘enable-theme’ completion for themes loaded by ‘require-theme’

From: Mauro Aranda <[email-masked]>
Date: Tue, 8 Aug 2023 20:09:29 -0300

Shynur Xie <[email-masked]> writes:

 > Hi, friends.  I find that if we use
 >
 >     (require-theme 'X-theme)
 >
 > to load ‘X-theme’, minibuffer doesn’t provide the completion for
 > ‘X-theme’ when calling ‘enable-theme’ interactively.  But the
 > following code
 >
 >     (require-theme 'X-theme)
 >     (enable-theme 'X)
 >
 > works fine.

I can't reproduce it.  I did:
emacs -Q
(require-theme 'leuven-theme)
M-x enable-theme
TAB

And "leuven" was inserted at the minibuffer.

I tried on Emacs 28, Emacs 29 and master.

 > Is it an intended behavior that ‘enable-theme’ doesn’t provide
 > completion for those themes loaded by ‘require-theme’?
 > If so, please ignore this report and excuse my intrusion. If not, can
 > we fix it?

It should offer the completion, and at least it does for me. What were
the steps that you followed? And on which Emacs version?