# HG changeset patch # User Richard M. Stallman # Date 840300979 0 # Node ID 2fe76a330b1efc2a68614c137d1bf79a1ae97da2 # Parent 79dba775070dce2f00cc9085c4f4cd2d6c92976b (mouse-drag-region): Don't call mouse-set-region-1 if mark is gone or no longer active or if we changed buffers. diff -r 79dba775070d -r 2fe76a330b1e lisp/mouse.el --- a/lisp/mouse.el Sat Aug 17 11:53:54 1996 +0000 +++ b/lisp/mouse.el Sat Aug 17 16:56:19 1996 +0000 @@ -594,8 +594,15 @@ (push-mark region-commencement t t) (goto-char region-termination) (copy-region-as-kill (point) (mark t)) - (mouse-show-mark) - (mouse-set-region-1)) + (let ((buffer (current-buffer))) + (mouse-show-mark) + ;; 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)) + (mouse-set-region-1)))) (goto-char (overlay-end mouse-drag-overlay)) (setq this-command 'mouse-set-point) (delete-overlay mouse-drag-overlay))))