Subject: bug#73018: 31.0.50; wdired + replace-regexp only modifies the visible portion of the buffer

From: Juri Linkov <[email-masked]>
Date: Wed, 04 Sep 2024 19:13:31 +0300

>> +  (font-lock-ensure)
>>    (run-mode-hooks 'wdired-mode-hook)
>>    (message "%s" (substitute-command-keys
>>  		 "Press \\[wdired-finish-edit] when finished \
>
> Yip.  When we do this (guess we don't have a choice), my preferred
> solution would be to hook this into the corresponding isearch function.
> Because calling `font-lock-ensure' can be really slow in large dired
> buffers (several seconds).  Or we manage to rewrite things so that the
> work is done on the fly in some way.

So you prefer to slow down only when the user types C-s?
This is possible by adding a local hook in
wdired-change-to-wdired-mode:

  (add-hook 'isearch-mode-hook #'font-lock-ensure nil t)