emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#71435: closed (interactive xref-find-definitions-at-mouse)


From: GNU bug Tracking System
Subject: bug#71435: closed (interactive xref-find-definitions-at-mouse)
Date: Mon, 10 Jun 2024 19:41:02 +0000

Your message dated Mon, 10 Jun 2024 11:59:05 -0700
with message-id 
<CADwFkm=G7arLoPzefLZ=L_RpjHe_4i=XgOuSX4xeXdfx34rqCw@mail.gmail.com>
and subject line Re: bug#71435: interactive xref-find-definitions-at-mouse
has caused the debbugs.gnu.org bug report #71435,
regarding interactive xref-find-definitions-at-mouse
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
71435: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71435
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: interactive xref-find-definitions-at-mouse Date: Sat, 8 Jun 2024 11:28:34 -0400
Many editors allow a mouse-click operation on an identifier, plus a suitable modifier key, to jump to the declaration of the symbol. Emacs provides xref-find-definitions-at-mouse, but I couldn't find a way to make it work in response to a click. So I wrote this variant that works nicely for me. Notably, it is an (interactive) command, and it doesn't use save-excursion.

(defun xref-find-definitions-at-mouse-2 (event)
  "Find the definition of identifier at or around mouse click.
This command is intended to be bound to a mouse event."
  (interactive "e")
  (let ((identifier
          (progn
           (mouse-set-point event)
           (xref-backend-identifier-at-point (xref-find-backend)))))
    (if identifier
       (xref-find-definitions identifier)
      (user-error "No identifier here"))))

;; cmd-click -> jump to definition
(global-set-key (kbd "s-<mouse-1>") #'xref-find-definitions-at-mouse-2)

Could this functionality (not necessarily this code) be added to Emacs's xref package? I am not enough of an Emacs expert to know whether I was simply "holding it wrong", so perhaps this is merely a documentation problem.

thanks
alan

--- End Message ---
--- Begin Message --- Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse Date: Mon, 10 Jun 2024 11:59:05 -0700
Alan Donovan <adonovan@google.com> writes:

> On Mon, 10 Jun 2024 at 13:43, Philip Kaludercic <philipk@posteo.net> wrote:
>
>> Given that I have a working Go setup installed, I tried this out: With
>> Emacs 30 on GNU/Linux fmt and Println both jump to the correct location.
>>
>> The most recent commit might have fixed the issue you are having:
>
> I applied that neat little patch, and it fixed it. Many thanks, and sorry
> to take your time.

Thanks for testing.

I'm consequently closing this bug report.


--- End Message ---

reply via email to

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