Subject: Re: bug#20629: 25.0.50; Regression: TAGS broken, can't find anything in C++ files.

From: Dmitry Gutov <[email-masked]>
Date: Tue, 26 May 2015 22:00:23 +0300

On 05/26/2015 06:06 PM, Eli Zaretskii wrote:

> That'd mean either some very invasive change in the insane state
> machine that runs C_entries, or, more likely, throwing it away and
> re-writing it in a very different way.  I don't volunteer.

What if we only make that change in tag-implicit-name-match-p, then? But 
the concern about false positives still applies.

> Yes, I thought about this as well.  I think this is our best bet, and
> shouldn't be too hard, as we already do similar things elsewhere.

Example?

> Patches from completion experts are welcome.

Not an expert, but this should do it. I wonder if we'll get many junk 
completions this way, in certain situations:

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 9ff164e..f026560 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1276,13 +1276,16 @@ buffer-local values of tags table format variables."
  \\([-a-zA-Z0-9_+*$?:]+\\)[^-a-zA-Z0-9_+*$?:\177]*\\)\177\
  \\(\\([^\n\001]+\\)\001\\)?\\([0-9]+\\)?,\\([0-9]+\\)?\n"
  	      nil t)
-	(intern	(prog1 (if (match-beginning 5)
-			   ;; There is an explicit tag name.
-			   (buffer-substring (match-beginning 5) (match-end 5))
-			 ;; No explicit tag name.  Best guess.
-			 (buffer-substring (match-beginning 3) (match-end 3)))
-		  (progress-reporter-update progress-reporter (point)))
-		table)))
+        ;; Implicit tag name.
+        (intern
+         (buffer-substring (match-beginning 3) (match-end 3))
+         table)
+        (when (match-beginning 5)
+          (intern
+           ;; There is an explicit tag name.
+           (buffer-substring (match-beginning 5) (match-end 5))
+           table))
+        (progress-reporter-update progress-reporter (point))))
      table))

  (defun etags-snarf-tag (&optional use-explicit) ; Doc string?