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: Juanma Barranquero <lekktu <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 59575 <at> debbugs.gnu.org
Subject: bug#59575: 29.0.50; add-log-current-defun-header-regexp matches Windows drive letter
Date: Sun, 27 Nov 2022 09:29:56 +0100
[Message part 1 (text/plain, inline)]
On Sun, Nov 27, 2022 at 2:54 AM Dmitry Gutov <dgutov <at> yandex.ru> wrote:
> It seems like
>
>    (setq add-log-current-defun-function nil)
>
> should suffice.

That does not stop add-log-current-defun for working, in absence of an
a-l-c-d-function it just uses the regexp, which is what is returning the
spurious name.

Either adding a custom add-log-current-defun-function, or setting
add-log-current-defun-header-regexp to a buffer-local value so it
recognizes filenames would work. (Buffer-locally, because the variable is
in fact customizable so we can't be sure what its global value will be.)

This works, for example:

(defun xref--add-log-current-defun ()
  (if-let (item (xref--item-at-point))
      (xref-file-location-file (xref-match-item-location item))
    (xref--imenu-extract-index-name)))

(setq-local add-log-current-defun-function #'xref--add-log-current-defun)

> Is that the intended behavior, to report the absence of the current defun?

The final intended behavior, IIUC, is that the filenames in the
xref--xref-buffer-mode get passed to which-function as "defun" names.
[Message part 2 (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.