From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vincent Lefevre Newsgroups: gmane.emacs.bugs Subject: bug#18939: 24.4; middle-click sometimes pastes data other than the PRIMARY selection Date: Sun, 4 Jan 2015 03:23:37 +0100 Message-ID: <20150104022337.GA15906@xvii.vinc17.org> References: <87zja54ds7.fsf@anar.lloke.localnet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="n8g4imXOkfNTN/H1" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1420338258 22492 80.91.229.3 (4 Jan 2015 02:24:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Jan 2015 02:24:18 +0000 (UTC) Cc: 774090@bugs.debian.org, 18939@debbugs.gnu.org To: Riku Saikkonen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 04 03:24:13 2015 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 1Y7arU-0004Bn-UE for geb-bug-gnu-emacs@m.gmane.org; Sun, 04 Jan 2015 03:24:13 +0100 Original-Received: from localhost ([::1]:55873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7arT-0007Fm-SB for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Jan 2015 21:24:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7arP-0007Fh-R9 for bug-gnu-emacs@gnu.org; Sat, 03 Jan 2015 21:24:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y7arK-00078p-Sq for bug-gnu-emacs@gnu.org; Sat, 03 Jan 2015 21:24:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y7arK-00078l-Q5 for bug-gnu-emacs@gnu.org; Sat, 03 Jan 2015 21:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y7arK-0007xO-6Z for bug-gnu-emacs@gnu.org; Sat, 03 Jan 2015 21:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jan 2015 02:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18939 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18939-submit@debbugs.gnu.org id=B18939.142033822330393 (code B ref 18939); Sun, 04 Jan 2015 02:24:02 +0000 Original-Received: (at 18939) by debbugs.gnu.org; 4 Jan 2015 02:23:43 +0000 Original-Received: from localhost ([127.0.0.1]:35906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7ar0-0007u2-FV for submit@debbugs.gnu.org; Sat, 03 Jan 2015 21:23:42 -0500 Original-Received: from ioooi.vinc17.net ([92.243.22.117]:37366) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y7aqx-0007tV-KH for 18939@debbugs.gnu.org; Sat, 03 Jan 2015 21:23:40 -0500 Original-Received: from smtp-xvii.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by ioooi.vinc17.net (Postfix) with ESMTPSA id 8B820444; Sun, 4 Jan 2015 03:23:38 +0100 (CET) Original-Received: by xvii.vinc17.org (Postfix, from userid 1000) id 2045E21A07A; Sun, 4 Jan 2015 03:23:37 +0100 (CET) Content-Disposition: inline In-Reply-To: <87zja54ds7.fsf@anar.lloke.localnet> X-Mailer-Info: http://www.vinc17.net/mutt/ User-Agent: Mutt/1.5.23-6371-vl-r75100 (2014-11-04) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97976 Archived-At: --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit [Cc to the Debian bug] On 2014-12-30 12:45:12 +0200, Riku Saikkonen wrote: > I tried to trace where the bug occurs, and got as far as this: > > mouse-drag-track contains the lines > > ;; Otherwise, run binding of terminating up-event. > (deactivate-mark) > (if do-multi-click > (goto-char start-point) > (unless moved-off-start > (pop-mark))) > > (lines 858-863 of mouse.el in Emacs 24.4.1) [...] How about locally setting select-active-regions to nil for (deactivate-mark)? See attached patch, which seems to work for me, though I don't know all the consequences. It is inspired from the patch suggested at http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6872#8 and the one that was really applied as 1c409d0b963ebdb1f48b90ddce85c56d989bee5f. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="emacs24-primarysel2.patch" diff --git a/lisp/mouse.el b/lisp/mouse.el index e267418..2afe313 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -856,7 +856,8 @@ DO-MOUSE-DRAG-REGION-POST-PROCESS should only be used by (copy-region-as-kill (mark) (point))))) ;; Otherwise, run binding of terminating up-event. - (deactivate-mark) + (let (select-active-regions) + (deactivate-mark)) (if do-multi-click (goto-char start-point) (unless moved-off-start --n8g4imXOkfNTN/H1--