]> git.eshelyaron.com Git - emacs.git/commitdiff
Tweak tty-find-type to allow TERM=screen.xterm
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 20 Jan 2021 16:25:40 +0000 (17:25 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 20 Jan 2021 16:25:40 +0000 (17:25 +0100)
* lisp/faces.el (tty-find-type): Allow TERM=screen.xterm to find
term/screen.el (bug#45824).

lisp/faces.el
test/lisp/faces-tests.el

index 4e98338432f441bdcd920979c92659a560d107e0..d654b1f0e2a74e1a2b50392e261d0eca9cfc804b 100644 (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)
index 6e77259fe1b9aac66a7dc39e8153008de091f762..c0db9c9de172d86e93a9755df66521d8d25dfbfd 100644 (file)
         ))
   )
 
+(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