summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-12-01 15:19:38 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2011-12-01 15:19:38 -0500
commit0068070eb050be4d7f46313e67e5902a931ce051 (patch)
treefafee6ec484ec325660849391806c8873b88d4e2 /src
parent9505c3c799e4158b0714da3739ef9244e63d9e92 (diff)
downloademacs-0068070eb050be4d7f46313e67e5902a931ce051.tar.gz
* src/fileio.c (Finsert_file_contents): Move after-change-function call
to before the "handled:" label, since all "goto handled" appear in cases where the *-change-functions have already been properly called. Fixes: debbugs:10117
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/fileio.c20
2 files changed, 17 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f230cdba26f..75f62ad6fbd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fileio.c (Finsert_file_contents): Move after-change-function call
+ to before the "handled:" label, since all "goto handled" appear in
+ cases where the *-change-functions have already been properly called
+ (bug#10117).
+
2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
* keyboard.c (interrupt_signal): Don't call kill-emacs when
diff --git a/src/fileio.c b/src/fileio.c
index 5f7a8ad3972..c0f6c1d2e8e 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4100,6 +4100,16 @@ variable `last-coding-system-used' to the coding system actually used. */)
adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted,
inserted);
+ /* Call after-change hooks for the inserted text, aside from the case
+ of normal visiting (not with REPLACE), which is done in a new buffer
+ "before" the buffer is changed. */
+ if (inserted > 0 && total > 0
+ && (NILP (visit) || !NILP (replace)))
+ {
+ signal_after_change (PT, 0, inserted);
+ update_compositions (PT, PT, CHECK_BORDER);
+ }
+
/* Now INSERTED is measured in characters. */
handled:
@@ -4270,16 +4280,6 @@ variable `last-coding-system-used' to the coding system actually used. */)
unbind_to (count1, Qnil);
}
- /* Call after-change hooks for the inserted text, aside from the case
- of normal visiting (not with REPLACE), which is done in a new buffer
- "before" the buffer is changed. */
- if (inserted > 0 && total > 0
- && (NILP (visit) || !NILP (replace)))
- {
- signal_after_change (PT, 0, inserted);
- update_compositions (PT, PT, CHECK_BORDER);
- }
-
if (!NILP (visit)
&& current_buffer->modtime == -1)
{