Skip to content

Commit

Permalink
In theme selector, skip annotations for themes not yet loaded.
Browse files Browse the repository at this point in the history
This closes #22 on github.
  • Loading branch information
league authored and protesilaos committed Jun 8, 2023
1 parent 35b955f commit 1df7134
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ef-themes.el
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,9 @@ overrides."

(defun ef-themes--annotate-theme (theme)
"Return completion annotation for THEME."
(format " -- %s" (car (split-string (get (intern theme) 'theme-documentation) "\\."))))
(let ((doc (get (intern theme) 'theme-documentation)))
(when doc ;; A completion annotation function may return nil
(concat " -- " (car (split-string doc "\\."))))))

(defvar ef-themes--select-theme-history nil
"Minibuffer history of `ef-themes--select-prompt'.")
Expand Down Expand Up @@ -652,13 +654,13 @@ Run `ef-themes-post-load-hook' after loading the theme.
Also see `ef-themes-select-light'.
This command is the same as `ef-themes-select' except it only
prompts for light themes when called interactively. Calling it
prompts for dark themes when called interactively. Calling it
from Lisp behaves the same as `ef-themes-select' for the THEME
argument, meaning that it loads the Ef THEME regardless of
whether it is light or dark."
(interactive
(list
(ef-themes--select-prompt "Select light Ef theme: " 'dark)))
(ef-themes--select-prompt "Select dark Ef theme: " 'dark)))
(ef-themes--load-theme theme))

(defun ef-themes--toggle-theme-p ()
Expand Down

0 comments on commit 1df7134

Please sign in to comment.