]> git.eshelyaron.com Git - emacs.git/commitdiff
Issue a message if getting a selection takes a long time
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 20 Jun 2022 15:34:33 +0000 (17:34 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 20 Jun 2022 15:34:33 +0000 (17:34 +0200)
* lisp/term/x-win.el (gui-backend-get-selection): If getting the
selection takes a long time, issue a message after one second
(bug#46935).

lisp/term/x-win.el

index 31fc3ba534d3343c26c0420d299d928af25a0ac1..6e083499df4be8953100622d664305bc1ee92e9e 100644 (file)
@@ -1366,7 +1366,9 @@ This returns an error if any Emacs frames are X frames."
 (cl-defmethod gui-backend-get-selection (selection-symbol target-type
                                          &context (window-system x)
                                          &optional time-stamp terminal)
-  (x-get-selection-internal selection-symbol target-type time-stamp terminal))
+  (with-delayed-message (1 "Waiting for selection")
+    (x-get-selection-internal selection-symbol target-type
+                              time-stamp terminal)))
 
 ;; Initiate drag and drop
 (add-hook 'after-make-frame-functions 'x-dnd-init-frame)