From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 04 18:29:35 2015 Received: (at submit) by debbugs.gnu.org; 4 Apr 2015 22:29:35 +0000 Received: from localhost ([127.0.0.1]:44980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeWZL-000737-CE for submit@debbugs.gnu.org; Sat, 04 Apr 2015 18:29:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53753) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YeWZJ-00072m-Uj for submit@debbugs.gnu.org; Sat, 04 Apr 2015 18:29:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YeWZD-0004fw-QF for submit@debbugs.gnu.org; Sat, 04 Apr 2015 18:29:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:43300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeWZD-0004fs-N4 for submit@debbugs.gnu.org; Sat, 04 Apr 2015 18:29:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeWZC-00069a-RE for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 18:29:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YeWZ9-0004Vf-F4 for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 18:29:26 -0400 Received: from loki.jorgenschaefer.de ([87.230.15.51]:58397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YeWZ9-0004S1-8d for bug-gnu-emacs@gnu.org; Sat, 04 Apr 2015 18:29:23 -0400 Received: by loki.jorgenschaefer.de (Postfix, from userid 1000) id 71CF6200E92; Sun, 5 Apr 2015 00:29:21 +0200 (CEST) From: Jorgen Schaefer To: bug-gnu-emacs@gnu.org Subject: 24.4.1; Triple-clicking selects and deselects the line in weird situations Date: Sun, 05 Apr 2015 00:29:21 +0200 Message-ID: <87iodb4jem.fsf@loki.jorgenschaefer.de> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello! We came across a weird behavior in Emacs. The graphical version (in X) will select a line if the mouse is triple-clicked. Under certain situations, it will select but immediately deselect the line again. Reproduction: Triple-click on any line in any buffer. Notice that Emacs selects the whole line, and leaves it selected. Evaluate the following code. (defun repro-filter (fun beg end delete) (let ((string (funcall fun beg end delete))) (with-temp-buffer (insert ".")) string)) (with-current-buffer (get-buffer-create "*Bug*") (set (make-local-variable 'filter-buffer-substring-functions) '(repro-filter)) (insert "Hello, World!\n") (pop-to-buffer (current-buffer))) Triple-click on the "World" in the *Bug* buffer. Notice that Emacs selects the whole line only momentarily, and then deselects it again immediately. I expected the line to stay selected like without this piece of code. This bug was not present in 24.3. Regards, Jorgen From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 07 14:54:11 2015 Received: (at 20260) by debbugs.gnu.org; 7 Apr 2015 18:54:11 +0000 Received: from localhost ([127.0.0.1]:48187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YfYdX-0001Zq-37 for submit@debbugs.gnu.org; Tue, 07 Apr 2015 14:54:11 -0400 Received: from mercure.iro.umontreal.ca ([132.204.24.67]:46219) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YfYdV-0001Zi-C0 for 20260@debbugs.gnu.org; Tue, 07 Apr 2015 14:54:09 -0400 Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 15A079C157; Tue, 7 Apr 2015 14:54:06 -0400 (EDT) Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 0CC511E5B8B; Tue, 7 Apr 2015 14:53:43 -0400 (EDT) Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id E750CB4122; Tue, 7 Apr 2015 14:53:42 -0400 (EDT) From: Stefan Monnier To: Jorgen Schaefer Subject: Re: bug#20260: 24.4.1; Triple-clicking selects and deselects the line in weird situations Message-ID: References: <87iodb4jem.fsf@loki.jorgenschaefer.de> Date: Tue, 07 Apr 2015 14:53:42 -0400 In-Reply-To: <87iodb4jem.fsf@loki.jorgenschaefer.de> (Jorgen Schaefer's message of "Sun, 05 Apr 2015 00:29:21 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-1.49, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_CLICKON 0.22, MC_DESACTV 1.11, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-Spam-Status: No X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20260 Cc: 20260@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > Triple-click on the "World" in the *Bug* buffer. Notice that Emacs > selects the whole line only momentarily, and then deselects it again > immediately. Indeed. I though I had fixed this in Emacs-25 by making deactivate-mark buffer-local, but I actually failed to adjust the C code accordingly. The patch below seems to fix your test case. Can you confirm it also fixes your real use case? Stefan diff --git a/src/fileio.c b/src/fileio.c index d4e12cb..a6e7fbb 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4165,7 +4165,7 @@ by calling `format-decode', which see. */) Vdeactivate_mark = old_Vdeactivate_mark; } else - Vdeactivate_mark = Qt; + Fset (Qdeactivate_mark, Qt); emacs_close (fd); clear_unwind_protect (fd_index); diff --git a/src/insdel.c b/src/insdel.c index 80650be..22c2bcc 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1846,7 +1846,7 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t end, = call1 (Fsymbol_value (Qregion_extract_function), Qnil); signal_before_change (start, end, preserve_ptr); - Vdeactivate_mark = Qt; + Fset (Qdeactivate_mark, Qt); } /* Like above, but called when we know that the buffer text From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 08 06:41:17 2015 Received: (at 20260) by debbugs.gnu.org; 8 Apr 2015 10:41:17 +0000 Received: from localhost ([127.0.0.1]:48823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YfnQ4-0001sk-SL for submit@debbugs.gnu.org; Wed, 08 Apr 2015 06:41:17 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:38719) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YfnQ2-0001sV-VS for 20260@debbugs.gnu.org; Wed, 08 Apr 2015 06:41:15 -0400 Received: by wiun10 with SMTP id n10so52863587wiu.1 for <20260@debbugs.gnu.org>; Wed, 08 Apr 2015 03:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=tfxkFNEpAgiKTr0juwFxRE25Cp+ae+6TKLnJacISYVc=; b=pfTf/B+g9IOtXasLble6+aNcsnQh4W2OMZqkKzEa1ctOXlw2BbdxYe0OQyrGDuS20w qA2fS+xVdPRgSytJoTrycrWYs9zyOevegYtD7wPWXRYNw3rRb/wVEFI1P9hIdsB+lEYa 0eMMQ0SAFpVSayM3PY0vpzKrrHbF+7jYwe/xdRmjB232nHinSF2Y08JyeCIZDNmZvFjF WLkR7J2Qy81IyX0q2mcBN3VymLZ6GJ70RJTsOuPtAD4y/TpqH7BOnX1jAbgSeKbg6ljb p+djPNIgUwe87XwTBdhkh0Y+7iqdDU9X1SE4ku9ju8As7fMceE3j2EcNckXQoRlGdgn+ ZkdQ== X-Received: by 10.180.214.99 with SMTP id nz3mr13338085wic.82.1428489669296; Wed, 08 Apr 2015 03:41:09 -0700 (PDT) Received: from localhost ([2001:470:7860:11e0:21e:65ff:fee6:94b0]) by mx.google.com with ESMTPSA id p9sm15020163wje.12.2015.04.08.03.41.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2015 03:41:08 -0700 (PDT) Date: Wed, 8 Apr 2015 12:41:06 +0200 From: Vasilij Schneidermann To: 20260@debbugs.gnu.org Subject: Re: bug#20260: 24.4.1; Triple-clicking selects and deselects the line in weird situations Message-ID: <20150408104106.GA13929@odonien.bevuta.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20260 Cc: contact@jorgenschaefer.de, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) The patch does indeed fix the test case for me, but the real use case stays unchanged. Meanwhile, I've found a way to make the test case pass on 24.4, let-binding `deactivate-mark`: (defun repro-filter (fun beg end delete) (let ((string (funcall fun beg end delete)) deactivate-mark) (with-temp-buffer (insert ".")) string)) (with-current-buffer (get-buffer-create "*Bug*") (set (make-local-variable 'filter-buffer-substring-functions) '(repro-filter)) (insert "Hello, World!\n") (pop-to-buffer (current-buffer))) This change makes triple-clicking "World" in the *Bug* buffer no longer deselect it. Why it is needed in 24.4, but not in 24.3 is beyond my understanding of Emacs. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 08 10:27:09 2015 Received: (at 20260) by debbugs.gnu.org; 8 Apr 2015 14:27:09 +0000 Received: from localhost ([127.0.0.1]:49250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yfqwe-0000dK-NX for submit@debbugs.gnu.org; Wed, 08 Apr 2015 10:27:09 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:54017) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yfqwb-0000co-Mr for 20260@debbugs.gnu.org; Wed, 08 Apr 2015 10:27:06 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFAGvvdVRBbthL/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCwsOJhIUGA0kiBOiEYt4bAkDA4M+AwcEAQMBAQEBAQEEg1cEqDs X-IPAS-Result: AgUFAGvvdVRBbthL/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCwsOJhIUGA0kiBOiEYt4bAkDA4M+AwcEAQMBAQEBAQEEg1cEqDs X-IronPort-AV: E=Sophos;i="5.01,1,1400040000"; d="scan'208";a="115707317" Received: from 65-110-216-75.cpe.pppoe.ca (HELO pastel.home) ([65.110.216.75]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Apr 2015 10:26:59 -0400 Received: by pastel.home (Postfix, from userid 20848) id B3C9D1FC7; Wed, 8 Apr 2015 10:26:59 -0400 (EDT) From: Stefan Monnier To: Vasilij Schneidermann Subject: Re: bug#20260: 24.4.1; Triple-clicking selects and deselects the line in weird situations Message-ID: References: <20150408104106.GA13929@odonien.bevuta.com> Date: Wed, 08 Apr 2015 10:26:59 -0400 In-Reply-To: <20150408104106.GA13929@odonien.bevuta.com> (Vasilij Schneidermann's message of "Wed, 8 Apr 2015 12:41:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20260 Cc: contact@jorgenschaefer.de, 20260@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > The patch does indeed fix the test case for me, but the real use case > stays unchanged. Hmm... Can you provide another recipe that still isn't fixed with the patch? > Meanwhile, I've found a way to make the test case pass on 24.4, > let-binding `deactivate-mark`: Yes, that works around the problem, but it shouldn't be necessary in Emacs-25. The workaround you use was needed in many places: deactivate-mark was global, so modifying one buffer could end up deactivating the mark in some unrelated buffer. In Emacs-25, we've changed it to be buffer-local, so modifications in one buffer should not affect the activation of the mark in another any more. > Why it is needed in 24.4, but not in 24.3 is beyond my > understanding of Emacs. I don't know either, actually. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 10 15:04:46 2015 Received: (at 20260) by debbugs.gnu.org; 10 Apr 2015 19:04:46 +0000 Received: from localhost ([127.0.0.1]:52672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YgeEP-0000PH-R9 for submit@debbugs.gnu.org; Fri, 10 Apr 2015 15:04:46 -0400 Received: from loki.jorgenschaefer.de ([87.230.15.51]:48076) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YgeEO-0000P9-97 for 20260@debbugs.gnu.org; Fri, 10 Apr 2015 15:04:45 -0400 Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by loki.jorgenschaefer.de (Postfix) with ESMTPSA id BD3B72012F3 for <20260@debbugs.gnu.org>; Fri, 10 Apr 2015 21:04:42 +0200 (CEST) Received: by wgsk9 with SMTP id k9so26573706wgs.3 for <20260@debbugs.gnu.org>; Fri, 10 Apr 2015 12:04:42 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.85.42 with SMTP id e10mr420943wiz.17.1428692682525; Fri, 10 Apr 2015 12:04:42 -0700 (PDT) Received: by 10.27.83.213 with HTTP; Fri, 10 Apr 2015 12:04:42 -0700 (PDT) In-Reply-To: References: <20150408104106.GA13929@odonien.bevuta.com> Date: Fri, 10 Apr 2015 21:04:42 +0200 Message-ID: Subject: Re: bug#20260: 24.4.1; Triple-clicking selects and deselects the line in weird situations From: =?UTF-8?Q?Jorgen_Sch=C3=A4fer?= To: Stefan Monnier Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 20260 Cc: Vasilij Schneidermann , 20260@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello. At least for me, the patch fixes the problem in the original context (Circe IRC buffers). Thank you. But that means I'm out of the game for providing test cases, I am afraid ... Regards, Jorgen From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 13 10:18:28 2015 Received: (at 20260-done) by debbugs.gnu.org; 13 Apr 2015 14:18:28 +0000 Received: from localhost ([127.0.0.1]:55100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YhfBz-0003lh-JJ for submit@debbugs.gnu.org; Mon, 13 Apr 2015 10:18:28 -0400 Received: from mercure.iro.umontreal.ca ([132.204.24.67]:58798) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YhfBy-0003lY-4B for 20260-done@debbugs.gnu.org; Mon, 13 Apr 2015 10:18:26 -0400 Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id AC11285F0B; Mon, 13 Apr 2015 10:18:25 -0400 (EDT) Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 7D83F1E5B8B; Mon, 13 Apr 2015 10:18:02 -0400 (EDT) Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 57793B4122; Mon, 13 Apr 2015 10:18:02 -0400 (EDT) From: Stefan Monnier To: Vasilij Schneidermann Subject: Re: bug#20260: 24.4.1; Triple-clicking selects and deselects the line in weird situations Message-ID: References: <20150408104106.GA13929@odonien.bevuta.com> Date: Mon, 13 Apr 2015 10:18:02 -0400 In-Reply-To: (Stefan Monnier's message of "Wed, 08 Apr 2015 10:26:59 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-Spam-Status: No X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20260-done Cc: contact@jorgenschaefer.de, 20260-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) >> The patch does indeed fix the test case for me, but the real use case >> stays unchanged. Since it fixes Jorgen's test case I installed the patch into master, and I'm closing this bug. > Hmm... Can you provide another recipe that still isn't fixed with the patch? If/when you find another recipe to reproduce your problem, just make a new bug report (or re-open this one). Thank you, Stefan From unknown Fri Aug 15 04:05:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 12 May 2015 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator