Subject: Re: bug#19468: 25.0.50; UI inconveniences with M-.

From: Eli Zaretskii <[email-masked]>
Date: Sat, 02 May 2015 16:41:50 +0300

> Cc: [email-masked]
> From: Dmitry Gutov <[email-masked]>
> Date: Sat, 2 May 2015 15:01:59 +0300
> 
> > I tried both, and got the same results.  So this is not the reason;
> > there's something else at work here.
> 
> I simply run mkid, without arguments, in ~/vc/emacs/src.
> 
> > [Time passes] Ah, I see the reason: Some code that uses ID Utils
> > expects the file names in the ID database to be absolute.  So if I
> > create the ID database like this:
> >
> >     mkid -o ID /path/to/emacs/src
> >
> > then the feature starts working.
> 
> It works fine for me either way (whether called on /path/..., or .), 
> using mkid 4.6, on GNU/Linux.
> 
> Could it be a misfeature of the Windows port?

Found the reason, the patch is below.

There's some tricky logic in ID Utils wrt when to report relative file
names and when not, and I guess CEDET doesn't expect absolute file
names, especially not on Windows.  With the patch below, it works for
me both ways.

diff --git a/lisp/cedet/semantic/symref/idutils.el b/lisp/cedet/semantic/symref/idutils.el
index c22a6a3..655b000 100644
--- a/lisp/cedet/semantic/symref/idutils.el
+++ b/lisp/cedet/semantic/symref/idutils.el
@@ -60,7 +60,7 @@ (cl-defmethod semantic-symref-parse-tool-output-one-line ((tool semantic-symref-
 	 (when (re-search-forward "^\\([^ ]+\\) " nil t)
 	   (match-string 1)))
 	(t
-	 (when (re-search-forward "^\\([^ :]+\\):+\\([0-9]+\\):" nil t)
+	 (when (re-search-forward "^\\(\\(?:[a-zA-Z]:\\)?[^:\n]+\\):\\([0-9]+\\):" nil t)
 	   (cons (string-to-number (match-string 2))
 		 (expand-file-name (match-string 1) default-directory))
 	   ))))