all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: Eli Zaretskii <eliz@gnu.org>, 59575@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	[thread overview]
Message-ID: <CAAeL0SQGSRs_8ueifPejEYxSESkHaqM1p61LvQWkDSNtmdeY7w@mail.gmail.com> (raw)
In-Reply-To: <f55d5505-35f8-59b1-a736-ec9ed381fedd@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

On Sun, Nov 27, 2022 at 2:54 AM Dmitry Gutov <dgutov@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.

[-- Attachment #2: Type: text/html, Size: 2303 bytes --]

  parent reply	other threads:[~2022-11-27  8:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 15:53 bug#59575: 29.0.50; add-log-current-defun-header-regexp matches Windows drive letter Juanma Barranquero
2022-11-26 13:03 ` Eli Zaretskii
2022-11-26 13:17   ` Juanma Barranquero
2022-11-27  1:54   ` Dmitry Gutov
2022-11-27  6:49     ` Eli Zaretskii
2022-11-27 12:33       ` Dmitry Gutov
2022-11-27 12:40         ` Juanma Barranquero
2022-11-27  8:29     ` Juanma Barranquero [this message]
2022-11-27 11:11       ` Juanma Barranquero
2022-11-27 11:22         ` Juanma Barranquero
2022-11-27 13:04           ` Dmitry Gutov
2022-11-27 13:22             ` Juanma Barranquero
2022-11-27 13:05       ` Dmitry Gutov
2022-11-27 13:18         ` Juanma Barranquero
2022-11-27 13:41           ` Dmitry Gutov
2022-11-27 14:02             ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAeL0SQGSRs_8ueifPejEYxSESkHaqM1p61LvQWkDSNtmdeY7w@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=59575@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.