diff options
| author | Stefan Monnier | 2011-12-01 15:19:38 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2011-12-01 15:19:38 -0500 |
| commit | 0068070eb050be4d7f46313e67e5902a931ce051 (patch) | |
| tree | fafee6ec484ec325660849391806c8873b88d4e2 /src | |
| parent | 9505c3c799e4158b0714da3739ef9244e63d9e92 (diff) | |
| download | emacs-0068070eb050be4d7f46313e67e5902a931ce051.tar.gz emacs-0068070eb050be4d7f46313e67e5902a931ce051.zip | |
* 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/ChangeLog | 7 | ||||
| -rw-r--r-- | src/fileio.c | 20 |
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 @@ | |||
| 1 | 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * fileio.c (Finsert_file_contents): Move after-change-function call | ||
| 4 | to before the "handled:" label, since all "goto handled" appear in | ||
| 5 | cases where the *-change-functions have already been properly called | ||
| 6 | (bug#10117). | ||
| 7 | |||
| 1 | 2011-12-01 Andreas Schwab <schwab@linux-m68k.org> | 8 | 2011-12-01 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 9 | ||
| 3 | * keyboard.c (interrupt_signal): Don't call kill-emacs when | 10 | * 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. */) | |||
| 4100 | adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted, | 4100 | adjust_after_insert (PT, PT_BYTE, PT + inserted, PT_BYTE + inserted, |
| 4101 | inserted); | 4101 | inserted); |
| 4102 | 4102 | ||
| 4103 | /* Call after-change hooks for the inserted text, aside from the case | ||
| 4104 | of normal visiting (not with REPLACE), which is done in a new buffer | ||
| 4105 | "before" the buffer is changed. */ | ||
| 4106 | if (inserted > 0 && total > 0 | ||
| 4107 | && (NILP (visit) || !NILP (replace))) | ||
| 4108 | { | ||
| 4109 | signal_after_change (PT, 0, inserted); | ||
| 4110 | update_compositions (PT, PT, CHECK_BORDER); | ||
| 4111 | } | ||
| 4112 | |||
| 4103 | /* Now INSERTED is measured in characters. */ | 4113 | /* Now INSERTED is measured in characters. */ |
| 4104 | 4114 | ||
| 4105 | handled: | 4115 | handled: |
| @@ -4270,16 +4280,6 @@ variable `last-coding-system-used' to the coding system actually used. */) | |||
| 4270 | unbind_to (count1, Qnil); | 4280 | unbind_to (count1, Qnil); |
| 4271 | } | 4281 | } |
| 4272 | 4282 | ||
| 4273 | /* Call after-change hooks for the inserted text, aside from the case | ||
| 4274 | of normal visiting (not with REPLACE), which is done in a new buffer | ||
| 4275 | "before" the buffer is changed. */ | ||
| 4276 | if (inserted > 0 && total > 0 | ||
| 4277 | && (NILP (visit) || !NILP (replace))) | ||
| 4278 | { | ||
| 4279 | signal_after_change (PT, 0, inserted); | ||
| 4280 | update_compositions (PT, PT, CHECK_BORDER); | ||
| 4281 | } | ||
| 4282 | |||
| 4283 | if (!NILP (visit) | 4283 | if (!NILP (visit) |
| 4284 | && current_buffer->modtime == -1) | 4284 | && current_buffer->modtime == -1) |
| 4285 | { | 4285 | { |