bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Mauro Aranda
Subject: bug#65145: ‘enable-theme’ completion for themes loaded by ‘require-theme’
Date: Wed, 9 Aug 2023 06:50:47 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

Shynur Xie <one.last.kiss@outlook.com> writes:

>> I can't reproduce it.  I did:
>> emacs -Q
>> (require-theme 'leuven-theme)
>> M-x enable-theme
>
> Oh Oh, sorry, Mauro.  I forgot to say that, this occurs only when
> using a third-party theme, e.g., you create a file named ‘X-theme.el’,
> which is under ‘/tmp/’ and contains the following code:
>
>     (deftheme X)
>     (provide 'X-theme)
>
> Then evaluate
>
>     (let ((custom-theme-load-path '("/tmp/")))
>       (require-theme 'X-theme))
>
> Then call ‘enable-theme’ interactively.

Thanks, I see it now.  Note that if you change the X-theme.el file to
something like this:

(deftheme X)

(let ((class '((class color) (min-colors 89))))
  (custom-theme-set-faces
   'X
   `(default ((,class (:background "#222222" :foreground "#f6f6f6"))))))

(provide-theme 'X)

Then there's completion for "X".  The reason is that, for completion,
Custom looks for a non-nil theme-settings property.  Your empty theme
recipe doesn't have settings, so theme-settings is nil, while if you
change it to a non-empty theme, theme-settings will be non-nil.

I don't really see a need to change the code here.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]