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: Bob Rogers
Subject: bug#22947: 25.0.92; xref-find-definitions fails for Perl & etags
Date: Tue, 8 Mar 2016 13:27:30 -0500

   1.  In a top-level directory with Perl modules ("*.pm") underneath,
create an etags file that indexes the modules, e.g.

        find . -type f -name '*.pm' | etags -

   2.  Invoke "emacs -Q" in this directory.

   3.  "M-x visit-tags-table RET RET"

   4.  "M-. perl_method_name RET" where "perl_method_name" is known to
be defined.

The bug is that, no matter how many perl_method_name definitions exist
in the TAGS file, xref-find-definitions won't find any of them, because
it's only looking for an exact match to what Perl considers the
package-qualified name, namely the "Perl::Package::perl_method_name" as
it appears in this TAGS line:

        sub perl_method_name ^?Perl::Package::perl_method_name^A23,321

FWIW, the patch I have included below "================" papers over the
problem (though it's clearly much too kludgy to apply).

Note that this has also been failing in master for some time now; sorry
I didn't report it sooner.

                                        -- Bob Rogers
                                           http://www.rgrjr.com/

------------------------------------------------------------------------
Configured using:
 'configure --with-pop --without-dbus --prefix=/usr
 --infodir=/usr/share/info --mandir=/usr/share/man
 --sharedstatedir=/var/lib --libexecdir=/usr/lib --with-x --with-xpm=no
 --with-jpeg --with-tiff --with-gif=no --with-png --with-x-toolkit=yes
 --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib64 --build
 x86_64-suse-linux 'CFLAGS=-g -O2 -fno-optimize-sibling-calls'
 LDFLAGS=-s'

Configured features:
JPEG TIFF PNG RSVG SOUND GSETTINGS NOTIFY FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

================

diff -u --label /usr/share/emacs/25.0.92/lisp/progmodes/etags.el.gz --label 
\#\<buffer\ etags.el.gz\> /tmp/rogers/jka-com1969tT2 
/tmp/rogers/buffer-content-1969snL
--- /usr/share/emacs/25.0.92/lisp/progmodes/etags.el.gz
+++ #<buffer etags.el.gz>
@@ -1617,7 +1617,11 @@
   (or (and (eq (char-after (point)) ?\001)
           (eq (char-after (- (point) (length tag) 1)) ?\177))
       ;; We are not on the explicit tag name, but perhaps it follows.
-      (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001"))))
+      (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001"))
+      ;; This works for perl.  -- rgr, 8-Mar-16.
+      (save-excursion
+       (skip-chars-backward "^:\n")
+       (looking-at (concat (regexp-quote tag) "\001")))))
 
 ;; t if point is at a tag line that has an implicit name.
 ;; point should be just after a string that matches TAG.





reply via email to

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