GNU bug report logs - #33697
26.1; file-truename messes with match data

Previous Next

Package: emacs;

Reported by: kevin.legouguec <at> gmail.com (Kévin Le Gouguec)

Date: Mon, 10 Dec 2018 21:03:01 UTC

Severity: wishlist

Merged with 31586

Found in versions 26.1, 27.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 33697 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kevin.legouguec <at> gmail.com (Kévin Le Gouguec)
Cc: 33697 <at> debbugs.gnu.org
Subject: Re: bug#33697: 26.1; file-truename messes with match data
Date: Tue, 11 Dec 2018 06:55:33 +0200
merge 33697 31586
thanks

> From: kevin.legouguec <at> gmail.com (Kévin Le Gouguec)
> Date: Mon, 10 Dec 2018 22:02:09 +0100
> 
> I set frame-title-format so that it displays the basename of the current
> project's root folder for the active buffer.  However, my $HOME is under
> version control; I do not want this particular "project" to show up in
> the frame's title.
> 
> Here is the code that I use:
> 
>     (require 'subr-x)
> 
>     (defun my/project-name ()
>       (when-let* ((project (project-current))
>                   (root (car (project-roots project))))
>         (when (not (file-equal-p root "~"))
>           (file-name-nondirectory (string-trim-right root "/")))))
> 
>     (setq frame-title-format
>           '(:eval
>             (let ((project (my/project-name)))
>               (concat (when project (format "[%s] " project)) "%b"))))
> 
> After adding the above to my .emacs, I started experiencing weird
> failures with query-replace.  I managed to reproduce this with emacs -Q:
> 
> - evaluate the above
> - move to the beginning of *scratch*
> - M-% a RET b RET
> ⇒ perform-replace: Args out of range: #<buffer *scratch*>, 0, 2
>   (point has moved after the first match)

This is bug#31586, please see the discussions there.




This bug report was last modified 3 years and 18 days ago.

Previous Next


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