Commit 1c9df23f authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(mouse-drag-region): Don't call mouse-set-region-1

if mark is gone or no longer active or if we changed buffers.
parent e4269dcb
......@@ -594,8 +594,15 @@ remains active. Otherwise, it remains until the next input event."
(push-mark region-commencement t t)
(goto-char region-termination)
(copy-region-as-kill (point) (mark t))
(let ((buffer (current-buffer)))
;; mouse-show-mark can call read-event,
;; and that means the Emacs server could switch buffers
;; under us. If that happened,
;; avoid trying to use the region.
(and (mark t) mark-active
(eq buffer (current-buffer))
(goto-char (overlay-end mouse-drag-overlay))
(setq this-command 'mouse-set-point)
(delete-overlay mouse-drag-overlay))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment