]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't ignore mouse release event in display-buffer-override-next-command
authorJuri Linkov <juri@linkov.net>
Thu, 3 Jul 2025 17:34:16 +0000 (20:34 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 20:13:33 +0000 (22:13 +0200)
* lisp/window.el (display-buffer-override-next-command):
Don't exit on mouse down event, thus waiting for the incoming
mouse up event (bug#78945).

(cherry picked from commit 3b6e8c5e3c464efbf01d51f39d044cf9d24f5eaf)

lisp/window.el

index 79babd43d6f93d405ca40563f677a91b5a092eca..f8f9e3113ada7aee64cf079fe67a36c461378a0f 100644 (file)
@@ -9625,12 +9625,15 @@ to deactivate this overriding action."
     (fset postfun
           (lambda ()
             (unless (or
-                    ;; Remove the hook immediately
-                    ;; after exiting the minibuffer.
-                    (> (minibuffer-depth) minibuffer-depth)
-                    ;; But don't remove immediately after
-                    ;; adding the hook by the same command below.
-                    (eq this-command command))
+                     ;; Remove the hook immediately
+                     ;; after exiting the minibuffer.
+                     (> (minibuffer-depth) minibuffer-depth)
+                     ;; But don't remove immediately after
+                     ;; adding the hook by the same command below.
+                     (eq this-command command)
+                     ;; Don't exit on mouse down event
+                     ;; in anticipation of mouse release event.
+                     (memq 'down (event-modifiers last-input-event)))
               (funcall exitfun))))
     ;; Call post-function after the next command finishes (bug#49057).
     (add-hook 'post-command-hook postfun)