diff options
| author | Lars Ingebrigtsen | 2021-01-20 17:25:40 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-01-20 17:25:40 +0100 |
| commit | cad2c4b14a98d24d6cba4089bd48340899dcff52 (patch) | |
| tree | df3f05467a8b01d2de69c306a416c0a5beffb168 | |
| parent | f30cf07ecba8f4316b268b7ad57705a0aa16d660 (diff) | |
| download | emacs-cad2c4b14a98d24d6cba4089bd48340899dcff52.tar.gz emacs-cad2c4b14a98d24d6cba4089bd48340899dcff52.zip | |
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).
| -rw-r--r-- | lisp/faces.el | 2 | ||||
| -rw-r--r-- | test/lisp/faces-tests.el | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 4e98338432f..d654b1f0e2a 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -2199,7 +2199,7 @@ the above example." | |||
| 2199 | (not (funcall pred type))) | 2199 | (not (funcall pred type))) |
| 2200 | ;; Strip off last hyphen and what follows, then try again | 2200 | ;; Strip off last hyphen and what follows, then try again |
| 2201 | (setq type | 2201 | (setq type |
| 2202 | (if (setq hyphend (string-match-p "[-_][^-_]+$" type)) | 2202 | (if (setq hyphend (string-match-p "[-_.][^-_.]+$" type)) |
| 2203 | (substring type 0 hyphend) | 2203 | (substring type 0 hyphend) |
| 2204 | nil)))) | 2204 | nil)))) |
| 2205 | type) | 2205 | type) |
diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el index 6e77259fe1b..c0db9c9de17 100644 --- a/test/lisp/faces-tests.el +++ b/test/lisp/faces-tests.el | |||
| @@ -217,5 +217,13 @@ | |||
| 217 | )) | 217 | )) |
| 218 | ) | 218 | ) |
| 219 | 219 | ||
| 220 | (ert-deftest test-tty-find-type () | ||
| 221 | (let ((pred (lambda (string) | ||
| 222 | (locate-library (concat "term/" string ".el"))))) | ||
| 223 | (should (tty-find-type pred "cygwin")) | ||
| 224 | (should (tty-find-type pred "cygwin-foo")) | ||
| 225 | (should (equal (tty-find-type pred "xterm") "xterm")) | ||
| 226 | (should (equal (tty-find-type pred "screen.xterm") "screen")))) | ||
| 227 | |||
| 220 | (provide 'faces-tests) | 228 | (provide 'faces-tests) |
| 221 | ;;; faces-tests.el ends here | 229 | ;;; faces-tests.el ends here |