emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 128ed5c9f17: Add one more mouse-set-point call to functions x


From: Po Lu
Subject: Re: master 128ed5c9f17: Add one more mouse-set-point call to functions xref-find-*-at-mouse
Date: Thu, 31 Aug 2023 08:43:04 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Dmitry Gutov <dgutov@yandex.ru> writes:

> branch: master
> commit 128ed5c9f17fab87fdb679326035aa2598612658
> Author: Dmitry Gutov <dmitry@gutov.dev>
> Commit: Dmitry Gutov <dmitry@gutov.dev>
>
>     Add one more mouse-set-point call to functions xref-find-*-at-mouse
>     
>     * lisp/progmodes/xref.el (xref-find-definitions-at-mouse)
>     (xref-find-references-at-mouse): Call mouse-set-point to ensure
>     that the search is initiated at the same place where
>     xref-backend-identifier-at-point was called (bug#65578).
> ---
>  lisp/progmodes/xref.el | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
> index 3f75f8d7132..dbafa00c3ad 100644
> --- a/lisp/progmodes/xref.el
> +++ b/lisp/progmodes/xref.el
> @@ -1638,7 +1638,9 @@ This command is intended to be bound to a mouse event."
>             (mouse-set-point event)
>             (xref-backend-identifier-at-point (xref-find-backend)))))
>      (if identifier
> -        (xref-find-definitions identifier)
> +        (progn
> +          (mouse-set-point event)
> +          (xref-find-definitions identifier))
>        (user-error "No identifier here"))))
>  
>  ;;;###autoload
> @@ -1652,6 +1654,7 @@ This command is intended to be bound to a mouse event."
>             (xref-backend-identifier-at-point (xref-find-backend)))))
>      (if identifier
>          (let ((xref-prompt-for-identifier nil))
> +          (mouse-set-point event)
>            (xref-find-references identifier))
>        (user-error "No identifier here"))))
>  

My experience with the entire touch screen affair says that many such
errors would never have been written had `xref-find-definitions' taken
an EVENT argument and used its posn-point if present.  Something to
consider, I suppose.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]