changeset 5390:d9c81d7079f3

(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.
author Richard M. Stallman <rms@gnu.org>
date Fri, 31 Dec 1993 12:56:41 +0000
parents 09148c696fa2
children 0306cbfa87b7
files src/fileio.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Fri Dec 31 12:50:12 1993 +0000
+++ b/src/fileio.c	Fri Dec 31 12:56:41 1993 +0000
@@ -2394,6 +2394,7 @@
   Lisp_Object handler, val, insval;
   Lisp_Object p;
   int total;
+  int handled = 0;
 
   val = Qnil;
   p = Qnil;
@@ -2411,6 +2412,7 @@
   if (!NILP (handler))
     {
       val = call5 (handler, Qinsert_file_contents, filename, visit, beg, end);
+      handled = 1;
       goto handled;
     }
 
@@ -2541,7 +2543,10 @@
 #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 @@
 	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)