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

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

bug#22947: 25.0.92; xref-find-definitions fails for Perl & etags


From: Dmitry Gutov
Subject: bug#22947: 25.0.92; xref-find-definitions fails for Perl & etags
Date: Sat, 12 Mar 2016 02:50:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0

On 03/11/2016 09:05 PM, Bob Rogers wrote:

   > The new etags builds the table without package qualifications, but
   > after "emacs -Q" and "M-x visit-tags-table", "M-." still doesn't
   > find either the parse_recipes or add_ingredient definitions.

   Probably because you were not visiting a Perl file.  Because otherwise
   it worked for me.

It works fine for me either way.

Yes, I see that now.  But shouldn't it also work from other files?

One reason why it might not work, is if the same method name is not recognized by the other file's syntax table as the symbol at point. For etags, we're basically calling (thing-at-point 'symbol). You can evaluate this form in any context, and see if it returns the method name you were trying to look up.

If not, though, you can still press `C-u M-.' and type out the name of the method to look for (or even press M-n, see the default value inserted, and edit it), and press RET.

This is not too different from the find-tag workflow.

I
find it very useful to type M-. on a Perl method name that appears in
documentation or in my notes, or to find a Perl definition mentioned in
a Javascript file comment (and vice versa).

In general, it should work. Could you describe exactly what it is you tried (which file did you open, and where did you navigate before pressing `M-.'? did you press C-u?), so that we can reproduce it?

   And many Perl programs have substantial C components.  Am I to
understand that M-. between C and Elisp no longer works for Emacs?

You can just from C to Elisp just like before. From Elisp to C - a bit tricker, since emacs-lisp-mode sets up an xref backend using find-func by default, not etags. But you can

(add-hook 'emacs-lisp-mode-hook 'xref-etags-mode)

to make it use etags as well.





reply via email to

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