1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

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
This commit is contained in:
Daniel Colascione 2024-10-04 00:56:37 -04:00
parent d9e76c87a1
commit 5e0935d991
2 changed files with 13 additions and 19 deletions

View File

@ -3545,7 +3545,8 @@ color is unset in the terminal state."
(setq term-current-face (setq term-current-face
`(,@(when fg `(:foreground ,fg)) `(,@(when fg `(:foreground ,fg))
,@(when bg `(:background ,bg)) ,@(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))))) (list :inverse-video term-ansi-current-reverse)))))
(setq term-current-face (setq term-current-face

View File

@ -28,25 +28,18 @@
(defvar term-height) ; Number of lines in window. (defvar term-height) ; Number of lines in window.
(defvar term-width) ; Number of columns in window. (defvar term-width) ; Number of columns in window.
(defvar yellow-fg-props (defconst yellow-fg-props
`( :foreground ,(face-foreground 'term-color-yellow nil 'default) `(:foreground ,(face-foreground 'term-color-yellow nil 'default)))
:background "unspecified-bg" :inverse-video nil)) (defconst yellow-bg-props
(defvar yellow-bg-props `(:background ,(face-background 'term-color-yellow nil 'default)))
`( :foreground "unspecified-fg" (defconst bright-yellow-fg-props
:background ,(face-background 'term-color-yellow nil 'default) `(:foreground ,(face-foreground 'term-color-bright-yellow nil 'default)))
:inverse-video nil)) (defconst bright-yellow-bg-props
(defvar bright-yellow-fg-props `(:background ,(face-background 'term-color-bright-yellow nil 'default)))
`( :foreground ,(face-foreground 'term-color-bright-yellow nil 'default) (defconst custom-color-fg-props
:background "unspecified-bg" :inverse-video nil)) `(:foreground "#87FFFF"))
(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 ansi-test-strings
`(("\e[33mHello World\e[0m" `(("\e[33mHello World\e[0m"
,(propertize "Hello World" 'font-lock-face `(,yellow-fg-props))) ,(propertize "Hello World" 'font-lock-face `(,yellow-fg-props)))
("\e[43mHello World\e[0m" ("\e[43mHello World\e[0m"