[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master cad2c4b: Tweak tty-find-type to allow TERM=screen.xterm
From: |
Lars Ingebrigtsen |
Subject: |
master cad2c4b: Tweak tty-find-type to allow TERM=screen.xterm |
Date: |
Wed, 20 Jan 2021 11:25:53 -0500 (EST) |
branch: master
commit cad2c4b14a98d24d6cba4089bd48340899dcff52
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
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).
---
lisp/faces.el | 2 +-
test/lisp/faces-tests.el | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/lisp/faces.el b/lisp/faces.el
index 4e98338..d654b1f 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -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)
diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el
index 6e77259..c0db9c9 100644
--- a/test/lisp/faces-tests.el
+++ b/test/lisp/faces-tests.el
@@ -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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master cad2c4b: Tweak tty-find-type to allow TERM=screen.xterm,
Lars Ingebrigtsen <=