From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#24030: 25.0.95; mouse-drag-region regression Date: Sat, 23 Jul 2016 13:17:09 -0400 Message-ID: References: <87y44x2s7v.fsf@gmail.com> <83wpkgz83a.fsf@gnu.org> <871t2mw6el.fsf@gmail.com> <83twfgv76y.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469294305 8231 80.91.229.3 (23 Jul 2016 17:18:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2016 17:18:25 +0000 (UTC) Cc: 24030@debbugs.gnu.org, Alex To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 23 19:18:14 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bR0Z3-0005v5-8F for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 19:18:13 +0200 Original-Received: from localhost ([::1]:53094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR0Z2-0005wb-Gf for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 13:18:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR0Yw-0005w2-Ar for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 13:18:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR0Ys-0004bT-1u for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 13:18:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR0Yr-0004bP-UW for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 13:18:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bR0Yr-0004Eg-LV for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 13:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 17:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24030 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24030-submit@debbugs.gnu.org id=B24030.146929423716229 (code B ref 24030); Sat, 23 Jul 2016 17:18:01 +0000 Original-Received: (at 24030) by debbugs.gnu.org; 23 Jul 2016 17:17:17 +0000 Original-Received: from localhost ([127.0.0.1]:35093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0Y9-0004Dg-6r for submit@debbugs.gnu.org; Sat, 23 Jul 2016 13:17:17 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:16031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0Y7-0004DU-It for 24030@debbugs.gnu.org; Sat, 23 Jul 2016 13:17:16 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BCFgA731xV/6SNCkxcgxCEAoVVwD6CTQQCAoE8PRABAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kiDcIzyMBAQEBAQEEAQEBAR6LOoE9AYNHB4QtBbM/gUUjgheBfSKCeAEBAQ X-IPAS-Result: A0BCFgA731xV/6SNCkxcgxCEAoVVwD6CTQQCAoE8PRABAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kiDcIzyMBAQEBAQEEAQEBAR6LOoE9AYNHB4QtBbM/gUUjgheBfSKCeAEBAQ X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="249034211" Original-Received: from 76-10-141-164.dsl.teksavvy.com (HELO pastel.home) ([76.10.141.164]) by ironport2-out.teksavvy.com with ESMTP; 23 Jul 2016 13:17:09 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id B878664D14; Sat, 23 Jul 2016 13:17:09 -0400 (EDT) In-Reply-To: <83twfgv76y.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jul 2016 16:02:13 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121458 Archived-At: > that creates a buffer-local binding for it. That is why select-window > gives deactivate-mark a non-nil value: select-window makes the > window's buffer the current one, which assigns buffer-local values to > all of it variables, including deactivate-mark. Then this > buffer-local value is being examined by mouse-drag-region. Indeed, this is a problem here because of have a "stale" setting of deactivate-mark. Maybe something like the patch below will do? Another option is to make the deactivate-mark function reset deactivate-mark to nil (which would seem to make a lot of sense in itself) and then to call deactivate-mark at that point or to move the earlier deactivate-mark to after mouse-set-point. Of course, maybe there should be a more thorough handling of stale deactivate-mark settings. IOW change all places that set deactivate-mark to non-nil so they also record the affected buffer and then change the command loop so that it calls deactivate-mark in all those buffers where deactivate-mark was set as non-nil. Stefan diff --git a/lisp/mouse.el b/lisp/mouse.el index 27f2acb..6175d77 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -811,6 +811,7 @@ mouse-drag-track ;; window, now let's jump to the place of the event, where things ;; are happening. (_ (mouse-set-point start-event)) + (_ (kill-local-variable 'deactivate-mark)) (echo-keystrokes 0) (start-posn (event-start start-event)) (start-point (posn-point start-posn))