emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109139: * src/lisp.h (last_undo_boun


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109139: * src/lisp.h (last_undo_boundary): Declare new var.
Date: Wed, 18 Jul 2012 09:20:59 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109139
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11774
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2012-07-18 09:20:59 -0400
message:
  * src/lisp.h (last_undo_boundary): Declare new var.
  * src/keyboard.c (command_loop_1): Set it.
  * src/cmds.c (Fself_insert_command): Use it to only remove boundaries that
  were auto-added by the command loop.
modified:
  src/ChangeLog
  src/cmds.c
  src/keyboard.c
  src/lisp.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-07-18 10:12:43 +0000
+++ b/src/ChangeLog     2012-07-18 13:20:59 +0000
@@ -1,3 +1,10 @@
+2012-07-18  Stefan Monnier  <address@hidden>
+
+       * lisp.h (last_undo_boundary): Declare new var.
+       * keyboard.c (command_loop_1): Set it.
+       * cmds.c (Fself_insert_command): Use it to only remove boundaries that
+       were auto-added by the command loop (bug#11774).
+
 2012-07-18  Andreas Schwab  <address@hidden>
 
        * w32font.c (Qsymbol): Remove local definition.

=== modified file 'src/cmds.c'
--- a/src/cmds.c        2012-06-16 12:24:15 +0000
+++ b/src/cmds.c        2012-07-18 13:20:59 +0000
@@ -296,7 +296,10 @@
 
   if (remove_boundary
       && CONSP (BVAR (current_buffer, undo_list))
-      && NILP (XCAR (BVAR (current_buffer, undo_list))))
+      && NILP (XCAR (BVAR (current_buffer, undo_list)))
+      /* Only remove auto-added boundaries, not boundaries
+        added be explicit calls to undo-boundary.  */
+      && EQ (BVAR (current_buffer, undo_list), last_undo_boundary))
     /* Remove the undo_boundary that was just pushed.  */
     BVAR (current_buffer, undo_list) = XCDR (BVAR (current_buffer, undo_list));
 

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2012-07-12 03:45:46 +0000
+++ b/src/keyboard.c    2012-07-18 13:20:59 +0000
@@ -1318,6 +1318,9 @@
 }
 #endif
 
+/* The last boundary auto-added to buffer-undo-list.  */
+Lisp_Object last_undo_boundary;
+
 /* FIXME: This is wrong rather than test window-system, we should call
    a new set-selection, which will then dispatch to x-set-selection, or
    tty-set-selection, or w32-set-selection, ...  */
@@ -1565,7 +1568,13 @@
 #endif
 
             if (NILP (KVAR (current_kboard, Vprefix_arg))) /* FIXME: Why?  
--Stef  */
-              Fundo_boundary ();
+              {
+               Lisp_Object undo = BVAR (current_buffer, undo_list);
+               Fundo_boundary ();
+               last_undo_boundary
+                 = (EQ (undo, BVAR (current_buffer, undo_list))
+                    ? Qnil : BVAR (current_buffer, undo_list));
+             }
             Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
 
 #ifdef HAVE_WINDOW_SYSTEM

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2012-07-18 05:44:36 +0000
+++ b/src/lisp.h        2012-07-18 13:20:59 +0000
@@ -2921,7 +2921,7 @@
 extern void syms_of_search (void);
 extern void clear_regexp_cache (void);
 
-/* Defined in minibuf.c */
+/* Defined in minibuf.c.  */
 
 extern Lisp_Object Qcompletion_ignore_case;
 extern Lisp_Object Vminibuffer_list;
@@ -2930,25 +2930,25 @@
 extern void init_minibuf_once (void);
 extern void syms_of_minibuf (void);
 
-/* Defined in callint.c */
+/* Defined in callint.c.  */
 
 extern Lisp_Object Qminus, Qplus;
 extern Lisp_Object Qwhen;
 extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook;
 extern void syms_of_callint (void);
 
-/* Defined in casefiddle.c */
+/* Defined in casefiddle.c.  */
 
 extern Lisp_Object Qidentity;
 extern void syms_of_casefiddle (void);
 extern void keys_of_casefiddle (void);
 
-/* Defined in casetab.c */
+/* Defined in casetab.c.  */
 
 extern void init_casetab_once (void);
 extern void syms_of_casetab (void);
 
-/* Defined in keyboard.c */
+/* Defined in keyboard.c.  */
 
 extern Lisp_Object echo_message_buffer;
 extern struct kboard *echo_kboard;
@@ -2956,6 +2956,7 @@
 extern Lisp_Object Qdisabled, QCfilter;
 extern Lisp_Object Qup, Qdown, Qbottom;
 extern Lisp_Object Qtop;
+extern Lisp_Object last_undo_boundary;
 extern int input_pending;
 extern Lisp_Object menu_bar_items (Lisp_Object);
 extern Lisp_Object tool_bar_items (Lisp_Object, int *);
@@ -2976,13 +2977,13 @@
 extern void syms_of_keyboard (void);
 extern void keys_of_keyboard (void);
 
-/* Defined in indent.c */
+/* Defined in indent.c.  */
 extern ptrdiff_t current_column (void);
 extern void invalidate_current_column (void);
 extern int indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT);
 extern void syms_of_indent (void);
 
-/* Defined in frame.c */
+/* Defined in frame.c.  */
 extern Lisp_Object Qonly;
 extern Lisp_Object Qvisible;
 extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object);
@@ -2995,7 +2996,7 @@
 extern void frames_discard_buffer (Lisp_Object);
 extern void syms_of_frame (void);
 
-/* Defined in emacs.c */
+/* Defined in emacs.c.  */
 extern char **initial_argv;
 extern int initial_argc;
 #if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)


reply via email to

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