From 5c7e11169b4043150a04623608de798e6edd821b 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' when deciding to update primary selection `display-selections-p' is documented as the preferred way to determine capabilities, over `window-system`. This change moves the decision into lisp, where users can advise changes. * 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 274c7b3fa8..fd44a1a739 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1577,7 +1577,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 @@ -12154,6 +12154,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.255.ge46751e96f-goog