From: Po Lu <luangruo@yahoo.com>
To: emacs-devel@gnu.org
Cc: Dmitry Gutov <dmitry@gutov.dev>
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 [thread overview]
Message-ID: <87il8wt52f.fsf@yahoo.com> (raw)
In-Reply-To: <20230831002506.C0C6DC038B5@vcs2.savannah.gnu.org> (Dmitry Gutov's message of "Wed, 30 Aug 2023 20:25:06 -0400 (EDT)")
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.
next parent reply other threads:[~2023-08-31 0:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <169344150641.11482.13012085201452768898@vcs2.savannah.gnu.org>
[not found] ` <20230831002506.C0C6DC038B5@vcs2.savannah.gnu.org>
2023-08-31 0:43 ` Po Lu [this message]
2023-08-31 0:54 ` master 128ed5c9f17: Add one more mouse-set-point call to functions xref-find-*-at-mouse Dmitry Gutov
2023-08-31 1:10 ` Po Lu
2023-08-31 2:05 ` Dmitry Gutov
2023-08-31 2:51 ` Po Lu
2023-08-31 6:37 ` Juri Linkov
2023-09-01 0:59 ` Po Lu
2023-09-01 6:50 ` Juri Linkov
2023-09-03 17:34 ` Juri Linkov
2023-09-04 16:42 ` Juri Linkov
2023-08-31 11:03 ` Dmitry Gutov
2023-08-31 11:35 ` Po Lu
2023-08-31 16:38 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87il8wt52f.fsf@yahoo.com \
--to=luangruo@yahoo.com \
--cc=dmitry@gutov.dev \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).