From 5dee5a44fd0d3ad57ba7e40fd5b0542d70160c14 Mon Sep 17 00:00:00 2001 From: Duncan Findlay Date: Fri, 20 May 2022 00:17:51 -0700 Subject: [PATCH 1/2] Use `display-selections-p' for selecting active region `display-selections-p' is documented as the preferred way to determine capabilities, over `window-system'. This allows supported text terminals to indicate support for these selections. * src/keyboard.c (command_loop_1): Replace call to `window-system' with `display-selections-p' when deciding whether to update primary selection. --- src/keyboard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/keyboard.c b/src/keyboard.c index 55d710ed62..dc3c37e4d8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1569,7 +1569,7 @@ command_loop_1 (void) { /* Even if not deactivating the mark, set PRIMARY if `select-active-regions' is non-nil. */ - if (!NILP (Fwindow_system (Qnil)) + if (!NILP (call0 (Qdisplay_selections_p)) /* Even if mark_active is non-nil, the actual buffer marker may not have been set yet (Bug#7044). */ && XMARKER (BVAR (current_buffer, mark))->buffer @@ -12162,6 +12162,7 @@ syms_of_keyboard (void) DEFSYM (Qpolling_period, "polling-period"); + DEFSYM (Qdisplay_selections_p, "display-selections-p"); DEFSYM (Qgui_set_selection, "gui-set-selection"); /* The primary selection. */ -- 2.36.1.476.g0c4daa206d-goog