From: Eli Zaretskii Date: Sat, 21 Sep 2024 09:26:24 +0000 (+0300) Subject: Fix 'replace-regexp' in WDired X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~382 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=eced1351200616eed626b56976d8ec98d12ebe61;p=emacs.git 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. --- diff --git a/src/search.c b/src/search.c index 2ff8b0599c4..9265425d6cd 100644 --- a/src/search.c +++ b/src/search.c @@ -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; diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index a02bab73c09..b0a67d0f6ac 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -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)