emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src ChangeLog fileio.c [EMACS_23_1_RC]


From: Chong Yidong
Subject: [Emacs-diffs] emacs/src ChangeLog fileio.c [EMACS_23_1_RC]
Date: Tue, 21 Jul 2009 23:17:09 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_23_1_RC
Changes by:     Chong Yidong <cyd>      09/07/21 23:17:09

Modified files:
        src            : ChangeLog fileio.c 

Log message:
        * fileio.c (Vauto_save_include_big_deletions): New variable.
        (Fdo_auto_save): Disable auto-save only if
        auto-save-include-big-deletions is nil.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&only_with_tag=EMACS_23_1_RC&r1=1.7586.2.28&r2=1.7586.2.29
http://cvs.savannah.gnu.org/viewcvs/emacs/src/fileio.c?cvsroot=emacs&only_with_tag=EMACS_23_1_RC&r1=1.654.2.2&r2=1.654.2.3

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7586.2.28
retrieving revision 1.7586.2.29
diff -u -b -r1.7586.2.28 -r1.7586.2.29
--- ChangeLog   21 Jul 2009 20:08:49 -0000      1.7586.2.28
+++ ChangeLog   21 Jul 2009 23:17:06 -0000      1.7586.2.29
@@ -1,5 +1,11 @@
 2009-07-21  Chong Yidong  <address@hidden>
 
+       * fileio.c (Vauto_save_include_big_deletions): New variable.
+       (Fdo_auto_save): Disable auto-save only if
+       auto-save-include-big-deletions is nil.
+
+2009-07-21  Chong Yidong  <address@hidden>
+
        * xdisp.c (move_it_to): For continued lines ending in a tab, take
        the overflowed pixels into account (Bug#3879).
 

Index: fileio.c
===================================================================
RCS file: /sources/emacs/emacs/src/fileio.c,v
retrieving revision 1.654.2.2
retrieving revision 1.654.2.3
diff -u -b -r1.654.2.2 -r1.654.2.3
--- fileio.c    7 Jul 2009 22:48:07 -0000       1.654.2.2
+++ fileio.c    21 Jul 2009 23:17:08 -0000      1.654.2.3
@@ -193,6 +193,9 @@
 /* Whether or not files are auto-saved into themselves.  */
 Lisp_Object Vauto_save_visited_file_name;
 
+/* Whether or not to continue auto-saving after a large deletion.  */
+Lisp_Object Vauto_save_include_big_deletions;
+
 /* On NT, specifies the directory separator character, used (eg.) when
    expanding file names.  This can be bound to / or \. */
 Lisp_Object Vdirectory_sep_char;
@@ -5321,7 +5324,9 @@
                && EMACS_SECS (before_time) - b->auto_save_failure_time < 1200)
              continue;
 
-           if ((XFASTINT (b->save_length) * 10
+           set_buffer_internal (b);
+           if (NILP (Vauto_save_include_big_deletions)
+               && (XFASTINT (b->save_length) * 10
                 > (BUF_Z (b) - BUF_BEG (b)) * 13)
                /* A short file is likely to change a large fraction;
                   spare the user annoying messages.  */
@@ -5341,7 +5346,6 @@
                Fsleep_for (make_number (1), Qnil);
                continue;
              }
-           set_buffer_internal (b);
            if (!auto_saved && NILP (no_message))
              message1 ("Auto-saving...");
            internal_condition_case (auto_save_1, Qt, auto_save_error);
@@ -5704,6 +5708,13 @@
 Normally auto-save files are written under other names.  */);
   Vauto_save_visited_file_name = Qnil;
 
+  DEFVAR_LISP ("auto-save-include-big-deletions", 
&Vauto_save_include_big_deletions,
+              doc: /* If non-nil, auto-save even if a large part of the text 
is deleted.
+If nil, deleting a substantial portion of the text disables auto-save
+in the buffer; this is the default behavior, because the auto-save
+file is usually more useful if it contains the deleted text.  */);
+  Vauto_save_include_big_deletions = Qnil;
+
 #ifdef HAVE_FSYNC
   DEFVAR_BOOL ("write-region-inhibit-fsync", &write_region_inhibit_fsync,
               doc: /* *Non-nil means don't call fsync in `write-region'.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]