From 7e1f84fa3bc7dfd84415813889c91070c0759da2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 18 Jun 2022 19:21:21 +0300 Subject: [PATCH] Fix test failures due to 'xterm-select-active-regions' * lisp/frame.el (tty-select-active-regions): Rename from xterm-select-active-regions and move here from xterm.c. (display-selections-p): Adjust to the above. (Bug#55883) --- etc/NEWS | 4 ++-- lisp/frame.el | 12 +++++++++--- lisp/term/xterm.el | 8 -------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 438cec9257f..f9eb81908b8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -509,8 +509,8 @@ the 'COLORTERM' environment variable is set to the value "truecolor". *** Select active regions with xterm selection support. On terminals with xterm setSelection support, the active region may be saved to the X primary selection, following the -'select-active-regions' variable. This support is enabled with -'xterm-select-active-regions'. +'select-active-regions' variable. This support is enabled when +'tty-select-active-regions' is non-nil. ** ERT diff --git a/lisp/frame.el b/lisp/frame.el index 35863c01350..a6aa4475dd9 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2149,8 +2149,14 @@ frame's display)." (defalias 'display-multi-frame-p #'display-graphic-p) (defalias 'display-multi-font-p #'display-graphic-p) -;; From term/xterm.el -(defvar xterm-select-active-regions) +(defcustom tty-select-active-regions nil + "If non-nil, update PRIMARY window-system selection on text-mode frames. +On a text-mode terminal that supports setSelection command, if +this variable is non-nil, Emacs will set the PRIMARY selection +from the active region, according to `select-active-regions'. +This is currently supported only on xterm." + :version "29.1" + :type 'boolean) (defun display-selections-p (&optional display) "Return non-nil if DISPLAY supports selections. @@ -2167,7 +2173,7 @@ frame's display)." (not (null dos-windows-version)))) ((memq frame-type '(x w32 ns pgtk)) t) - ((and xterm-select-active-regions + ((and tty-select-active-regions (terminal-parameter nil 'xterm--set-selection)) t) (t diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 0791780d406..a7e257f41c5 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -80,14 +80,6 @@ capabilities, and only when that terminal understands bracketed paste." :version "28.1" :type 'boolean) -(defcustom xterm-select-active-regions nil - "If non-nil, update PRIMARY X selection on text-mode frames. -On a text-mode terminal that supports setSelection command, if -this variable is non-nil, Emacs will set the PRIMARY selection -from the active region, according to `select-active-regions'." - :version "29.1" - :type 'boolean) - (defconst xterm-paste-ending-sequence "\e[201~" "Characters sent by the terminal to end a bracketed paste.") -- 2.39.2