]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix term.el tests; refine previous change
authorDaniel Colascione <dancol@dancol.org>
Fri, 4 Oct 2024 04:56:37 +0000 (00:56 -0400)
committerEshel Yaron <me@eshelyaron.com>
Fri, 4 Oct 2024 10:12:40 +0000 (12:12 +0200)
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

(cherry picked from commit 5e0935d9917fe768f74311c6cb4dc3a1e9014c52)

lisp/term.el
test/lisp/term-tests.el

index b4e159d09fc54a6463f88163c40549c44687b863..9a88fc95b6119d967be0a5b52a9aa5b33341ecb8 100644 (file)
@@ -3541,7 +3541,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
index f5209d6f5802114cc66d939453de3910b23eb922..8df07ac66e1639e9c3a0ad4d4d480b61102ddbc3 100644 (file)
 (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"