GNU bug report logs - #73018
31.0.50; wdired + replace-regexp only modifies the visible portion of the buffer

Previous Next

Package: emacs;

Reported by: Madhu <enometh <at> meer.net>

Date: Wed, 4 Sep 2024 02:38:01 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Madhu <enometh <at> meer.net>, 73018 <at> debbugs.gnu.org
Subject: Re: bug#73018: 31.0.50; wdired + replace-regexp only modifies the
 visible portion of the buffer
Date: Sun, 08 Sep 2024 19:28:32 +0300
>> > Maybe this is reproducible only on very long Dired buffers?
>
> After following the recipe literally, I could reproduce that thing, too.
>
> Maybe this issue occurring depends on what exactly is replaced - symlink
> targets.  In this case, (font-lock-ensure) does make a
> difference.
>
> Yesterday I had experimented with replacing in symlink names - in that
> case, the whole buffer had been considered.

I tried this:

(dired "/dev/char")

M-: (buffer-substring (- (point-max) 2) (- (point-max) 1))
=> #("7" 0 1 (fontified nil invisible dired-hide-details-link))

M-> ;; (end-of-buffer)

M-: (buffer-substring (- (point-max) 2) (- (point-max) 1))
=> #("7" 0 1 (face default dired-symlink-filename t fontified t invisible dired-hide-details-link))

And indeed, after going to the end of the Dired buffer
the last file gets an additional property `dired-symlink-filename'
used by Isearch/Replace.

Also noticed that doing the first replacement always raises an error:

Debugger entered--Lisp error: (error "Match data clobbered by buffer modification hooks")
  replace-match("!" nil nil)
  replace-match-maybe-edit("!" nil nil nil (672 673 #<buffer char>) nil)
  perform-replace("7" "!" t t nil nil nil nil nil nil nil)
  query-replace-regexp("7" "!" nil nil nil nil nil)
  funcall-interactively(query-replace-regexp "7" "!" nil nil nil nil nil)
  command-execute(query-replace-regexp)




This bug report was last modified 293 days ago.

Previous Next


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