emacs-diffs
[Top][All Lists]
Advanced

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

master 5e0935d9917: Fix term.el tests; refine previous change


From: Daniel Colascione
Subject: master 5e0935d9917: Fix term.el tests; refine previous change
Date: Fri, 4 Oct 2024 00:58:48 -0400 (EDT)

branch: master
commit 5e0935d9917fe768f74311c6cb4dc3a1e9014c52
Author: Daniel Colascione <dancol@dancol.org>
Commit: Daniel Colascione <dancol@dancol.org>

    Fix term.el tests; refine previous change
    
    Fix the term.el tests by making them match the new expected output.
    
    * test/lisp/term-tests.el: defvar - defconst
    (ansi-test-strings): remove unwanted text properties from
    expectations
    
    * lisp/term.el:
    (term--handle-colors-list): further shrink common-case face list
---
 lisp/term.el            |  3 ++-
 test/lisp/term-tests.el | 31 ++++++++++++-------------------
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/lisp/term.el b/lisp/term.el
index 7b9886e720a..c966afd5e80 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -3545,7 +3545,8 @@ color is unset in the terminal state."
     (setq term-current-face
           `(,@(when fg `(:foreground ,fg))
             ,@(when bg `(:background ,bg))
-            ,@(unless term-ansi-current-invisible
+            ,@(when (and term-ansi-current-reverse
+                         (not term-ansi-current-invisible))
                 (list :inverse-video term-ansi-current-reverse)))))
 
   (setq term-current-face
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index f5209d6f580..8df07ac66e1 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -28,25 +28,18 @@
 (defvar term-height)                    ; Number of lines in window.
 (defvar term-width)                     ; Number of columns in window.
 
-(defvar yellow-fg-props
-  `( :foreground ,(face-foreground 'term-color-yellow nil 'default)
-     :background "unspecified-bg" :inverse-video nil))
-(defvar yellow-bg-props
-  `( :foreground "unspecified-fg"
-     :background ,(face-background 'term-color-yellow nil 'default)
-     :inverse-video nil))
-(defvar bright-yellow-fg-props
-  `( :foreground ,(face-foreground 'term-color-bright-yellow nil 'default)
-     :background "unspecified-bg" :inverse-video nil))
-(defvar bright-yellow-bg-props
-  `( :foreground "unspecified-fg"
-     :background ,(face-background 'term-color-bright-yellow nil 'default)
-     :inverse-video nil))
-(defvar custom-color-fg-props
-  `( :foreground "#87FFFF"
-     :background "unspecified-bg" :inverse-video nil))
-
-(defvar ansi-test-strings
+(defconst yellow-fg-props
+  `(:foreground ,(face-foreground 'term-color-yellow nil 'default)))
+(defconst yellow-bg-props
+  `(:background ,(face-background 'term-color-yellow nil 'default)))
+(defconst bright-yellow-fg-props
+  `(:foreground ,(face-foreground 'term-color-bright-yellow nil 'default)))
+(defconst bright-yellow-bg-props
+  `(:background ,(face-background 'term-color-bright-yellow nil 'default)))
+(defconst custom-color-fg-props
+  `(:foreground "#87FFFF"))
+
+(defconst ansi-test-strings
   `(("\e[33mHello World\e[0m"
      ,(propertize "Hello World" 'font-lock-face `(,yellow-fg-props)))
     ("\e[43mHello World\e[0m"



reply via email to

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