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

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

[elpa] externals/spacious-padding e8ca6cf619: Guard against invalid face


From: ELPA Syncer
Subject: [elpa] externals/spacious-padding e8ca6cf619: Guard against invalid face when trying to get its attributes
Date: Sat, 25 Nov 2023 03:58:49 -0500 (EST)

branch: externals/spacious-padding
commit e8ca6cf6194ef831fefb7fd0280c849cbbaa54bc
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Guard against invalid face when trying to get its attributes
    
    This to address the issue mentioned by orie regarding the absence of
    'mode-line-active' on Emacs 28:
    
<https://lists.sr.ht/~protesilaos/general-issues/%3C87zfz3nju7.fsf%40foobar%3E>.
---
 spacious-padding.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/spacious-padding.el b/spacious-padding.el
index a5c88621b9..fe2ff0d68a 100644
--- a/spacious-padding.el
+++ b/spacious-padding.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Protesilaos Stavrou General Issues 
<~protesilaos/general-issues@lists.sr.ht>
 ;; URL: https://git.sr.ht/~protesilaos/spacious-padding
 ;; Mailing-List: https://lists.sr.ht/~protesilaos/general-issues
-;; Version: 0.2.0
+;; Version: 0.2.1
 ;; Package-Requires: ((emacs "28.1"))
 ;; Keywords: convenience, focus, writing, presentation
 
@@ -115,15 +115,16 @@ Return 4 if KEY does not have a value."
     (spacious-padding--get-box-width :header-line-width))
    ((memq face spacious-padding--tab-faces)
     (spacious-padding--get-box-width :tab-width))
-   (t (error "`%s' is not relevant to `spacious-padding-mode'" face))))
+   (t (error "`%s' is not relevant to `spacious-padding-mode'" face)))))
 
 (defun spacious-padding-set-face-box-padding (face fallback)
   "Return appropriate face attributes for FACE with FALLBACK face background."
-  (list :box
-        (list
-         :line-width (spacious-padding--get-face-width face)
-         :color (face-background face nil fallback)
-         :style nil)))
+  (when (facep face)
+    (list :box
+          (list
+           :line-width (spacious-padding--get-face-width face)
+           :color (face-background face nil fallback)
+           :style nil)))
 
 (defun spacious-padding-set-invisible-dividers (_theme)
   "Make window dividers for THEME invisible."



reply via email to

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