From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#23571: 25.1.50; Click-mouse-1 = Drag-mouse-1 in Gnus Article buffer Date: Fri, 27 May 2016 11:20:10 +0200 Message-ID: <874m9jdfro.fsf@gmx.net> References: <87futfbio4.fsf@gmx.net> <874m9k3inf.fsf@gmx.net> <83zirc22sf.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1464340890 21645 80.91.229.3 (27 May 2016 09:21:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 May 2016 09:21:30 +0000 (UTC) Cc: 23571@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 27 11:21:19 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 1b6DxG-0007TF-9L for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 May 2016 11:21:18 +0200 Original-Received: from localhost ([::1]:44821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6DxA-000202-Fh for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 May 2016 05:21:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Dx4-0001ys-3k for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 05:21:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Dwz-0003UO-SR for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 05:21:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Dwz-0003UK-OQ for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 05:21:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b6Dwz-0007J8-LX for bug-gnu-emacs@gnu.org; Fri, 27 May 2016 05:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 May 2016 09:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23571 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23571-submit@debbugs.gnu.org id=B23571.146434082128036 (code B ref 23571); Fri, 27 May 2016 09:21:01 +0000 Original-Received: (at 23571) by debbugs.gnu.org; 27 May 2016 09:20:21 +0000 Original-Received: from localhost ([127.0.0.1]:41187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6DwK-0007I8-Ph for submit@debbugs.gnu.org; Fri, 27 May 2016 05:20:21 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:63571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6DwI-0007Ht-R6 for 23571@debbugs.gnu.org; Fri, 27 May 2016 05:20:19 -0400 Original-Received: from rosalinde ([89.245.69.153]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MC4R6-1bF3dr3Hvc-008qTU; Fri, 27 May 2016 11:20:12 +0200 In-Reply-To: <83zirc22sf.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 May 2016 19:37:52 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-Provags-ID: V03:K0:IuJ5yea3spM4o9fNRVIdmCQVlBe9v2ZA9XOj1szPRkYtibaWLIq Ea6Cpnrs8MiOA7SnVeLfF+wVBvXg8dEetW5b5V4DbB8pdYoF0M3s7EdBmiovflCi2A/c31N Gt3Stqm2jGl+eUg33PwCsjXEQ5ll8pKvbECW34WWclPaS5haEdxt4eQ62GYH1W5t1mB9lbN lmV8taoE7ZXyrPjc2AAjQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:yFjDM9QIZ8k=:Ahz+ulP2xJWVBqAlhew5SO BGUWawPxkwuiuNd/TLjZlf/YXsI3e/7aH+lYupJLPjU7hFv19Idgr9VEbFD8eNYPi/LVowtBQ F3JBFB4Y8UzRjtz+fGiA2hbz14NfUrrU3ak+cbmsTc17laAUl0aDoc5rKbe7U60PWxAaq2kF9 xDVWb33xFQhBY44V+ql8LpG1AIQobeNnTlpIBUzZRYxn9ARMpTYHc2cAsrH68Ga9TZfvx6BsW B6UMVziaPJzPCT2zw1OTnXnxnXjPoyfPc+F2tOs/0YBgFu+B2O1syA1xsmwruWW/6Dzi59iKZ 4YnIra6KSgZYBgBeXD+oEKdFXb2LD7IFxOANuj/1nRcxl1eOjERZ0TJtmrai2XrYD8IYrtaKi wedNYqJRXoApwrl2WBzR4bBH5QxVTWvCokdyxoFw1aQ0F7jDF128Vx1Z7EZP5XcgZXbajluzm eJc9NUFLJP4UCc0MHVi/kjpy2ZSdUdEvSfJsMm+X+u5dlI2lGlOTB7kajUquRTjMoCjpLLYn8 vi9vaUjYgWxXdjTdwBzw6qq0Q+lqzB9u5HRQCUN38eFYp/bORHkZF2RX+HE/96LEybGGf28Su +yQNLF2ggtpJRJzSDnbvDvCBYkwDe+6/aqY0CM9aLrBvga/Y/NPnHNNIbLvHjiXiXoZ0gsuTS gksbgKKqcEXRdj7Ar+baobI8aw6Ns6MqZzXO1l01+oMAcM3wdOEXKBbKY3BFl1FqjTJKIzWrn Z9nbYFyf3AuGcFNPExIJVxl/S+CXPgw78KteJ4/O0uip2fa3a4QqhIRcMxIl0dgxZStCsLy3 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:118741 Archived-At: On Thu, 26 May 2016 19:37:52 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Date: Thu, 26 May 2016 18:09:56 +0200 >> >> On Wed, 18 May 2016 15:27:23 +0200 Stephen Berman wrote: >> >> > Clicking mouse-1 in a Gnus Article buffer, then releasing it and moving >> > the mouse (without holding down a mouse key) highlights a region, just >> > as when the mouse is dragged with mouse-1 held down. To reproduce: >> > >> > 0. emacs -Q >> > 1. M-x gnus, type `y' at the prompt, then type `B RET news.gmane.org RET >> > 1 RET' to open the most recent article in gmane.announce on the >> > news.gmane.org server. >> > 2. Click anywhere in the Article buffer (except on the texts following >> > the From: and To: headers, which are buttons) with mouse-1, release >> > mouse-1, move the mouse. >> > => A region is highlighted. >> > >> > Subsequently clicking and releasing mouse-1 does not deactivate the >> > mark (but clicking with mouse-2 or mouse-3 does). >> > >> > I have not observed this behavior anywhere besides Gnus Article buffers. >> > >> > This happens in master but not in emacs-25. It happens at least since >> > commit 62d7acae7405732268713006d839a5c3507b9482, which was my first >> > build from master after a long pause, so I don't know when this behavior >> > first appeared (I didn't save any earlier builds from master, which were >> > from many months before, but I'm sure they didn't show this behavior). >> >> Git bisect says: >> >> 72166f2f3dba18f1217c666574032f5a0351ed65 is the first bad commit >> commit 72166f2f3dba18f1217c666574032f5a0351ed65 >> Author: Martin Rudalics >> Date: Tue May 3 08:38:49 2016 +0200 >> >> Bind `widget-button-click' to mouse-1/-2 instead of down-mouse-1/-2 >> >> * lisp/wid-edit.el (widget-keymap): Bind `widget-button-click' >> to mouse-1/-2 instead of down-mouse-1/-2. Suggested by Stefan >> Monnier. (Bug#19185, Bug#20398) > > So I guess Gnus needs to do something to countermand the low-level > change, right? I experimented a bit. The problem disappears by not making widget-keymap the parent of gnus-article-mode-map but instead putting the widget bindings directly into gnus-article-mode-map, reverting the problematic bindings: diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index c103e1c..9a64102 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -4363,9 +4363,21 @@ article-verify-cancel-lock (put 'gnus-article-mode 'mode-class 'special) -(set-keymap-parent gnus-article-mode-map widget-keymap) +;; (set-keymap-parent gnus-article-mode-map widget-keymap) +(put 'widget-backward :advertised-binding [(shift tab)]) (gnus-define-keys gnus-article-mode-map + ;; Bindings from widget-keymap (but using down-mouse-{1,2} + ;; instead mouse-{1,2} to avoid bug#23571). + "\t" widget-forward + "\e\t" widget-backward + [(shift tab)] widget-backward + [backtab] widget-backward + [down-mouse-2] widget-button-click + [down-mouse-1] widget-button-click + ;; The following definition needs to avoid using escape sequences that + ;; might get converted to ^M when building loaddefs.el + [(control ?m)] widget-button-press + " " gnus-article-goto-next-page [?\S-\ ] gnus-article-goto-prev-page "\177" gnus-article-goto-prev-page I also tried keeping widget-keymap as the parent and just changing the problematic bindings: diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index c103e1c..6b25fcd 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -4366,6 +4366,13 @@ article-verify-cancel-lock (set-keymap-parent gnus-article-mode-map widget-keymap) (gnus-define-keys gnus-article-mode-map + ;; Suppress these two bindings from widget-keymap... + [mouse-2] ignore + [mouse-1] ignore + ;; ... and use down-mouse-{1,2} instead to avoid bug#23571. + [down-mouse-2] widget-button-click + [down-mouse-1] widget-button-click + " " gnus-article-goto-next-page [?\S-\ ] gnus-article-goto-prev-page "\177" gnus-article-goto-prev-page This also fixes the problem I observed with mouse-1; however, clicking on an email address with mouse-1 not only correctly opens a message buffer to compose an email to that address, but also incorrectly inserts the most recent item in the desktop clipboard (or primary selection?) at point in that buffer. In contrast, mouse-2 DTRT here. Steve Berman