GNU bug report logs - #78489
30.1.50; Using etags, Ada and xref-find-definitions doesn't find definitions

Previous Next

Package: emacs;

Reported by: Troy Brown <brownts <at> troybrown.dev>

Date: Mon, 19 May 2025 01:39:02 UTC

Severity: normal

Found in version 30.1.50

Full log


Message #17 received at 78489 <at> debbugs.gnu.org (full text, mbox):

From: Troy Brown <brownts <at> troybrown.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78489 <at> debbugs.gnu.org
Subject: Re: bug#78489: 30.1.50; Using etags, Ada and xref-find-definitions
 doesn't find definitions
Date: Mon, 26 May 2025 22:28:22 -0400
On Mon, May 26, 2025 at 4:13 PM Troy Brown <brownts <at> troybrown.dev> wrote:
>
> In the testing I've done, this patch works correctly and addresses the
> original problem reported.  However, as I explored this a bit further
> I discovered another issue that involves completion.  After typing
> 'Displ' and then `M-x completion-at-point`, the tag including the
> suffix is completed (i.e., "Display_Message/p" is inserted into the
> buffer, instead of just "Display_Message").

I found a spot in `etags-tags-completion-table` that needed
adjustment.  After this fix, the completion works as expected too.

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 352356ddbc5..41b61dc0763 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1288,7 +1288,7 @@ etags-tags-completion-table
       ;; This regexp matches an explicit tag name or the place where
       ;; it would start.
       (while (re-search-forward
-              "[\f\t\n\r()=,; ]?\177\\(?:\\([^\n\001]+\\)\001\\)?"
+              "[\f\t\n\r()=,;
]?\177\\(?:\\([^\n\001]+?\\)\\(/[fpsbtk]\\)?\001\\)?"
              nil t)
        (push   (prog1 (if (match-beginning 1)
                           ;; There is an explicit tag name.
@@ -1645,7 +1645,10 @@ tag-exact-match-p
   (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)
+                          ;; The optional "/x" part is for Ada tags.
+                          "\\(/[fpsbtk]\\)?\001"))))

 ;; t if point is at a tag line that has an implicit name.
 ;; point should be just after a string that matches TAG.




This bug report was last modified 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.