branch: externals/modus-themes
commit 264814f51e991fc39620da1c4a8761343177e459
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Make modus-themes-get-theme-palette append symbol values and accept 
overrides only
---
 modus-themes.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/modus-themes.el b/modus-themes.el
index eb9add6556..933487d111 100644
--- a/modus-themes.el
+++ b/modus-themes.el
@@ -1009,17 +1009,21 @@ must define theme properties to include those that the 
macro specifies.")
   "Return first enabled Modus theme."
   (car (modus-themes--list-enabled-themes)))
 
-(defun modus-themes-get-theme-palette (&optional theme)
+(defun modus-themes-get-theme-palette (&optional theme overrides-only)
   "Return palette value of active `modus-themes-registered-items' THEME.
-If THEME is nil, use the return value of `modus-themes-get-current-theme'."
+If THEME is nil, use the return value of `modus-themes-get-current-theme'.
+
+If OVERRIDES-ONLY is non-nil, return just the overrides."
   (let ((theme (or theme (modus-themes-get-current-theme))))
     (unless (memq theme modus-themes-registered-items)
       (error "The theme `%s' is not among `modus-themes-registered-items'" 
theme))
     (if-let* ((properties (get theme 'theme-properties))
-              (core-palette (plist-get properties :modus-core-palette)))
-        (let ((user-palette (plist-get properties :modus-user-palette))
-              (overrides-palette (plist-get properties 
:modus-overrides-palette)))
-          (append overrides-palette user-palette core-palette))
+              (core-palette (symbol-value (plist-get properties 
:modus-core-palette))))
+        (let ((user-palette (symbol-value (plist-get properties 
:modus-user-palette)))
+              (overrides-palette (symbol-value (plist-get properties 
:modus-overrides-palette))))
+          (if overrides-only
+              overrides-palette
+            (append overrides-palette user-palette core-palette)))
       (error "The theme must have at least a `:modus-core-palette' 
property"))))
 
 (defun modus-themes--disable-themes ()

Reply via email to