From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#59575: 29.0.50; add-log-current-defun-header-regexp matches Windows drive letter Date: Fri, 25 Nov 2022 16:53:51 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006d374f05ee4d8968" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26790"; mail-complaints-to="usenet@ciao.gmane.io" To: 59575@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 25 16:55:22 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oyb2w-0006op-5e for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Nov 2022 16:55:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyb2g-00066s-FA; Fri, 25 Nov 2022 10:55:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyb2d-00066b-Pc for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 10:55:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyb2c-00041x-Pp for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 10:55:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oyb2c-0005pJ-58 for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 10:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Nov 2022 15:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59575 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Bug-Gnu-Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.166939168222367 (code B ref -1); Fri, 25 Nov 2022 15:55:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Nov 2022 15:54:42 +0000 Original-Received: from localhost ([127.0.0.1]:36964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyb2H-0005of-Mf for submit@debbugs.gnu.org; Fri, 25 Nov 2022 10:54:41 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:53328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyb2F-0005oX-56 for submit@debbugs.gnu.org; Fri, 25 Nov 2022 10:54:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oyb2E-000648-Vr for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 10:54:38 -0500 Original-Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyb27-0003uv-AF for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 10:54:38 -0500 Original-Received: by mail-ej1-x631.google.com with SMTP id f18so11244198ejz.5 for ; Fri, 25 Nov 2022 07:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=KoO/cd5El1AnbwFZGd6JMgyL1GEYUCLsL/qy0GbZx70=; b=YHlPJxet7ed3XDgik1BJTpOI9T6QP7gZYQtsEsVXuB53HhF+GgQCxjIAkqho7UvV3q UyIRlLkl7q+N9/3MZeonUWdVyGNR55zuldZh3Sbc95XdpQU1tOcV9TEF5rZWMZS8MB0T 3F22ncTZQLDEbjB1lquO6zlmh+c1KWKdpxr8HmaCT0asBzr0kQu7H8HZjN79S32FeWhC N/Q+/lRQJm+UfjJTZ5d8pUC4jGF09EgmSc8Cfi+ac3Bg9eqgWp32yKPopMGYYEWCzdFQ Zy4LueZHgGHjnHaVzxIeXcHWte5/3hu3ixMGRukcy/P3eHbHDTimWQppGj1AfDafpZP6 tTvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=KoO/cd5El1AnbwFZGd6JMgyL1GEYUCLsL/qy0GbZx70=; b=vUgiKxqDy1BzN+94skuVB0V9R+kDKM5bNRRbBqk846DVFrbdaT1HFleiy00XZ4IbH9 S134raEr/1xnkgNp3YizrYM4PQWSwyo/ctVrjmROOZMJLh0XLjH+GMvgX2NuQ7tnuLOI ewk/A2ryQVov1tVHGz9PWIbJvgva84c5qStzxioXqD3ZXnduRJ1juAOQ4VKt9x/CtUG6 QGmlmZHfbpjZi+AlHbIg3SgLZnVgec7HD6quDTaHSkS9gcg5lP34MF5aNroBkLlL1TG+ AEcah3+E+jnT3NigjWKJ/KOwf57JmQ3ybn1EVXEJ9y7IK+/qfw1LO6a+Q9p/meGjqR1x uPaQ== X-Gm-Message-State: ANoB5pk1O7bdBHmNTHiyYNs37K1Kcv2phdEBWfJA64QGFaOPeJeLoE0T jROu+TkzG5EVqlX5/fcPvdPmtzVyAAGftnUCCc5KRBBzPXs= X-Google-Smtp-Source: AA0mqf5TCjMVmyMCO4ynG0A0+AcDUl/IZE7x14ZpYlSd1RikFWo86TlsAcVGePkifAcH7wnXnxH/qcgmbZ26MXHMkJs= X-Received: by 2002:a17:906:2416:b0:7ad:4a55:d6f5 with SMTP id z22-20020a170906241600b007ad4a55d6f5mr33325382eja.220.1669391669080; Fri, 25 Nov 2022 07:54:29 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=lekktu@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249012 Archived-At: --0000000000006d374f05ee4d8968 Content-Type: text/plain; charset="UTF-8" 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. --0000000000006d374f05ee4d8968 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If you have an *xref* buffer with absolute Windows filenames= , like

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

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

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

I suppose thi= s should=C2=A0be 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.

--0000000000006d374f05ee4d8968--