1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Tweak tty-find-type to allow TERM=screen.xterm

* lisp/faces.el (tty-find-type): Allow TERM=screen.xterm to find
term/screen.el (bug#45824).
This commit is contained in:
Lars Ingebrigtsen 2021-01-20 17:25:40 +01:00
parent f30cf07ecb
commit cad2c4b14a
2 changed files with 9 additions and 1 deletions

View file

@ -2199,7 +2199,7 @@ the above example."
(not (funcall pred type)))
;; Strip off last hyphen and what follows, then try again
(setq type
(if (setq hyphend (string-match-p "[-_][^-_]+$" type))
(if (setq hyphend (string-match-p "[-_.][^-_.]+$" type))
(substring type 0 hyphend)
nil))))
type)

View file

@ -217,5 +217,13 @@
))
)
(ert-deftest test-tty-find-type ()
(let ((pred (lambda (string)
(locate-library (concat "term/" string ".el")))))
(should (tty-find-type pred "cygwin"))
(should (tty-find-type pred "cygwin-foo"))
(should (equal (tty-find-type pred "xterm") "xterm"))
(should (equal (tty-find-type pred "screen.xterm") "screen"))))
(provide 'faces-tests)
;;; faces-tests.el ends here