* 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)
committerEli Zaretskii <eliz@gnu.org>
Sun, 14 Apr 2024 10:16:29 +0000 (13:16 +0300)
lisp/dnd.el

index 89652d32abf633557d82c781d0711e34a9746c0c..b68dc26935470eeedb71c668a00f60de0f18a91b 100644 (file)
@@ -149,8 +149,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.