diff options
Diffstat (limited to 'modules/ui-theme.el')
| -rw-r--r-- | modules/ui-theme.el | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/modules/ui-theme.el b/modules/ui-theme.el index a7873b9a5..499e71a49 100644 --- a/modules/ui-theme.el +++ b/modules/ui-theme.el @@ -37,13 +37,17 @@ ;; ------------------------------- Switch Themes ------------------------------- ;; loads themes in completing read, then persists via the functions below +(require 'system-lib) + (defun cj/switch-themes () "Function to switch themes and save chosen theme name for persistence. Unloads any other applied themes before applying the chosen theme." (interactive) (let ((chosentheme (completing-read "Load custom theme: " - (mapcar #'symbol-name - (custom-available-themes))))) + (cj/completion-table + 'theme + (mapcar #'symbol-name + (custom-available-themes)))))) (cj/theme-disable-all) (cj/theme-load-name chosentheme)) (cj/save-theme-to-file)) @@ -64,14 +68,13 @@ directory that is sync'd across machines with this configuration." :type 'file :group 'cj/ui-theme) -(defcustom fallback-theme-name "dupre" +(defcustom fallback-theme-name "modus-vivendi" "The name of the theme to fallback on. This is used when there's no file, or the theme name doesn't match any of the installed themes. It must be available wherever this config is -loaded, since the fallback has no further fallback. dupre is bundled in -themes/ and carries the dimming colors chosen for this config, so it is the -default; a built-in theme like modus-vivendi works too but has no chosen -dimming colors. If theme name is `nil', there will be no theme." +loaded, since the fallback has no further fallback. modus-vivendi ships with +Emacs, so it is present on every machine that loads this config, which makes +it the right default. If theme name is `nil', there will be no theme." :type 'string :group 'cj/ui-theme) @@ -140,12 +143,6 @@ Returns fallback-theme-name if no theme is active." (message "Cannot save theme: %s is unwriteable" theme-file) (message "%s theme saved to %s" (cj/get-active-theme-name) theme-file))) -(defun cj/load-fallback-theme (msg) - "Display MSG and load ui-theme fallback-theme-name. -Used to handle errors with loading persisted theme." - (cj/theme-disable-all) - (cj/theme-load-fallback msg)) - (defun cj/load-theme-from-file () "Apply the theme name contained in theme-file as the active UI theme. If the theme is nil, it disables all current themes. If an error occurs |
