aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2012-07-18 09:20:59 -0400
committerStefan Monnier2012-07-18 09:20:59 -0400
commit464d5a5e1f95378b8fef2b70dd6aee4486a352da (patch)
treec530fadef545533b1f04c8c121cf51e39446f69b /src
parenta4acb88d3582144556a668c6cc35082e4d6a82f1 (diff)
downloademacs-464d5a5e1f95378b8fef2b70dd6aee4486a352da.tar.gz
emacs-464d5a5e1f95378b8fef2b70dd6aee4486a352da.zip
* 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. Fixes: debbugs:11774
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/cmds.c5
-rw-r--r--src/keyboard.c11
-rw-r--r--src/lisp.h17
4 files changed, 30 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 29d6c4284af..42aff300ad6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * lisp.h (last_undo_boundary): Declare new var.
4 * keyboard.c (command_loop_1): Set it.
5 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
6 were auto-added by the command loop (bug#11774).
7
12012-07-18 Andreas Schwab <schwab@linux-m68k.org> 82012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2 9
3 * w32font.c (Qsymbol): Remove local definition. 10 * w32font.c (Qsymbol): Remove local definition.
diff --git a/src/cmds.c b/src/cmds.c
index d617c7f81d9..a7a2eb6f528 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -296,7 +296,10 @@ At the end, it runs `post-self-insert-hook'. */)
296 296
297 if (remove_boundary 297 if (remove_boundary
298 && CONSP (BVAR (current_buffer, undo_list)) 298 && CONSP (BVAR (current_buffer, undo_list))
299 && NILP (XCAR (BVAR (current_buffer, undo_list)))) 299 && NILP (XCAR (BVAR (current_buffer, undo_list)))
300 /* Only remove auto-added boundaries, not boundaries
301 added be explicit calls to undo-boundary. */
302 && EQ (BVAR (current_buffer, undo_list), last_undo_boundary))
300 /* Remove the undo_boundary that was just pushed. */ 303 /* Remove the undo_boundary that was just pushed. */
301 BVAR (current_buffer, undo_list) = XCDR (BVAR (current_buffer, undo_list)); 304 BVAR (current_buffer, undo_list) = XCDR (BVAR (current_buffer, undo_list));
302 305
diff --git a/src/keyboard.c b/src/keyboard.c
index 963f40a2e32..9f3bc478447 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1318,6 +1318,9 @@ cancel_hourglass_unwind (Lisp_Object arg)
1318} 1318}
1319#endif 1319#endif
1320 1320
1321/* The last boundary auto-added to buffer-undo-list. */
1322Lisp_Object last_undo_boundary;
1323
1321/* FIXME: This is wrong rather than test window-system, we should call 1324/* FIXME: This is wrong rather than test window-system, we should call
1322 a new set-selection, which will then dispatch to x-set-selection, or 1325 a new set-selection, which will then dispatch to x-set-selection, or
1323 tty-set-selection, or w32-set-selection, ... */ 1326 tty-set-selection, or w32-set-selection, ... */
@@ -1565,7 +1568,13 @@ command_loop_1 (void)
1565#endif 1568#endif
1566 1569
1567 if (NILP (KVAR (current_kboard, Vprefix_arg))) /* FIXME: Why? --Stef */ 1570 if (NILP (KVAR (current_kboard, Vprefix_arg))) /* FIXME: Why? --Stef */
1568 Fundo_boundary (); 1571 {
1572 Lisp_Object undo = BVAR (current_buffer, undo_list);
1573 Fundo_boundary ();
1574 last_undo_boundary
1575 = (EQ (undo, BVAR (current_buffer, undo_list))
1576 ? Qnil : BVAR (current_buffer, undo_list));
1577 }
1569 Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil); 1578 Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
1570 1579
1571#ifdef HAVE_WINDOW_SYSTEM 1580#ifdef HAVE_WINDOW_SYSTEM
diff --git a/src/lisp.h b/src/lisp.h
index 4bd0b785618..4dd9f37ca66 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2921,7 +2921,7 @@ extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t);
2921extern void syms_of_search (void); 2921extern void syms_of_search (void);
2922extern void clear_regexp_cache (void); 2922extern void clear_regexp_cache (void);
2923 2923
2924/* Defined in minibuf.c */ 2924/* Defined in minibuf.c. */
2925 2925
2926extern Lisp_Object Qcompletion_ignore_case; 2926extern Lisp_Object Qcompletion_ignore_case;
2927extern Lisp_Object Vminibuffer_list; 2927extern Lisp_Object Vminibuffer_list;
@@ -2930,25 +2930,25 @@ extern Lisp_Object get_minibuffer (EMACS_INT);
2930extern void init_minibuf_once (void); 2930extern void init_minibuf_once (void);
2931extern void syms_of_minibuf (void); 2931extern void syms_of_minibuf (void);
2932 2932
2933/* Defined in callint.c */ 2933/* Defined in callint.c. */
2934 2934
2935extern Lisp_Object Qminus, Qplus; 2935extern Lisp_Object Qminus, Qplus;
2936extern Lisp_Object Qwhen; 2936extern Lisp_Object Qwhen;
2937extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook; 2937extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook;
2938extern void syms_of_callint (void); 2938extern void syms_of_callint (void);
2939 2939
2940/* Defined in casefiddle.c */ 2940/* Defined in casefiddle.c. */
2941 2941
2942extern Lisp_Object Qidentity; 2942extern Lisp_Object Qidentity;
2943extern void syms_of_casefiddle (void); 2943extern void syms_of_casefiddle (void);
2944extern void keys_of_casefiddle (void); 2944extern void keys_of_casefiddle (void);
2945 2945
2946/* Defined in casetab.c */ 2946/* Defined in casetab.c. */
2947 2947
2948extern void init_casetab_once (void); 2948extern void init_casetab_once (void);
2949extern void syms_of_casetab (void); 2949extern void syms_of_casetab (void);
2950 2950
2951/* Defined in keyboard.c */ 2951/* Defined in keyboard.c. */
2952 2952
2953extern Lisp_Object echo_message_buffer; 2953extern Lisp_Object echo_message_buffer;
2954extern struct kboard *echo_kboard; 2954extern struct kboard *echo_kboard;
@@ -2956,6 +2956,7 @@ extern void cancel_echoing (void);
2956extern Lisp_Object Qdisabled, QCfilter; 2956extern Lisp_Object Qdisabled, QCfilter;
2957extern Lisp_Object Qup, Qdown, Qbottom; 2957extern Lisp_Object Qup, Qdown, Qbottom;
2958extern Lisp_Object Qtop; 2958extern Lisp_Object Qtop;
2959extern Lisp_Object last_undo_boundary;
2959extern int input_pending; 2960extern int input_pending;
2960extern Lisp_Object menu_bar_items (Lisp_Object); 2961extern Lisp_Object menu_bar_items (Lisp_Object);
2961extern Lisp_Object tool_bar_items (Lisp_Object, int *); 2962extern Lisp_Object tool_bar_items (Lisp_Object, int *);
@@ -2976,13 +2977,13 @@ extern void init_keyboard (void);
2976extern void syms_of_keyboard (void); 2977extern void syms_of_keyboard (void);
2977extern void keys_of_keyboard (void); 2978extern void keys_of_keyboard (void);
2978 2979
2979/* Defined in indent.c */ 2980/* Defined in indent.c. */
2980extern ptrdiff_t current_column (void); 2981extern ptrdiff_t current_column (void);
2981extern void invalidate_current_column (void); 2982extern void invalidate_current_column (void);
2982extern int indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT); 2983extern int indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT);
2983extern void syms_of_indent (void); 2984extern void syms_of_indent (void);
2984 2985
2985/* Defined in frame.c */ 2986/* Defined in frame.c. */
2986extern Lisp_Object Qonly; 2987extern Lisp_Object Qonly;
2987extern Lisp_Object Qvisible; 2988extern Lisp_Object Qvisible;
2988extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object); 2989extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object);
@@ -2995,7 +2996,7 @@ extern Lisp_Object frame_buffer_predicate (Lisp_Object);
2995extern void frames_discard_buffer (Lisp_Object); 2996extern void frames_discard_buffer (Lisp_Object);
2996extern void syms_of_frame (void); 2997extern void syms_of_frame (void);
2997 2998
2998/* Defined in emacs.c */ 2999/* Defined in emacs.c. */
2999extern char **initial_argv; 3000extern char **initial_argv;
3000extern int initial_argc; 3001extern int initial_argc;
3001#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) 3002#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)