summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2018-07-21 22:27:33 +0300
committerEli Zaretskii <eliz@gnu.org>2018-07-21 22:27:33 +0300
commit47f75b1ba0246b5d770fbb52e0fa3e00f9f83ffb (patch)
treebc1a2ec148e14e57c450300e2d2b2d2332cb8203
parent671dc5a51edfb9aaea943e144997e7c1297f56fb (diff)
downloademacs-47f75b1ba0246b5d770fbb52e0fa3e00f9f83ffb.tar.gz
emacs-47f75b1ba0246b5d770fbb52e0fa3e00f9f83ffb.tar.bz2
emacs-47f75b1ba0246b5d770fbb52e0fa3e00f9f83ffb.zip
Fix last change in editfns.c
* src/editfns.c (Freplace_buffer_contents): Fix last change: always call buffer modification hooks, even if nothing was deleted/inserted. (bug#32237)
-rw-r--r--src/editfns.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/editfns.c b/src/editfns.c
index cf596aec37c..a18a71e6d77 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3257,9 +3257,7 @@ differences between the two buffers. */)
for (l = size_a; l > k && !bit_is_set (ctx.deletions, l - 1); l--)
;
to = BEGV + l;
- /* If k >= l, it means nothing needs to be deleted. */
- if (k < l)
- prepare_to_modify_buffer (from, to, NULL);
+ prepare_to_modify_buffer (from, to, NULL);
specbind (Qinhibit_modification_hooks, Qt);
modification_hooks_inhibited = true;
}
@@ -3310,16 +3308,11 @@ differences between the two buffers. */)
SAFE_FREE ();
rbc_quitcounter = 0;
- if (modification_hooks_inhibited && from <= to)
+ if (modification_hooks_inhibited)
{
ptrdiff_t updated_to = to + ZV - BEGV - size_a;
- /* Only call after-change-functions if something was actually
- inserted. */
- if (from < updated_to)
- {
- signal_after_change (from, to - from, updated_to - from);
- update_compositions (from, updated_to, CHECK_INSIDE);
- }
+ signal_after_change (from, to - from, updated_to - from);
+ update_compositions (from, updated_to, CHECK_INSIDE);
}
return Qnil;