emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/alect-themes 4c25d22 160/269: Update README for Emacs 24.4


From: ELPA Syncer
Subject: [nongnu] elpa/alect-themes 4c25d22 160/269: Update README for Emacs 24.4
Date: Thu, 21 Oct 2021 17:59:10 -0400 (EDT)

branch: elpa/alect-themes
commit 4c25d223bc52c6e4ef5591a5c14411dc3fe4bce1
Author: Alex Kost <alezost@gmail.com>
Commit: Alex Kost <alezost@gmail.com>

    Update README for Emacs 24.4
---
 README.md | 45 +++++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/README.md b/README.md
index 366ee9d..607333b 100644
--- a/README.md
+++ b/README.md
@@ -247,30 +247,31 @@ instead of the themed colored buttons (the right picture):
 <img src="http://i.imgur.com/66G9VvX.png"; title="alect-light - Custom-mode 
(proper colors)"/></a>
 
 This happens because Emacs applies default face settings even for a
-themed face.  This behaviour is changed in new versions of Emacs: since
-24.4 (not released yet) you will always get pure themes without
-unintended face settings.  If you use a previous version of Emacs, you
-can try the following workaround to achieve the new behaviour:
+themed face.  This behaviour is changed in the new versions of Emacs:
+since 24.4 you will always get pure themes without unintended face
+settings.  If you use a previous version, you can try the following
+workaround to achieve the new behaviour:
 
 ```elisp
-(defun face-spec-recalc-new (face frame)
-  "Improved version of `face-spec-recalc'."
-  (while (get face 'face-alias)
-    (setq face (get face 'face-alias)))
-  (face-spec-reset-face face frame)
-  ;; If FACE is customized or themed, set the custom spec from
-  ;; `theme-face' records, which completely replace the defface spec
-  ;; rather than inheriting from it.
-  (let ((theme-faces (get face 'theme-face)))
-    (if theme-faces
-       (dolist (spec (reverse theme-faces))
-         (face-spec-set-2 face frame (cadr spec)))
-      (face-spec-set-2 face frame (face-default-spec face))))
-  (face-spec-set-2 face frame (get face 'face-override-spec)))
-
-(defadvice face-spec-recalc (around new-recalc (face frame) activate)
-  "Use `face-spec-recalc-new' instead."
-  (face-spec-recalc-new face frame))
+(when (version< emacs-version "24.3.50")
+  (defun face-spec-recalc-new (face frame)
+    "Improved version of `face-spec-recalc'."
+    (while (get face 'face-alias)
+      (setq face (get face 'face-alias)))
+    (face-spec-reset-face face frame)
+    ;; If FACE is customized or themed, set the custom spec from
+    ;; `theme-face' records, which completely replace the defface spec
+    ;; rather than inheriting from it.
+    (let ((theme-faces (get face 'theme-face)))
+      (if theme-faces
+          (dolist (spec (reverse theme-faces))
+            (face-spec-set-2 face frame (cadr spec)))
+        (face-spec-set-2 face frame (face-default-spec face))))
+    (face-spec-set-2 face frame (get face 'face-override-spec)))
+
+  (defadvice face-spec-recalc (around new-recalc (face frame) activate)
+    "Use `face-spec-recalc-new' instead."
+    (face-spec-recalc-new face frame)))
 ```
 
 That version of `face-spec-recalc` (wrapped with advice) is one of the



reply via email to

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