(undo_limit, undo_strong_limit, Vundo_outer_limit): Quadruple undo
[bpt/emacs.git] / src / undo.c
index 22ebc14..39ca983 100644 (file)
@@ -1,13 +1,13 @@
 /* undo handling for GNU Emacs.
    Copyright (C) 1990, 1993, 1994, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+                 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,9 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
 #include <config.h>
@@ -81,7 +79,13 @@ record_point (pt)
   if (NILP (pending_boundary))
     pending_boundary = Fcons (Qnil, Qnil);
 
-  if (current_buffer != last_undo_buffer)
+  if ((current_buffer != last_undo_buffer)
+      /* Don't call Fundo_boundary for the first change.  Otherwise we
+        risk overwriting last_boundary_position in Fundo_boundary with
+        PT of the current buffer and as a consequence not insert an
+        undo boundary because last_boundary_position will equal pt in
+        the test at the end of the present function (Bug#731).  */
+      && (MODIFF > SAVE_MODIFF))
     Fundo_boundary ();
   last_undo_buffer = current_buffer;
 
@@ -685,7 +689,7 @@ value, the earlier commands that came before it are forgotten.
 
 The size is counted as the number of bytes occupied,
 which includes both saved text and other data.  */);
-  undo_limit = 20000;
+  undo_limit = 80000;
 
   DEFVAR_INT ("undo-strong-limit", &undo_strong_limit,
              doc: /* Don't keep more than this much size of undo information.
@@ -697,7 +701,7 @@ is never discarded for this reason.
 
 The size is counted as the number of bytes occupied,
 which includes both saved text and other data.  */);
-  undo_strong_limit = 30000;
+  undo_strong_limit = 120000;
 
   DEFVAR_LISP ("undo-outer-limit", &Vundo_outer_limit,
              doc: /* Outer limit on size of undo information for one command.
@@ -714,7 +718,7 @@ In fact, this calls the function which is the value of
 `undo-outer-limit-function' with one argument, the size.
 The text above describes the behavior of the function
 that variable usually specifies.  */);
-  Vundo_outer_limit = make_number (3000000);
+  Vundo_outer_limit = make_number (12000000);
 
   DEFVAR_LISP ("undo-outer-limit-function", &Vundo_outer_limit_function,
               doc: /* Function to call when an undo list exceeds `undo-outer-limit'.