diff options
| author | Stefan Monnier | 2012-07-18 09:20:59 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-07-18 09:20:59 -0400 |
| commit | 464d5a5e1f95378b8fef2b70dd6aee4486a352da (patch) | |
| tree | c530fadef545533b1f04c8c121cf51e39446f69b /src | |
| parent | a4acb88d3582144556a668c6cc35082e4d6a82f1 (diff) | |
| download | emacs-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/ChangeLog | 7 | ||||
| -rw-r--r-- | src/cmds.c | 5 | ||||
| -rw-r--r-- | src/keyboard.c | 11 | ||||
| -rw-r--r-- | src/lisp.h | 17 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-07-18 Andreas Schwab <schwab@linux-m68k.org> | 8 | 2012-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. */ | ||
| 1322 | Lisp_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); | |||
| 2921 | extern void syms_of_search (void); | 2921 | extern void syms_of_search (void); |
| 2922 | extern void clear_regexp_cache (void); | 2922 | extern void clear_regexp_cache (void); |
| 2923 | 2923 | ||
| 2924 | /* Defined in minibuf.c */ | 2924 | /* Defined in minibuf.c. */ |
| 2925 | 2925 | ||
| 2926 | extern Lisp_Object Qcompletion_ignore_case; | 2926 | extern Lisp_Object Qcompletion_ignore_case; |
| 2927 | extern Lisp_Object Vminibuffer_list; | 2927 | extern Lisp_Object Vminibuffer_list; |
| @@ -2930,25 +2930,25 @@ extern Lisp_Object get_minibuffer (EMACS_INT); | |||
| 2930 | extern void init_minibuf_once (void); | 2930 | extern void init_minibuf_once (void); |
| 2931 | extern void syms_of_minibuf (void); | 2931 | extern void syms_of_minibuf (void); |
| 2932 | 2932 | ||
| 2933 | /* Defined in callint.c */ | 2933 | /* Defined in callint.c. */ |
| 2934 | 2934 | ||
| 2935 | extern Lisp_Object Qminus, Qplus; | 2935 | extern Lisp_Object Qminus, Qplus; |
| 2936 | extern Lisp_Object Qwhen; | 2936 | extern Lisp_Object Qwhen; |
| 2937 | extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook; | 2937 | extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook; |
| 2938 | extern void syms_of_callint (void); | 2938 | extern void syms_of_callint (void); |
| 2939 | 2939 | ||
| 2940 | /* Defined in casefiddle.c */ | 2940 | /* Defined in casefiddle.c. */ |
| 2941 | 2941 | ||
| 2942 | extern Lisp_Object Qidentity; | 2942 | extern Lisp_Object Qidentity; |
| 2943 | extern void syms_of_casefiddle (void); | 2943 | extern void syms_of_casefiddle (void); |
| 2944 | extern void keys_of_casefiddle (void); | 2944 | extern void keys_of_casefiddle (void); |
| 2945 | 2945 | ||
| 2946 | /* Defined in casetab.c */ | 2946 | /* Defined in casetab.c. */ |
| 2947 | 2947 | ||
| 2948 | extern void init_casetab_once (void); | 2948 | extern void init_casetab_once (void); |
| 2949 | extern void syms_of_casetab (void); | 2949 | extern void syms_of_casetab (void); |
| 2950 | 2950 | ||
| 2951 | /* Defined in keyboard.c */ | 2951 | /* Defined in keyboard.c. */ |
| 2952 | 2952 | ||
| 2953 | extern Lisp_Object echo_message_buffer; | 2953 | extern Lisp_Object echo_message_buffer; |
| 2954 | extern struct kboard *echo_kboard; | 2954 | extern struct kboard *echo_kboard; |
| @@ -2956,6 +2956,7 @@ extern void cancel_echoing (void); | |||
| 2956 | extern Lisp_Object Qdisabled, QCfilter; | 2956 | extern Lisp_Object Qdisabled, QCfilter; |
| 2957 | extern Lisp_Object Qup, Qdown, Qbottom; | 2957 | extern Lisp_Object Qup, Qdown, Qbottom; |
| 2958 | extern Lisp_Object Qtop; | 2958 | extern Lisp_Object Qtop; |
| 2959 | extern Lisp_Object last_undo_boundary; | ||
| 2959 | extern int input_pending; | 2960 | extern int input_pending; |
| 2960 | extern Lisp_Object menu_bar_items (Lisp_Object); | 2961 | extern Lisp_Object menu_bar_items (Lisp_Object); |
| 2961 | extern Lisp_Object tool_bar_items (Lisp_Object, int *); | 2962 | extern Lisp_Object tool_bar_items (Lisp_Object, int *); |
| @@ -2976,13 +2977,13 @@ extern void init_keyboard (void); | |||
| 2976 | extern void syms_of_keyboard (void); | 2977 | extern void syms_of_keyboard (void); |
| 2977 | extern void keys_of_keyboard (void); | 2978 | extern void keys_of_keyboard (void); |
| 2978 | 2979 | ||
| 2979 | /* Defined in indent.c */ | 2980 | /* Defined in indent.c. */ |
| 2980 | extern ptrdiff_t current_column (void); | 2981 | extern ptrdiff_t current_column (void); |
| 2981 | extern void invalidate_current_column (void); | 2982 | extern void invalidate_current_column (void); |
| 2982 | extern int indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT); | 2983 | extern int indented_beyond_p (ptrdiff_t, ptrdiff_t, EMACS_INT); |
| 2983 | extern void syms_of_indent (void); | 2984 | extern void syms_of_indent (void); |
| 2984 | 2985 | ||
| 2985 | /* Defined in frame.c */ | 2986 | /* Defined in frame.c. */ |
| 2986 | extern Lisp_Object Qonly; | 2987 | extern Lisp_Object Qonly; |
| 2987 | extern Lisp_Object Qvisible; | 2988 | extern Lisp_Object Qvisible; |
| 2988 | extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object); | 2989 | extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object); |
| @@ -2995,7 +2996,7 @@ extern Lisp_Object frame_buffer_predicate (Lisp_Object); | |||
| 2995 | extern void frames_discard_buffer (Lisp_Object); | 2996 | extern void frames_discard_buffer (Lisp_Object); |
| 2996 | extern void syms_of_frame (void); | 2997 | extern void syms_of_frame (void); |
| 2997 | 2998 | ||
| 2998 | /* Defined in emacs.c */ | 2999 | /* Defined in emacs.c. */ |
| 2999 | extern char **initial_argv; | 3000 | extern char **initial_argv; |
| 3000 | extern int initial_argc; | 3001 | extern int initial_argc; |
| 3001 | #if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) | 3002 | #if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) |