all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
       [not found] ` <20220429120137.0F053C06322@vcs2.savannah.gnu.org>
@ 2022-04-29 13:00   ` Stefan Monnier
  2022-04-29 13:16     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2022-04-29 13:00 UTC (permalink / raw)
  To: emacs-devel; +Cc: Lars Ingebrigtsen

> @@ -965,7 +965,9 @@ beginning of the line."
>  
>  (defvar xref--button-map
>    (let ((map (make-sparse-keymap)))
> -    (define-key map [mouse-1] #'xref-goto-xref)
> +    (when mouse-1-click-follows-link
> +      (define-key map [mouse-1] #'xref-goto-xref))
> +    (define-key map [follow-link] 'mouse-face)
>      (define-key map [mouse-2] #'xref-select-and-show-xref)
>      map))

Hmm... this won't adjust if `mouse-1-click-follows-link` is changed
later on.  Why do we need this `mouse-1` binding?


        Stefan




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
  2022-04-29 13:00   ` master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links Stefan Monnier
@ 2022-04-29 13:16     ` Lars Ingebrigtsen
  2022-04-29 15:34       ` [External] : " Drew Adams
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-29 13:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Hmm... this won't adjust if `mouse-1-click-follows-link` is changed
> later on.  Why do we need this `mouse-1` binding?

Dmitry seems to like the two different actions (which only differ in
whether the other buffer is selected or not).  I'd be fine with removing
the mouse-1 binding.

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [External] : Re: master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
  2022-04-29 13:16     ` Lars Ingebrigtsen
@ 2022-04-29 15:34       ` Drew Adams
  2022-04-29 16:16       ` Dmitry Gutov
  2022-04-29 17:17       ` Stefan Monnier
  2 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2022-04-29 15:34 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Stefan Monnier; +Cc: emacs-devel@gnu.org

> > Hmm... this won't adjust if `mouse-1-click-follows-link` is changed
> > later on.  Why do we need this `mouse-1` binding?
> 
> Dmitry seems to like the two different actions (which only differ in
> whether the other buffer is selected or not).  I'd be fine with
> removing the mouse-1 binding.

Bug #35353:

 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?

For which you've said:

 Lars>> we don't honor mouse-1-click-follows-link.
 Eli> FWIW, I don't see that as a serious issue in
      this case.  Feel free to close as wontfix,
      if you want.

But you said today that you fixed (this part of)
the reported bug, for Emacs 29.  I hope so.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
  2022-04-29 13:16     ` Lars Ingebrigtsen
  2022-04-29 15:34       ` [External] : " Drew Adams
@ 2022-04-29 16:16       ` Dmitry Gutov
  2022-04-30 11:39         ` Lars Ingebrigtsen
  2022-04-29 17:17       ` Stefan Monnier
  2 siblings, 1 reply; 8+ messages in thread
From: Dmitry Gutov @ 2022-04-29 16:16 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Stefan Monnier; +Cc: emacs-devel

On 29.04.2022 16:16, Lars Ingebrigtsen wrote:
> Stefan Monnier<monnier@iro.umontreal.ca>  writes:
> 
>> Hmm... this won't adjust if `mouse-1-click-follows-link` is changed
>> later on.  Why do we need this `mouse-1` binding?
> Dmitry seems to like the two different actions (which only differ in
> whether the other buffer is selected or not).  I'd be fine with removing
> the mouse-1 binding.

TBH, I don't really mind either way. I don't use the mouse in these 
buffers (and rarely do that at all in Emacs).

I proposed a slightly different change in the past 
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35353#77), but if other 
similar modes (like Grep and Occur) behave differently and consistently 
between themselves, it probably makes sense to follow their example.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
  2022-04-29 13:16     ` Lars Ingebrigtsen
  2022-04-29 15:34       ` [External] : " Drew Adams
  2022-04-29 16:16       ` Dmitry Gutov
@ 2022-04-29 17:17       ` Stefan Monnier
  2 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2022-04-29 17:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

Lars Ingebrigtsen [2022-04-29 15:16:07] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> Hmm... this won't adjust if `mouse-1-click-follows-link` is changed
>> later on.  Why do we need this `mouse-1` binding?
> Dmitry seems to like the two different actions (which only differ in
> whether the other buffer is selected or not).  I'd be fine with removing
> the mouse-1 binding.

I think the benefit of using the "standard" behavior (i.e. only have
a mouse-2 binding and rely on `mouse-1-click-follows-link` to make it
available on `mouse-1`) outweighs the benefit of choosing between those
two slightly different behaviors by opting for one binding or the other.


        Stefan




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
  2022-04-29 16:16       ` Dmitry Gutov
@ 2022-04-30 11:39         ` Lars Ingebrigtsen
  2022-05-01 12:14           ` Dmitry Gutov
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-30 11:39 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Stefan Monnier, emacs-devel

Dmitry Gutov <dgutov@yandex.ru> writes:

>> Dmitry seems to like the two different actions (which only differ in
>> whether the other buffer is selected or not).  I'd be fine with removing
>> the mouse-1 binding.
>
> TBH, I don't really mind either way. I don't use the mouse in these
> buffers (and rarely do that at all in Emacs).
>
> I proposed a slightly different change in the past
> (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35353#77), but if other
> similar modes (like Grep and Occur) behave differently and
> consistently between themselves, it probably makes sense to follow
> their example.

So I've now removed the mouse-1 binding to make this map work like most
other buttons.  (I have no opinion as to whether to keep xref-goto-xref
or xref-select-and-show-xref as the binding, so I kept the mouse-2
binding.)

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
  2022-04-30 11:39         ` Lars Ingebrigtsen
@ 2022-05-01 12:14           ` Dmitry Gutov
  2022-05-02  8:02             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Gutov @ 2022-05-01 12:14 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Stefan Monnier, emacs-devel

On 30.04.2022 14:39, Lars Ingebrigtsen wrote:
> (I have no opinion as to whether to keep xref-goto-xref
> or xref-select-and-show-xref as the binding, so I kept the mouse-2
> binding.)

If our goal is consistency with Grep, I suppose we should pick the 
command that's more similar to its behavior as well?

AFAICS mouse click in Grep selects the location's window in the end. 
That's the behavior of 'xref-goto-xref'.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links
  2022-05-01 12:14           ` Dmitry Gutov
@ 2022-05-02  8:02             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-02  8:02 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Stefan Monnier, emacs-devel

Dmitry Gutov <dgutov@yandex.ru> writes:

> If our goal is consistency with Grep, I suppose we should pick the
> command that's more similar to its behavior as well?
>
> AFAICS mouse click in Grep selects the location's window in the
> end. That's the behavior of 'xref-goto-xref'.

It makes sense to be consistent here, so I've switched the xref mouse
action to xref-goto-xref, then.

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-02  8:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <165123369667.6415.4605821518748112960@vcs2.savannah.gnu.org>
     [not found] ` <20220429120137.0F053C06322@vcs2.savannah.gnu.org>
2022-04-29 13:00   ` master 1b71c995da: Avoid binding mouse-1 in xref when mouse-1 doesn't follow links Stefan Monnier
2022-04-29 13:16     ` Lars Ingebrigtsen
2022-04-29 15:34       ` [External] : " Drew Adams
2022-04-29 16:16       ` Dmitry Gutov
2022-04-30 11:39         ` Lars Ingebrigtsen
2022-05-01 12:14           ` Dmitry Gutov
2022-05-02  8:02             ` Lars Ingebrigtsen
2022-04-29 17:17       ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.