]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/dnd.el (dnd-handle-movement): Avoid errors (bug#70311).
authorEli Zaretskii <eliz@gnu.org>
Sun, 14 Apr 2024 10:16:29 +0000 (13:16 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 22 Apr 2024 18:35:12 +0000 (20:35 +0200)
(cherry picked from commit 5971aa1fd32583a8d50b67a56cf1b40f1665fca0)

lisp/dnd.el

index f7eb074076eb88476ec54de76d0777f8e6e954bd..e721dd0570cef1b49102777003659c77ad7e7433 100644 (file)
@@ -151,8 +151,13 @@ Windows."
                 (with-selected-window window
                   (scroll-down 1))))))))
       (when dnd-indicate-insertion-point
-        (ignore-errors
-          (goto-char (posn-point posn)))))))
+        (let ((pos (posn-point posn)))
+          ;; We avoid errors here, since on some systems this runs
+          ;; when waiting_for_input is non-zero, and that aborts on
+          ;; error.
+          (if (and pos (<= (point-min) pos (point-max)))
+              (goto-char pos)
+            pos))))))
 
 (defun dnd-handle-one-url (window action url)
   "Handle one dropped url by calling the appropriate handler.