Commit 62bcf009 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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.
parent 93c2b1e7
......@@ -2394,6 +2394,7 @@ If VISIT is non-nil, BEG and END must be nil.")
Lisp_Object handler, val, insval;
Lisp_Object p;
int total;
int handled = 0;
val = Qnil;
p = Qnil;
......@@ -2411,6 +2412,7 @@ If VISIT is non-nil, BEG and END must be nil.")
if (!NILP (handler))
{
val = call5 (handler, Qinsert_file_contents, filename, visit, beg, end);
handled = 1;
goto handled;
}
......@@ -2541,7 +2543,10 @@ If VISIT is non-nil, BEG and END must be nil.")
#ifdef APOLLO
stat (XSTRING (filename)->data, &st);
#endif
current_buffer->modtime = st.st_mtime;
if (! handled)
current_buffer->modtime = st.st_mtime;
current_buffer->save_modified = MODIFF;
current_buffer->auto_save_modified = MODIFF;
XFASTINT (current_buffer->save_length) = Z - BEG;
......@@ -2559,7 +2564,7 @@ If VISIT is non-nil, BEG and END must be nil.")
report_file_error ("Opening input file", Fcons (filename, Qnil));
}
if (NILP (visit) && total > 0)
if (inserted > 0 && NILP (visit) && total > 0)
signal_after_change (point, 0, inserted);
if (inserted > 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment