aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Finder2025-01-18 21:06:00 -0800
committerEli Zaretskii2025-01-25 11:58:28 +0200
commit0f3d4e157fb9e638f568128096c818d4485b60fa (patch)
tree9676a92991f31a80dc4ff64622d76d279362510f
parent5878c9ae7c958af1828e85a7b4d922c1a8c1b6bf (diff)
downloademacs-0f3d4e157fb9e638f568128096c818d4485b60fa.tar.gz
emacs-0f3d4e157fb9e638f568128096c818d4485b60fa.zip
; Clean up 'xterm-mouse-mode' auto-enabling vars
* lisp/term/xterm.el (xterm--auto-xt-mouse-allowed-names) (xterm--auto-xt-mouse-allowed-types): Use `rx' macro and update docstring. (Bug#74833)
-rw-r--r--lisp/term/xterm.el28
1 files changed, 15 insertions, 13 deletions
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 23e29400c2f..15101ebd59d 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -84,13 +84,13 @@ capabilities, and only when that terminal understands bracketed paste."
84 "Characters sent by the terminal to end a bracketed paste.") 84 "Characters sent by the terminal to end a bracketed paste.")
85 85
86(defconst xterm--auto-xt-mouse-allowed-names 86(defconst xterm--auto-xt-mouse-allowed-names
87 (mapconcat (lambda (s) (concat "^" s "\\>")) 87 (rx string-start
88 '("Konsole" 88 (or "Konsole"
89 "WezTerm" 89 "WezTerm"
90 ;; "XTerm" ;Disabled because OSC52 support is opt-in only. 90 ;; "XTerm" ;Disabled because OSC52 support is opt-in only.
91 "iTerm2" ;OSC52 support has opt-in/out UI on first usage 91 "iTerm2" ;OSC52 support has opt-in/out UI on first usage
92 "kitty") 92 "kitty")
93 "\\|") 93 word-end)
94 "Regexp for terminals that automatically enable `xterm-mouse-mode' at startup. 94 "Regexp for terminals that automatically enable `xterm-mouse-mode' at startup.
95This will get matched against the terminal's XTVERSION string. 95This will get matched against the terminal's XTVERSION string.
96 96
@@ -105,14 +105,16 @@ functionality:
105\"Mouse motion mode\" (DECSET1003): Allows Emacs to get event on mouse 105\"Mouse motion mode\" (DECSET1003): Allows Emacs to get event on mouse
106 motion. 106 motion.
107 107
108Also see `xterm--auto-xt-mouse-allowed-types' which mtches against the 108Also see `xterm--auto-xt-mouse-allowed-types' which matches against the
109value of TERM instead.") 109value of TERM instead. If either `xterm--auto-xt-mouse-allowed-names'
110or `xterm--auto-xt-mouse-allowed-types' matches, then `xterm-mouse-mode'
111will get enabled automatically.")
110 112
111(defconst xterm--auto-xt-mouse-allowed-types 113(defconst xterm--auto-xt-mouse-allowed-types
112 (mapconcat (lambda (s) (concat "^" s "$")) 114 (rx string-start
113 '("alacritty" 115 (or "alacritty"
114 "contour") 116 "contour")
115 "\\|") 117 string-end)
116 "Like `xterm--auto-xt-mouse-allowed-names', but for the terminal's type. 118 "Like `xterm--auto-xt-mouse-allowed-names', but for the terminal's type.
117This will get matched against the environment variable \"TERM\".") 119This will get matched against the environment variable \"TERM\".")
118 120