unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Shynur Xie <one.last.kiss@outlook.com>
Cc: "65145@debbugs.gnu.org" <65145@debbugs.gnu.org>
Subject: bug#65145: ‘enable-theme’ completion for themes loaded by ‘require-theme’
Date: Wed, 9 Aug 2023 06:50:47 -0300	[thread overview]
Message-ID: <7a8aab36-f48b-d5f7-6f09-70abcc912e7b@gmail.com> (raw)
In-Reply-To: <PH0PR11MB7470C82004840D383E4D1246D712A@PH0PR11MB7470.namprd11.prod.outlook.com>

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.






  parent reply	other threads:[~2023-08-09  9:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 10:31 bug#65145: ‘enable-theme’ completion for themes loaded by ‘require-theme’ Shynur Xie
2023-08-08 23:09 ` Mauro Aranda
2023-08-09  7:23   ` Shynur Xie
2023-08-09  7:38     ` Shynur Xie
2023-08-09  9:50     ` Mauro Aranda [this message]
2023-08-09  9:59       ` Shynur Xie
2023-08-09 10:17         ` Mauro Aranda

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=7a8aab36-f48b-d5f7-6f09-70abcc912e7b@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=65145@debbugs.gnu.org \
    --cc=one.last.kiss@outlook.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).