GNU bug report logs - #35353
26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major mode name

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sun, 21 Apr 2019 03:07:02 UTC

Severity: minor

Found in version 26.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35353 in the body.
You can then email your comments to 35353 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Sun, 21 Apr 2019 03:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 21 Apr 2019 03:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major mode name
Date: Sat, 20 Apr 2019 19:50:38 -0700 (PDT)
Never bothered to use Xref (`dired-do-find-regexp' etc.) until now.
I'm already surprised at what I see within the first 3 minutes.

1. I use `mouse-1-click-follows-link' = nil.  (I use `mouse-2', not
   `mouse-1', to follow clicked links, buttons, etc.)  But this
   setting seems to have no effect in buffer `*xref*'.

   Except by clicking on a file line (it seems), I find it impossible
   to click `mouse-1' without having Emacs follow a link; impossible
   to set point in the buffer using `mouse-1'; no way to just click
   buffer text to select its frame.  What's that all about? 

2. I try `C-h m' or `C-h v major-mode' to find out more about what's
   going on, and I learn that the major mode is called
   `xref--xref-buffer-mode'.  Seriously?  Why?  It seems very wrong
   and unEmacsy to give a major mode an "internal" name.  Users
   examine major modes.  That's part of the usual help system for
   even casual users.

Please respect `mouse-1-click-follows-link'.  And please name the
major mode without an "internal-function" name.  Thx.


In GNU Emacs 26.2 (build 1, x86_64-w64-mingw32)
 of 2019-04-13
Repository revision: fd1b34bfba8f3f6298df47c8e10b61530426f749
Windowing system distributor `Microsoft Corp.', version 10.0.17134
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Sun, 21 Apr 2019 13:30:02 GMT) Full text and rfc822 format available.

Message #8 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Sun, 21 Apr 2019 13:27:03 +0000 (UTC)
> Please respect `mouse-1-click-follows-link'.

Please contrast what, say, `compile.el' does, which is
simple and Emacs-conventional:

 (define-key map [mouse-2]     'compile-goto-error)
 (define-key map [follow-link] 'mouse-face)

See (elisp) `Key Binding Conventions':

 Many special major modes, like Dired, Info, Compilation,
 and Occur, are designed to handle read-only text that
 contains "hyper-links".

 Such a major mode should redefine 'mouse-2' and <RET> to
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
 follow the links.  It should also set up a 'follow-link'
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 condition, so that the link obeys 'mouse-1-click-follows-link'.

 *Note Clickable Text::.  *Note Buttons::, for an easy
 method of implementing such clickable links.

Each core Emacs developer who defines a major mode with
clickable links should be familiar with and respect this
convention.

Before Emacs distributes a new library - and certainly
before it gives new commands keys that have long been
bound to other commands, especially commands Emacs still
offers - the new library should be vetted to ensure that
it doesn't disregard Emacs conventions.

We'll soon be in release 27.  This bug was introduced in
Emacs 25.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 09:25:01 GMT) Full text and rfc822 format available.

Message #11 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Drew Adams <drew.adams <at> oracle.com>, 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 12:24:11 +0300
On 21.04.2019 16:27, Drew Adams wrote:
>> Please respect `mouse-1-click-follows-link'.
> 
> Please contrast what, say, `compile.el' does, which is
> simple and Emacs-conventional:
> 
>   (define-key map [mouse-2]     'compile-goto-error)
>   (define-key map [follow-link] 'mouse-face)
> 
> See (elisp) `Key Binding Conventions':
> 
>   Many special major modes, like Dired, Info, Compilation,
>   and Occur, are designed to handle read-only text that
>   contains "hyper-links".
> 
>   Such a major mode should redefine 'mouse-2' and <RET> to
>                     ^^^^^^^^^^^^^^^^^^^^^^^^^
>   follow the links.  It should also set up a 'follow-link'
>                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   condition, so that the link obeys 'mouse-1-click-follows-link'.
> 
>   *Note Clickable Text::.  *Note Buttons::, for an easy
>   method of implementing such clickable links.
> 
> Each core Emacs developer who defines a major mode with
> clickable links should be familiar with and respect this
> convention.

Thank you for the report.

It's not hard to fix, but it seems to do that we'll have to give mouse-2 
a different binding from what it has now. Which is also a breaking 
change (in Xref).

I'd like to let someone else decide whether this is worth it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 09:43:02 GMT) Full text and rfc822 format available.

Message #14 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#35353: 26.2;
 Buffer *xref*: (1) hard-coded mouse-1, (2) major mode name
Date: Mon, 22 Apr 2019 12:42:38 +0300
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Mon, 22 Apr 2019 12:24:11 +0300
> 
> It's not hard to fix, but it seems to do that we'll have to give mouse-2 
> a different binding from what it has now. Which is also a breaking 
> change (in Xref).

I'm not sure I follow: currently, mouse-2 does "follow the link"
already, and I believe this bug report will be satisfied if we cause
mouse-1 to do the same when mouse-1-click-follows-link is in effect.
And mouse-1 is not currently bound in Xref buffers.

So how would fixing this constitute a breaking change?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 09:49:01 GMT) Full text and rfc822 format available.

Message #17 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 12:48:20 +0300
On 22.04.2019 12:42, Eli Zaretskii wrote:

> I'm not sure I follow: currently, mouse-2 does "follow the link"
> already,

It calls xref--mouse-2, see xref--button-map.

That function displays the location, but keeps the Xref window selected.

> and I believe this bug report will be satisfied if we cause
> mouse-1 to do the same when mouse-1-click-follows-link is in effect.
> And mouse-1 is not currently bound in Xref buffers.

??

It's bound to xref-goto-xref, see the same map.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 10:10:01 GMT) Full text and rfc822 format available.

Message #20 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 13:09:29 +0300
> Cc: 35353 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Mon, 22 Apr 2019 12:48:20 +0300
> 
> On 22.04.2019 12:42, Eli Zaretskii wrote:
> 
> > I'm not sure I follow: currently, mouse-2 does "follow the link"
> > already,
> 
> It calls xref--mouse-2, see xref--button-map.
> 
> That function displays the location, but keeps the Xref window selected.
> 
> > and I believe this bug report will be satisfied if we cause
> > mouse-1 to do the same when mouse-1-click-follows-link is in effect.
> > And mouse-1 is not currently bound in Xref buffers.
> 
> ??
> 
> It's bound to xref-goto-xref, see the same map.

Sorry, I just looked in the manual.

So we already support mouse-1 clicks, don't we?  Or am I again missing
something?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 10:19:02 GMT) Full text and rfc822 format available.

Message #23 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 13:18:03 +0300
On 22.04.2019 13:09, Eli Zaretskii wrote:

> So we already support mouse-1 clicks, don't we?  Or am I again missing
> something?

Yes, but apparently we don't honor mouse-1-click-follows-link.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 10:23:02 GMT) Full text and rfc822 format available.

Message #26 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 13:21:48 +0300
> Cc: 35353 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Mon, 22 Apr 2019 13:18:03 +0300
> 
> On 22.04.2019 13:09, Eli Zaretskii wrote:
> 
> > So we already support mouse-1 clicks, don't we?  Or am I again missing
> > something?
> 
> Yes, but apparently we don't honor mouse-1-click-follows-link.

FWIW, I don't see that as a serious issue in this case.  Feel free to
close as wontfix, if you want.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 10:53:01 GMT) Full text and rfc822 format available.

Message #29 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 13:52:17 +0300
On 22.04.2019 13:21, Eli Zaretskii wrote:

>>> So we already support mouse-1 clicks, don't we?  Or am I again missing
>>> something?
>>
>> Yes, but apparently we don't honor mouse-1-click-follows-link.
> 
> FWIW, I don't see that as a serious issue in this case.  Feel free to
> close as wontfix, if you want.

The fix is not hard, though. Is the variable more targeted on other use 
cases? Or is it just obscure enough for us not to bother?

The patch looks like this (to be accompanied with an appropriate renaming):

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index e5e59721eb..463f72ae6f 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -722,8 +722,9 @@ xref--next-error-function
 (defvar xref--button-map
   (let ((map (make-sparse-keymap)))
     (define-key map [(control ?m)] #'xref-goto-xref)
-    (define-key map [mouse-1] #'xref-goto-xref)
-    (define-key map [mouse-2] #'xref--mouse-2)
+    (define-key map [follow-link] 'mouse-face)
+    (define-key map [mouse-2] #'xref-goto-xref)
+    (define-key map [mouse-1] #'xref--mouse-2)
     map))

 (defun xref--mouse-2 (event)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 10:58:03 GMT) Full text and rfc822 format available.

Message #32 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 13:57:22 +0300
On 22.04.2019 13:52, Dmitry Gutov wrote:
> The patch looks like this

The downside is that the "show location but don't switch windows" action 
becomes harder to invoke: you have to mouse-1 click, wait at least 450ms 
(by default), then release.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 10:59:02 GMT) Full text and rfc822 format available.

Message #35 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 03:58:30 -0700 (PDT)
> > > I'm not sure I follow: currently, mouse-2 does "follow the link"
> > > already,
> >
> > It calls xref--mouse-2, see xref--button-map.
> > That function displays the location, but keeps the Xref window selected.
> >
> > > and I believe this bug report will be satisfied if we cause
> > > mouse-1 to do the same when mouse-1-click-follows-link is in effect.
> > > And mouse-1 is not currently bound in Xref buffers.
> >
> > ?? It's bound to xref-goto-xref, see the same map.
> 
> Sorry, I just looked in the manual.
> So we already support mouse-1 clicks, don't we?
> Or am I again missing something?

What do you mean by "support mouse-1 clicks"?
We support them following a link, but we don't
support them not following a link.

`mouse-1' clicks follow the link, regardless of
`mouse-1-click-follows-link'.  When that variable
is nil a `mouse-1' click should not follow a link.

In the nil case it should typically (default
behavior) just set point (or begin a region drag) -
`mouse-drag-region' for `down-mouse-1' and
`mouse-set-point' for `mouse-1'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 11:08:02 GMT) Full text and rfc822 format available.

Message #38 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 04:07:12 -0700 (PDT)
> >>> So we already support mouse-1 clicks, don't we?  Or am I again missing
> >>> something?
> >>
> >> Yes, but apparently we don't honor mouse-1-click-follows-link.
> >
> > FWIW, I don't see that as a serious issue in this case.  Feel free to
> > close as wontfix, if you want.
> 
> The fix is not hard, though. Is the variable more targeted on other use
> cases? Or is it just obscure enough for us not to bother?

The variable is not obscure at all.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 11:09:01 GMT) Full text and rfc822 format available.

Message #41 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 04:07:54 -0700 (PDT)
> > > So we already support mouse-1 clicks, don't we?  Or am I again missing
> > > something?
> >
> > Yes, but apparently we don't honor mouse-1-click-follows-link.
> 
> FWIW, I don't see that as a serious issue in this case.  Feel free to
> close as wontfix, if you want.

Seriously?  Mouse-2 was the original way to follow
links.  And ubiquitously in Emacs users need to be
able to set point.  They should be able to do so
using `mouse-1'.

We have `mouse-1-click-follows-link' for a reason.
Why should this be the only place (AFAIK) in Emacs
where it is not respected?  Any user who uses nil
for that option will find Xref unusable.

Not to mention that this violates the explicit Emacs
convention (cited earlier).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 11:19:02 GMT) Full text and rfc822 format available.

Message #44 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 14:18:27 +0300
> Cc: 35353 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Mon, 22 Apr 2019 13:52:17 +0300
> 
> On 22.04.2019 13:21, Eli Zaretskii wrote:
> 
> > FWIW, I don't see that as a serious issue in this case.  Feel free to
> > close as wontfix, if you want.
> 
> The fix is not hard, though. Is the variable more targeted on other use 
> cases? Or is it just obscure enough for us not to bother?
> 
> The patch looks like this (to be accompanied with an appropriate renaming):

I'm not against fixing this if the fix is easy and doesn't have
unpleasant consequences.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 11:21:02 GMT) Full text and rfc822 format available.

Message #47 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 35353 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 14:20:13 +0300
> Date: Mon, 22 Apr 2019 04:07:54 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 35353 <at> debbugs.gnu.org
> 
> > > > So we already support mouse-1 clicks, don't we?  Or am I again missing
> > > > something?
> > >
> > > Yes, but apparently we don't honor mouse-1-click-follows-link.
> > 
> > FWIW, I don't see that as a serious issue in this case.  Feel free to
> > close as wontfix, if you want.
> 
> Seriously?  Mouse-2 was the original way to follow
> links.  And ubiquitously in Emacs users need to be
> able to set point.  They should be able to do so
> using `mouse-1'.

FWIW, I see no important reasons to set point in XREF buffers by
clicking the mouse.

> Not to mention that this violates the explicit Emacs
> convention (cited earlier).

It doesn't, your citation is not necessarily relevant to the issue at
hand.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 11:31:01 GMT) Full text and rfc822 format available.

Message #50 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 14:30:37 +0300
On 22.04.2019 14:18, Eli Zaretskii wrote:

>> The patch looks like this (to be accompanied with an appropriate renaming):
> 
> I'm not against fixing this if the fix is easy and doesn't have
> unpleasant consequences.

It takes us the mouse-2 binding? But I guess we could move it to mouse-3?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 11:35:02 GMT) Full text and rfc822 format available.

Message #53 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 14:34:00 +0300
> Cc: 35353 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Mon, 22 Apr 2019 14:30:37 +0300
> 
> On 22.04.2019 14:18, Eli Zaretskii wrote:
> 
> >> The patch looks like this (to be accompanied with an appropriate renaming):
> > 
> > I'm not against fixing this if the fix is easy and doesn't have
> > unpleasant consequences.
> 
> It takes us the mouse-2 binding? But I guess we could move it to mouse-3?

To tell the truth, I fail to see how mouse-2 and mouse-1 are different
in the default configuration.  (They are bound to different commands,
but the effect is the same, AFAICT.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 11:43:02 GMT) Full text and rfc822 format available.

Message #56 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 23:42:12 +1200
On 22/04/19 10:57 PM, Dmitry Gutov wrote:
> The downside is that the "show location but don't switch windows" action
> becomes harder to invoke: you have to mouse-1 click, wait at least 450ms
> (by default), then release.

Perhaps there could be a new user option to choose which of the two
actions should be used by mouse-2 and mouse-1, and then users with
mouse-1-click-follows-link disabled could configure their preferred
action for mouse-2.

In any case, the NEWS will need to point out the change of behaviour,
so it could always suggest custom key bindings which users could employ
to get different behaviour, if that's simplest.


-Phil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 12:24:02 GMT) Full text and rfc822 format available.

Message #59 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Cc: 35353 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 05:23:17 -0700 (PDT)
> > > FWIW, I don't see that as a serious issue in this case.  Feel free to
> > > close as wontfix, if you want.
> >
> > Seriously?  Mouse-2 was the original way to follow
> > links.  And ubiquitously in Emacs users need to be
> > able to set point.  They should be able to do so
> > using `mouse-1'.
> 
> FWIW, I see no important reasons to set point in XREF buffers by
> clicking the mouse.

It's always important to be able to set point by
clicking the mouse.

That's the reason why even when `mouse-1' follows
a link we let users instead set point using `mouse-1'
by just holding it pressed longer before releasing it.

And it's the reason we have option
`mouse-1-click-follows-link': to let users not have
`mouse-1' follow links with a non-slow click.

And it's the reason the manual establishes the
convention.  As it says (quoted more extensively
earlier):

 Many special major modes, like Dired, Info, Compilation,
 and Occur, are designed to handle read-only text that
 contains "hyper-links".

It is precisely in these contexts - of which buffer
*xref* is one, that it is important to respect option
`mouse-1-click-follows-link'.

That's the point of that passage.  Users need to be
able to follow links, but they also need to be able
to set point.  How they do one or the other is
decided by their individual preference, using option
`mouse-1-click-follows-link'.

And I pointed out in the original report specifically
how the bug is a problem for users with the option nil:

It's impossible to click `mouse-1' anywhere inside the
window to select it, set point, and focus its frame
(unless you can find and click the file line preceding
a boatload of links - and that line might even be
outside the window, in which case you're completely
out of luck).

> > Not to mention that this violates the explicit Emacs
> > convention (cited earlier).
> 
> It doesn't, your citation is not necessarily relevant to the issue at
> hand.

Why do you think so?  I think it is exactly relevant -
see above.

Do you think that buffer *xref* is different in this
regard from Dired, compilation, or Occur buffers?
How so?  These are buffers that are dense with links,
making it important that users can use the mouse not
only to follow links but also to set point.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 13:06:02 GMT) Full text and rfc822 format available.

Message #62 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 35353 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 16:05:09 +0300
> Date: Mon, 22 Apr 2019 05:23:17 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: dgutov <at> yandex.ru, 35353 <at> debbugs.gnu.org
> 
> > FWIW, I see no important reasons to set point in XREF buffers by
> > clicking the mouse.
> 
> It's always important to be able to set point by
> clicking the mouse.

I disagree.  And it's easy to disagree, because you didn't provide any
rationale, none at all.

> Do you think that buffer *xref* is different in this
> regard from Dired, compilation, or Occur buffers?
> How so?  These are buffers that are dense with links,
> making it important that users can use the mouse not
> only to follow links but also to set point.

There are no links in the XREF buffer, not really.  This buffer is an
aid to select on of several possible symbols, that's all.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 13:09:02 GMT) Full text and rfc822 format available.

Message #65 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Phil Sainty <psainty <at> orcon.net.nz>, Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 06:08:16 -0700 (PDT)
> > The downside is that the "show location but don't switch windows" action
> > becomes harder to invoke: you have to mouse-1 click, wait at least 450ms
> > (by default), then release.
> 
> Perhaps there could be a new user option to choose which of the two
> actions should be used by mouse-2 and mouse-1, and then users with
> mouse-1-click-follows-link disabled could configure their preferred
> action for mouse-2.
> 
> In any case, the NEWS will need to point out the change of behaviour,
> so it could always suggest custom key bindings which users could employ
> to get different behaviour, if that's simplest.

What is the "show location but don't switch windows"
action?  Is it `xref--show-location' or some command
that invokes that function?

I don't see (in Emacs 26.2) any mouse action that
shows the location but does not switch windows.  I
see only `C-o' (`xref-show-location-at-point'),
whose name says it does that, but only for point,
not for the mouse position.  (And when I try `C-o'
it too switches to another window, the same as `RET'.)

In any case, how is Xref different from, say, Occur
wrt mouse actions and the general interaction?  What
makes it so special that it should be problematic to
fix this bug?

(Node `Xref Commands' of the Emacs manual calls the
mode "the special XREF mode".  How is it "special"?
Or is that supposed to mean only that it is a child
of `special-mode'?  If that's it then I think this
language will only confuse users, most of whom are
not aware of `special-mode', or at least not thinking
of it here.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 13:24:02 GMT) Full text and rfc822 format available.

Message #68 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Drew Adams <drew.adams <at> oracle.com>
Cc: 35353 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 06:23:23 -0700 (PDT)
> > > FWIW, I see no important reasons to set point in XREF buffers by
> > > clicking the mouse.
> >
> > It's always important to be able to set point by
> > clicking the mouse.
> 
> I disagree.  And it's easy to disagree, because you didn't provide any
> rationale, none at all.

Of course I did - more than one, and more than once now.
Click a mouse button to set point, select a window, and
focus its frame.  Is that not enough rationale for you?

I find it really hard to believe that this is not
obvious to you.

Surely you used a mouse with Emacs before we
switched the default behavior to having mouse-1,
not mouse-2, follow links?  And surely you've
accidentally clicked mouse-1 on a link (e.g. in
Dired) when all you wanted to do was select the
window?

In any case, surely you do realize or can
imagine that at least some Emacs users set
`mouse-1-click-follows-link' to nil?  Surely
you can imagine that removing the effect of
that setting for *xref* buffers could be
upsetting and surprising to them, no?

> > Do you think that buffer *xref* is different in this
> > regard from Dired, compilation, or Occur buffers?
> > How so?  These are buffers that are dense with links,
> > making it important that users can use the mouse not
> > only to follow links but also to set point.
> 
> There are no links in the XREF buffer, not really.  This buffer is an
> aid to select on of several possible symbols, that's all.

Sigh.

The "non-links" have `mouse-face'. They have a `keymap'
property that binds `mouse-1' and `mouse-2' to commands
that follow the "non-link" to its location.  They have
`:help-echo' that says "mouse-2: display in another
window, RET or mouse-1: follow reference".  When you
click them or hit RET or C-o they sure seem to follow
the "non-links".  What am I missing?

Using `A' In Dired puts me in an *xref* buffer.  Using
the "non-links" in that buffer do NOT, in any way that
I can imagine you might mean, "select on[e] of possible
symbols".

I can follow these "non-links", but I'm really having
trouble following you.  And the problem (this bug) is
that I cannot NOT follow these "non-links".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 22 Apr 2019 13:34:02 GMT) Full text and rfc822 format available.

Message #71 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 35353 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 22 Apr 2019 16:33:37 +0300
> Date: Mon, 22 Apr 2019 06:23:23 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: dgutov <at> yandex.ru, 35353 <at> debbugs.gnu.org
> 
> > > > FWIW, I see no important reasons to set point in XREF buffers by
> > > > clicking the mouse.
> > >
> > > It's always important to be able to set point by
> > > clicking the mouse.
> > 
> > I disagree.  And it's easy to disagree, because you didn't provide any
> > rationale, none at all.
> 
> Of course I did - more than one, and more than once now.
> Click a mouse button to set point, select a window, and
> focus its frame.  Is that not enough rationale for you?

No.  You are talking in general, whereas I'm talking specifically
about windows showing the XREF buffer.

> In any case, surely you do realize or can
> imagine that at least some Emacs users set
> `mouse-1-click-follows-link' to nil?  Surely
> you can imagine that removing the effect of
> that setting for *xref* buffers could be
> upsetting and surprising to them, no?

There's plenty of spaces where mouse-1 does nothing like
mouse-1-click-follows-link suggests.  This is one of them.

Mind you, I don't object to making XREF behave similarly, I just don't
think it's terribly important.  As I already said too many times.  I
really hope you finally decide to agree to disagree.

> The "non-links" have `mouse-face'. They have a `keymap'
> property that binds `mouse-1' and `mouse-2' to commands
> that follow the "non-link" to its location.  They have
> `:help-echo' that says "mouse-2: display in another
> window, RET or mouse-1: follow reference".  When you
> click them or hit RET or C-o they sure seem to follow
> the "non-links".  What am I missing?
> 
> Using `A' In Dired puts me in an *xref* buffer.  Using
> the "non-links" in that buffer do NOT, in any way that
> I can imagine you might mean, "select on[e] of possible
> symbols".
> 
> I can follow these "non-links", but I'm really having
> trouble following you.  And the problem (this bug) is
> that I cannot NOT follow these "non-links".

Of course you can follow them: mouse-1 already follows them (as does
mouse-2).  We are not talking about following them, we are talking
about something else.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Thu, 02 May 2019 22:36:02 GMT) Full text and rfc822 format available.

Message #74 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Drew Adams <drew.adams <at> oracle.com>, Phil Sainty <psainty <at> orcon.net.nz>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Fri, 3 May 2019 01:35:10 +0300
On 22.04.2019 16:08, Drew Adams wrote:
> What is the "show location but don't switch windows"
> action?  Is it `xref--show-location' or some command
> that invokes that function?

Have you heard of 'C-h k'? It's handy.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Thu, 02 May 2019 22:49:02 GMT) Full text and rfc822 format available.

Message #77 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Drew Adams <drew.adams <at> oracle.com>, Phil Sainty <psainty <at> orcon.net.nz>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Fri, 3 May 2019 01:48:30 +0300
On 22.04.2019 16:08, Drew Adams wrote:
> I
> see only `C-o' (`xref-show-location-at-point'),
> whose name says it does that, but only for point,
> not for the mouse position.  (And when I try `C-o'
> it too switches to another window, the same as `RET'.)

It doesn't do that over here.

> In any case, how is Xref different from, say, Occur
> wrt mouse actions and the general interaction?  What
> makes it so special that it should be problematic to
> fix this bug?

Honestly, it's quite easy. I'm pasting the code patch below.

Would you write the NEWS entry for it? And any necessary manual changes 
would be nice as well.

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index c7f015b94f..6dcdd75c84 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -722,8 +722,9 @@ xref--next-error-function
 (defvar xref--button-map
   (let ((map (make-sparse-keymap)))
     (define-key map [(control ?m)] #'xref-goto-xref)
-    (define-key map [mouse-1] #'xref-goto-xref)
-    (define-key map [mouse-2] #'xref--mouse-2)
+    (define-key map [follow-link] 'mouse-face)
+    (define-key map [mouse-2] #'xref-goto-xref)
+    (define-key map [mouse-3] #'xref--mouse-3)
     map))

 (defun xref--mouse-2 (event)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Thu, 02 May 2019 22:50:01 GMT) Full text and rfc822 format available.

Message #80 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Fri, 3 May 2019 01:49:31 +0300
On 22.04.2019 14:34, Eli Zaretskii wrote:
> To tell the truth, I fail to see how mouse-2 and mouse-1 are different
> in the default configuration.  (They are bound to different commands,
> but the effect is the same, AFAICT.)

The difference is in which window ends up being selected. Maybe it's not 
hugely important, though (I don't remember the last time I used mouse-2 
for this purpose).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Thu, 02 May 2019 23:23:01 GMT) Full text and rfc822 format available.

Message #83 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Phil Sainty <psainty <at> orcon.net.nz>
Cc: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Thu, 2 May 2019 16:22:31 -0700 (PDT)
> > I see only `C-o' (`xref-show-location-at-point'),
> > whose name says it does that, but only for point,
> > not for the mouse position.  (And when I try `C-o'
> > it too switches to another window, the same as `RET'.)
> 
> It doesn't do that over here.

Over here meaning what?  Which sentence are you
referencing: mouse position or window switching?

Do you have non-nil `pop-up-frames'?  Are buffers
named `*...*' special-display buffers for you?

Yes, I was describing what I see in my setup,
which has those things.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Thu, 02 May 2019 23:23:02 GMT) Full text and rfc822 format available.

Message #86 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Phil Sainty <psainty <at> orcon.net.nz>
Cc: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Thu, 2 May 2019 16:22:30 -0700 (PDT)
> > What is the "show location but don't switch windows"
> > action?
> 
> Have you heard of 'C-h k'? It's handy.

How does that answer the question?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Thu, 02 May 2019 23:32:02 GMT) Full text and rfc822 format available.

Message #89 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Drew Adams <drew.adams <at> oracle.com>, Phil Sainty <psainty <at> orcon.net.nz>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Fri, 3 May 2019 02:31:23 +0300
On 03.05.2019 2:22, Drew Adams wrote:
>>> What is the "show location but don't switch windows"
>>> action?
>>
>> Have you heard of 'C-h k'? It's handy.
> 
> How does that answer the question?

By helping you to find out the answer for yourself.

Because I have already explained what it does the best I could.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Thu, 02 May 2019 23:35:04 GMT) Full text and rfc822 format available.

Message #92 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Drew Adams <drew.adams <at> oracle.com>, Phil Sainty <psainty <at> orcon.net.nz>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Fri, 3 May 2019 02:34:48 +0300
On 03.05.2019 2:22, Drew Adams wrote:

>> It doesn't do that over here.
> 
> Over here meaning what?  Which sentence are you
> referencing: mouse position or window switching?

Doesn't switch to another window.

> Do you have non-nil `pop-up-frames'?

Nope, but that doesn't seem to affect the non-window-switching.

> Are buffers
> named `*...*' special-display buffers for you?

No idea what that means.

> Yes, I was describing what I see in my setup,
> which has those things.

And I'm describing 'emacs -Q'. If you see some details in the 
implementation that could work more reliably (e.g. with your 
configuration as well), please go ahead and point them out.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Fri, 03 May 2019 00:28:01 GMT) Full text and rfc822 format available.

Message #95 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Phil Sainty <psainty <at> orcon.net.nz>
Cc: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Thu, 2 May 2019 17:27:11 -0700 (PDT)
> >>> What is the "show location but don't switch windows"
> >>> action?
> >>
> >> Have you heard of 'C-h k'? It's handy.
> >
> > How does that answer the question?
> 
> By helping you to find out the answer for yourself.

No idea for what key you're suggesting `C-h k' will
tell me what you mean by the "show location but
don't switch windows" action.  Care to share?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Fri, 03 May 2019 00:28:02 GMT) Full text and rfc822 format available.

Message #98 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Phil Sainty <psainty <at> orcon.net.nz>
Cc: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Thu, 2 May 2019 17:27:14 -0700 (PDT)
> >> It doesn't do that over here.
> >
> > Over here meaning what?  Which sentence are you
> > referencing: mouse position or window switching?
> 
> Doesn't switch to another window.
> 
> > Do you have non-nil `pop-up-frames'?
> 
> Nope, but that doesn't seem to affect the non-window-switching.
> 
> > Are buffers named `*...*' special-display buffers for you?
>
> No idea what that means.

Customize option `special-display-regexps' to
`("[ ]?[*][^*]+[*]")', for example.

> > Yes, I was describing what I see in my setup,
> > which has those things.
> 
> And I'm describing 'emacs -Q'.

I just reported the bug.  If you want to fix it, fine.
If not, OK.  I'm not a user of xref, so far.  I simply
tried it and immediately fell upon the problem reported.

I have nil `mouse-1-click-follows-link', non-nil
`pop-up-frames', and `("[ ]?[*][^*]+[*]")' for
`special-display-regexps' (which affects a buffer named
`*xref*').

If the bug report helps, great.  If you apply the fix
I suggested (from the manual, about Emacs conventions,
and shown as example for `compile.el'), fine.  If you
apply some other fix, fine.  If you leave it as is, too
bad for some xref users, probably.  Or maybe someone
else will fix it later.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Fri, 03 May 2019 06:40:02 GMT) Full text and rfc822 format available.

Message #101 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Fri, 03 May 2019 09:38:53 +0300
> Cc: 35353 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Fri, 3 May 2019 01:49:31 +0300
> 
> On 22.04.2019 14:34, Eli Zaretskii wrote:
> > To tell the truth, I fail to see how mouse-2 and mouse-1 are different
> > in the default configuration.  (They are bound to different commands,
> > but the effect is the same, AFAICT.)
> 
> The difference is in which window ends up being selected.

Oh, you mean one of them also selects the XREF buffer's window.  Yes,
I see it now, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Sat, 04 May 2019 21:22:02 GMT) Full text and rfc822 format available.

Message #104 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: psainty <at> orcon.net.nz, 35353 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#35353: 26.2;
 Buffer *xref*: (1) hard-coded mouse-1, (2) major mode name
Date: Sat, 04 May 2019 17:21:23 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Have you heard of 'C-h k'? It's handy.

  > How does that answer the question?

You type C-h k and then generate some event, and it shows what command
that event will run.  That might enable you to find the answer
to your question:

  > > > What is the "show location but don't switch windows"
  > > > action?

So the answer was helpful, or at least had a good chance of being
helpful.  But the way it was written,

  > > Have you heard of 'C-h k'? It's handy.

is not very helpful, because it made you figure out, or guess,
how it related to your question.  It was teasing.

It is kinder to answer in a way that shows explicitly how the
answer relates to the question.  For instance, 

  C-h k followed by generating the event should tell  you
  what command it runs.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Sat, 04 May 2019 22:26:01 GMT) Full text and rfc822 format available.

Message #107 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: rms <at> gnu.org
Cc: psainty <at> orcon.net.nz, 35353 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Sat, 4 May 2019 15:25:41 -0700 (PDT)
>   > > Have you heard of 'C-h k'? It's handy.
>   > How does that answer the question?
> 
> You type C-h k and then generate some event, and it shows what command
> that event will run.  That might enable you to find the answer
> to your question:
>   > > > What is the "show location but don't switch windows"
>   > > > action?
> 
> So the answer was helpful, or at least had a good chance of being
> helpful.

No, it didn't help at all.  I had no idea what
action the description "show location but don't
switch windows" was meant to indicate.

And no particular key was mentioned, so I had
no idea how `C-h k' could possibly have helped.
And none of the keys mentioned exhibited any "show
location but don't switch windows" behavior.

(And yes, I am aware of `C-h k'.)

> But the way it was written,
>   > > Have you heard of 'C-h k'? It's handy.
> is not very helpful, because it made you figure out, or guess,
> how it related to your question.  It was teasing.

It was just a snide remark, not helpful at all.
 
> It is kinder to answer in a way that shows explicitly how the
> answer relates to the question.  For instance,
>   C-h k followed by generating the event should tell  you
>   what command it runs.

No such event/key was ever identified, so
`C-h k' really did not help here in any way.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Sun, 05 May 2019 22:52:01 GMT) Full text and rfc822 format available.

Message #110 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: psainty <at> orcon.net.nz, 35353 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Sun, 05 May 2019 18:50:52 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > No such event/key was ever identified, so
  > `C-h k' really did not help here in any way.

If it doesn't tell you a command name, perhaps this case is a deficiency
in C-h k itself.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 06 May 2019 00:42:02 GMT) Full text and rfc822 format available.

Message #113 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: rms <at> gnu.org
Cc: psainty <at> orcon.net.nz, 35353 <at> debbugs.gnu.org, dgutov <at> yandex.ru
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Sun, 5 May 2019 17:40:55 -0700 (PDT)
> > No such event/key was ever identified, so
> > `C-h k' really did not help here in any way.
> 
> If it doesn't tell you a command name, perhaps
> this case is a deficiency in C-h k itself.

You are misunderstanding, I think.  Please look at
the bug thread if you are really interested.

It was Dmitry (not `C-h k') who never identified
the key for which to use `C-h k'.  He never
identified the command either.  No idea what he
was (not) talking about.

The only thing he did was refer to an unidentified
"show location but don't switch windows" behavior.
When I asked what he meant by that he just asked me
sarcastically if I've heard of `C-h k'.  Not helpful.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 06 May 2019 08:46:01 GMT) Full text and rfc822 format available.

Message #116 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Drew Adams <drew.adams <at> oracle.com>, rms <at> gnu.org
Cc: psainty <at> orcon.net.nz, 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 6 May 2019 11:45:13 +0300
On 06.05.2019 3:40, Drew Adams wrote:
> It was Dmitry (not `C-h k') who never identified
> the key for which to use `C-h k'.  He never
> identified the command either.

If that really was the issue: the "show location but don't switch 
windows" command is xref--mouse-2, currently bound to mouse-2.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Mon, 06 May 2019 13:30:02 GMT) Full text and rfc822 format available.

Message #119 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>, rms <at> gnu.org
Cc: psainty <at> orcon.net.nz, 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Mon, 6 May 2019 06:29:21 -0700 (PDT)
> > It was Dmitry (not `C-h k') who never identified
> > the key for which to use `C-h k'.  He never
> > identified the command either.
> 
> If that really was the issue: the "show location but don't switch
> windows" command is xref--mouse-2, currently bound to mouse-2.

Thank you.  That was the question about your "show
location but don't switch windows".  (It was not
the issue reported in the bug report, however.)

But as I mentioned, with the settings I cited
there is no difference in behavior between mouse-1
and mouse-2.  Each shows the target in the other
window, without selecting that window.

And unfortunately the window the target is shown
in is the window the Dired buffer was in - the
Dired buffer is replaced there (not a good thing,
IMO).

Anyway, I've already said all that.  But thanks
for clearing up what you meant by the "show
location but don't switch windows" command.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Sat, 22 Aug 2020 14:42:02 GMT) Full text and rfc822 format available.

Message #122 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2)
 major mode name
Date: Sat, 22 Aug 2020 16:41:18 +0200
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> The fix is not hard, though. Is the variable more targeted on other
> use cases? Or is it just obscure enough for us not to bother?
>
> The patch looks like this (to be accompanied with an appropriate renaming):

[...]

> -    (define-key map [mouse-1] #'xref-goto-xref)
> -    (define-key map [mouse-2] #'xref--mouse-2)
> +    (define-key map [follow-link] 'mouse-face)
> +    (define-key map [mouse-2] #'xref-goto-xref)
> +    (define-key map [mouse-1] #'xref--mouse-2)

I think that this is basically what most modes that have clickable stuff
do, so I think it might be the right solution for xref, too (even if
xref doesn't have buttons per se).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Sat, 22 Aug 2020 17:47:02 GMT) Full text and rfc822 format available.

Message #125 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35353 <at> debbugs.gnu.org
Subject: RE: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2) major
 mode name
Date: Sat, 22 Aug 2020 10:46:12 -0700 (PDT)
> > -    (define-key map [mouse-1] #'xref-goto-xref)
> > -    (define-key map [mouse-2] #'xref--mouse-2)
> > +    (define-key map [follow-link] 'mouse-face)
> > +    (define-key map [mouse-2] #'xref-goto-xref)
> > +    (define-key map [mouse-1] #'xref--mouse-2)
> 
> I think that this is basically what most modes that have clickable stuff
> do, so I think it might be the right solution for xref, too (even if
> xref doesn't have buttons per se).

IOW, your conclusion is "Won't fix".

That is not what most modes that have links do.

Most such modes have `down-mouse-1' do
`mouse-drag-region' and `mouse-1' do `mouse-set-point'.

For users who want `mouse-1' to follow a link, it
is option `mouse-1-click-follows-link' that takes
care of that.  And even when that is non-nil, a
user can set point with `mouse-1', by simply holding
`mouse-1' pressed more than 450 milliseconds.

That's the behavior that's requested here - the USUAL
Emacs behavior for `mouse-1' on links.  Nothing more.

This is nothing new, nothing unusual.  What's unusual
is the xref behavior.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Fri, 29 Apr 2022 12:02:01 GMT) Full text and rfc822 format available.

Message #128 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 35353 <at> debbugs.gnu.org
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2)
 major mode name
Date: Fri, 29 Apr 2022 14:01:06 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> 1. I use `mouse-1-click-follows-link' = nil.  (I use `mouse-2', not
>    `mouse-1', to follow clicked links, buttons, etc.)  But this
>    setting seems to have no effect in buffer `*xref*'.
>
>    Except by clicking on a file line (it seems), I find it impossible
>    to click `mouse-1' without having Emacs follow a link; impossible
>    to set point in the buffer using `mouse-1'; no way to just click
>    buffer text to select its frame.  What's that all about? 

I've now fixed this in Emacs 29.

> 2. I try `C-h m' or `C-h v major-mode' to find out more about what's
>    going on, and I learn that the major mode is called
>    `xref--xref-buffer-mode'.  Seriously?  Why?  It seems very wrong
>    and unEmacsy to give a major mode an "internal" name.  Users
>    examine major modes.  That's part of the usual help system for
>    even casual users.

That is pretty unusual naming for a major mode, but I don't think it's
worth changing at this point.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 35353 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 29 Apr 2022 12:02:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35353; Package emacs. (Fri, 29 Apr 2022 17:23:02 GMT) Full text and rfc822 format available.

Message #133 received at 35353 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 35353 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#35353: 26.2; Buffer *xref*: (1) hard-coded mouse-1, (2)
 major mode name
Date: Fri, 29 Apr 2022 20:13:24 +0300
>> 1. I use `mouse-1-click-follows-link' = nil.  (I use `mouse-2', not
>>    `mouse-1', to follow clicked links, buttons, etc.)  But this
>>    setting seems to have no effect in buffer `*xref*'.
>>
>>    Except by clicking on a file line (it seems), I find it impossible
>>    to click `mouse-1' without having Emacs follow a link; impossible
>>    to set point in the buffer using `mouse-1'; no way to just click
>>    buffer text to select its frame.  What's that all about? 
>
> I've now fixed this in Emacs 29.

It seems this is unnecessary:

    (when mouse-1-click-follows-link
      (define-key map [mouse-1] #'xref-goto-xref))

because `[follow-link]' takes care about handling `mouse-1-click-follows-link'.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 28 May 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 17 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.