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

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

bug#50067: Context menus


From: Dmitry Gutov
Subject: bug#50067: Context menus
Date: Sat, 21 Aug 2021 02:31:53 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

Hi Mattias!

On 20.08.2021 20:06, Mattias Engdegård wrote:
* If I start emacs -Q and enable context-menu-mode, right-clicking on an 
identifier in an elisp buffer still doesn't produce the Find Definition entry, 
presumably because xref hasn't been loaded. Shouldn't it be arranged to be 
autoloaded somehow, which is how xref works when invoked by keystrokes?

I wonder what could be the reason for that. It would seem the menu should handle autoloaded commands fine. Even the visibility predicate should work: xref-find-backend is autoloaded as well.

Try rewriting it with a let, to ensure that xref-find-backend is called first:

(let ((backend (xref-find-backend)))
  (xref-backend-identifier-at-point backend))

* `xref-make-match` requires (contrary to its doc string) its LOCATION argument 
to be of type `xref-file-location`, but some backends may only be able to make 
an `xref-buffer-location`. Would anyone object to changing the :location slot 
of `xref-match-item` to have type `xref-location`? I don't see how it could 
hurt.

Makes sense to me, seems like an accident. I've done this change locally, no obvious bugs fell out.





reply via email to

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