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: Wed, 1 Sep 2021 22:03:13 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 01.09.2021 10:08, Juri Linkov wrote:
BTW, I'm testing compilation errors/warnings on xref context menu,
and it reposts this warning:

   prog-mode.el:60:12: Warning: the function `xref-backend-identifier-at-point'
       is not known to be defined.

on this code:

   (defun prog-context-menu (menu)
     (require 'xref)
     (define-key-after menu [prog-separator] menu-bar-separator
       'mark-whole-buffer)
     (when (save-excursion
             (mouse-set-point last-input-event)
             (xref-backend-identifier-at-point
              (xref-find-backend)))
       (define-key-after menu [xref-find-def]
         '(menu-item "Find Definition" xref-find-definitions-at-mouse
                     :help "Find definition of identifier")
         'prog-separator))

Maybe `xref-backend-identifier-at-point' should be autoloaded?

I don't know. What are the rules?

There is no risk to call it before xref.el is loaded because xref-find-backend itself is autoloaded.

But the lack of autoloading can cause byte-compilation warnings. They can be dealt with by other means too, though.





reply via email to

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