GNU bug report logs - #59575
29.0.50; add-log-current-defun-header-regexp matches Windows drive letter

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Fri, 25 Nov 2022 15:55:01 UTC

Severity: normal

Found in version 29.0.50

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Juanma Barranquero <lekktu <at> gmail.com>
Subject: bug#59575: closed (Re: bug#59575: 29.0.50; add-log-current-defun-header-regexp
 matches Windows drive letter)
Date: Sun, 27 Nov 2022 14:04:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#59575: 29.0.50; add-log-current-defun-header-regexp matches Windows drive letter

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 59575 <at> debbugs.gnu.org.

-- 
59575: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59575
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Juanma Barranquero <lekktu <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 59575-done <at> debbugs.gnu.org
Subject: Re: bug#59575: 29.0.50; add-log-current-defun-header-regexp matches
 Windows drive letter
Date: Sun, 27 Nov 2022 15:02:42 +0100
[Message part 3 (text/plain, inline)]
Fixed in commit 31cfd6d311 of 2022-11-27
Fix xref interaction with which-func (bug#59575)
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Juanma Barranquero <lekktu <at> gmail.com>
To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 29.0.50;
 add-log-current-defun-header-regexp matches Windows drive letter
Date: Fri, 25 Nov 2022 16:53:51 +0100
[Message part 6 (text/plain, inline)]
If you have an *xref* buffer with absolute Windows filenames, like

~/.emacs.d/init.el
  93:             server-name    (replace-regexp-in-string "\\\\+" "\\"
serv t t)
1102:   (let ((s (when server-name
1104:                (string-match (rx (+ (not (any ?\\))) line-end)
server-name)
1105:                (upcase (match-string 0 server-name))))))
d:/Devel/emacs/repo/trunk/lisp/erc/erc-backend.el
1820:   (pcase-let ((`(,server-name ,server-version)
1823:     (setq erc-server-announced-name server-name)
1827:      's004 ?s server-name ?v server-version

and put the cursor in an absolute filename line (like the one
d:/Devel/[etc] above), calling `add-log-current-defun' returns the drive
letter "d", because it matches a-l-c-d-header-regexp.

The effect is visible when you have which-function-mode enabled, because
the function returns non-nil, so which-function does not resort to imenu,
and you end with "d" in the mode-line.

I suppose this should be fixed in xref.el, which apparently assumes that
file name lines will be either relative or Unix-style (/path/file works
correctly, it's just d:/path/file that fails) and the add-log heuristics
will always fail.
[Message part 7 (text/html, inline)]

This bug report was last modified 2 years and 234 days ago.

Previous Next


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