Fix 'replace-regexp' in WDired

* src/search.c (Freplace_match): Revert the search.c part of the
change from Apr 7, 2024, which aims to fix bug#65451, but causes
bug#73018.  Do not merge to master.

* test/src/editfns-tests.el
(editfns-tests--before/after-change-functions): Expect this test
to fail.
This commit is contained in:
Eli Zaretskii 2024-09-21 12:26:24 +03:00
parent b7f6cde419
commit eced135120
2 changed files with 2 additions and 1 deletions

View file

@ -2762,7 +2762,6 @@ since only regular expressions have distinguished subexpressions. */)
/* Replace the old text with the new in the cleanest possible way. */
replace_range (sub_start, sub_end, newtext, 1, 0, 1, true, true);
signal_after_change (sub_start, sub_end - sub_start, SCHARS (newtext));
if (case_action == all_caps)
Fupcase_region (make_fixnum (search_regs.start[sub]),
@ -2787,6 +2786,7 @@ since only regular expressions have distinguished subexpressions. */)
/* Now move point "officially" to the end of the inserted replacement. */
move_if_not_intangible (newpoint);
signal_after_change (sub_start, sub_end - sub_start, SCHARS (newtext));
update_compositions (sub_start, newpoint, CHECK_BORDER);
return Qnil;

View file

@ -503,6 +503,7 @@
sanity-check-change-functions-errors)))
(ert-deftest editfns-tests--before/after-change-functions ()
:expected-result :failed
(with-temp-buffer
(add-hook 'before-change-functions
#'sanity-check-change-functions-before nil t)