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

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

[elpa] externals/assess 38fc7829bc 42/95: Interpret nil to mean no faces


From: ELPA Syncer
Subject: [elpa] externals/assess 38fc7829bc 42/95: Interpret nil to mean no faces.
Date: Tue, 19 Jul 2022 15:57:32 -0400 (EDT)

branch: externals/assess
commit 38fc7829bc3e3e36efa82931922adaa976d080c1
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>

    Interpret nil to mean no faces.
    
    When assessing faces at a point, nil for was being interpreted as an
    empty list of faces, so was always true. Now, we interpret nil to mean
    exactly no faces.
    
    Closes #4
---
 assess.el           |  4 +++-
 test/assess-test.el | 10 ++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/assess.el b/assess.el
index 42b0769e46..5695066ca3 100644
--- a/assess.el
+++ b/assess.el
@@ -957,7 +957,9 @@ the copy of FILE will be in a different directory."
             locations)))
           ;; make sure we have a list of faces
           (faces
-           (if (listp faces)
+           (if (and (listp faces)
+                    ;; but not nil
+                    (not (eq nil faces)))
                faces
              (list faces)))
           ;; make sure faces is as long as locations
diff --git a/test/assess-test.el b/test/assess-test.el
index dd59bcc2a5..11defd1b2d 100644
--- a/test/assess-test.el
+++ b/test/assess-test.el
@@ -464,6 +464,12 @@ This also tests the advice on string=."
   (should
    (get 'assess-discover-test-has-this-been-defined 'ert--test)))
 
-
-
+;; https://github.com/phillord/assess/issues/4
+(ert-deftest issue-4-has-type-face ()
+  "Test that no faces are present at point."
+  (should-not
+   (assess-face-at= "foo bar" 'fundamental-mode
+                    "bar" 'font-lock-type-face))
+  (should-not
+   (assess-face-at= "def" 'python-mode "def" nil)))
 ;; #+end_src



reply via email to

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