Don't always enable xterm-mouse-mode (bug#74833)
Many terminals set the environment variable TERM to "xterm" even when they
don't support all functionality in xterm. This means that enabling
xterm-mouse-mode can break critical editing workflows like copy/paste. This
adds checks for the specific terminal Emacs is run in and only enables
xterm-mouse-mode on terminals knows to support all critical editing workflows.
* etc/NEWS: Update announcement
* lisp/term/xterm.el (xterm--auto-xt-mouse-allowed-names)
(xterm--auto-xt-mouse-allowed-types): New variables to control
what terminals automatically enable xterm-mouse-mode.
(xterm--report-background-handler, xterm--version-handler): Use
xterm--read-string.
(xterm--read-string, xterm--query-name-and-version): New
function.
(xterm--init): Check what terminal is running and if
xterm-mouse-mode was manually called.
* lisp/xt-mouse.el (xterm-mouse-mode-called): New variable.
(xterm-mouse-mode): Set xterm-mouse-mode-called. Mention
automatic call by xterm--init. Delete outdated comment text.
(cherry picked from commit
ba6429081a8560979136cf6fa40ff3f3c4859a53)