From ff7bd84b233888257b4b71214eb0a372168d0bae Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 14 Nov 2017 10:09:24 +0100 Subject: [PATCH] Make 'mouse-drag-and-drop-region' work with 'mouse-autoselect-window' non-nil * lisp/mouse.el (mouse-drag-and-drop-region): Ignore 'select-window' events to make it work with 'mouse-autoselect-window'. --- lisp/mouse.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/mouse.el b/lisp/mouse.el index 5eeee1ec52c..545a7ff2a02 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -2380,7 +2380,9 @@ is copied instead of being cut." ;; When event was click instead of drag, skip loop (while (progn (setq event (read-event)) - (mouse-movement-p event)) + (or (mouse-movement-p event) + ;; Handle `mouse-autoselect-window'. + (eq (car event) 'select-window))) (unless value-selection ; initialization (delete-overlay mouse-secondary-overlay) (setq value-selection (buffer-substring start end)) -- 2.39.2