diff options
| author | Richard M. Stallman | 1993-12-31 12:56:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-12-31 12:56:41 +0000 |
| commit | 62bcf0098d9c3d46070cb003ddd341174a37d09f (patch) | |
| tree | 350aa7a2307cadff8333a2d4203940eb514eb35c /src | |
| parent | 93c2b1e79434fbe5ae93e0abf786d05c0b01e136 (diff) | |
| download | emacs-62bcf0098d9c3d46070cb003ddd341174a37d09f.tar.gz emacs-62bcf0098d9c3d46070cb003ddd341174a37d09f.zip | |
(Finsert_file_contents): Don't run after change hook
if inserted is 0. New local `handled', set if run handler.
Avoid setting modtime field if ran a handler.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c index cb06ce57b86..a71d4a17d03 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2394,6 +2394,7 @@ If VISIT is non-nil, BEG and END must be nil.") | |||
| 2394 | Lisp_Object handler, val, insval; | 2394 | Lisp_Object handler, val, insval; |
| 2395 | Lisp_Object p; | 2395 | Lisp_Object p; |
| 2396 | int total; | 2396 | int total; |
| 2397 | int handled = 0; | ||
| 2397 | 2398 | ||
| 2398 | val = Qnil; | 2399 | val = Qnil; |
| 2399 | p = Qnil; | 2400 | p = Qnil; |
| @@ -2411,6 +2412,7 @@ If VISIT is non-nil, BEG and END must be nil.") | |||
| 2411 | if (!NILP (handler)) | 2412 | if (!NILP (handler)) |
| 2412 | { | 2413 | { |
| 2413 | val = call5 (handler, Qinsert_file_contents, filename, visit, beg, end); | 2414 | val = call5 (handler, Qinsert_file_contents, filename, visit, beg, end); |
| 2415 | handled = 1; | ||
| 2414 | goto handled; | 2416 | goto handled; |
| 2415 | } | 2417 | } |
| 2416 | 2418 | ||
| @@ -2541,7 +2543,10 @@ If VISIT is non-nil, BEG and END must be nil.") | |||
| 2541 | #ifdef APOLLO | 2543 | #ifdef APOLLO |
| 2542 | stat (XSTRING (filename)->data, &st); | 2544 | stat (XSTRING (filename)->data, &st); |
| 2543 | #endif | 2545 | #endif |
| 2544 | current_buffer->modtime = st.st_mtime; | 2546 | |
| 2547 | if (! handled) | ||
| 2548 | current_buffer->modtime = st.st_mtime; | ||
| 2549 | |||
| 2545 | current_buffer->save_modified = MODIFF; | 2550 | current_buffer->save_modified = MODIFF; |
| 2546 | current_buffer->auto_save_modified = MODIFF; | 2551 | current_buffer->auto_save_modified = MODIFF; |
| 2547 | XFASTINT (current_buffer->save_length) = Z - BEG; | 2552 | XFASTINT (current_buffer->save_length) = Z - BEG; |
| @@ -2559,7 +2564,7 @@ If VISIT is non-nil, BEG and END must be nil.") | |||
| 2559 | report_file_error ("Opening input file", Fcons (filename, Qnil)); | 2564 | report_file_error ("Opening input file", Fcons (filename, Qnil)); |
| 2560 | } | 2565 | } |
| 2561 | 2566 | ||
| 2562 | if (NILP (visit) && total > 0) | 2567 | if (inserted > 0 && NILP (visit) && total > 0) |
| 2563 | signal_after_change (point, 0, inserted); | 2568 | signal_after_change (point, 0, inserted); |
| 2564 | 2569 | ||
| 2565 | if (inserted > 0) | 2570 | if (inserted > 0) |