aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2003-02-04 11:51:40 +0000
committerRichard M. Stallman2003-02-04 11:51:40 +0000
commit22b94eeb2cda1be98f8cc6ac9b86e567ad221ab4 (patch)
treeda76f5ee371355634f1ca211a1fa1dff05fbc862 /src
parent6e0bffe6209f6d66a119b15a07c947abaa799dea (diff)
downloademacs-22b94eeb2cda1be98f8cc6ac9b86e567ad221ab4.tar.gz
emacs-22b94eeb2cda1be98f8cc6ac9b86e567ad221ab4.zip
(echo_now): Update before_command_echo_length.
(Freset_this_command_lengths): Reset this_command_key_count etc. immediately rather than arranging to do it later. (before_command_key_count_1, before_command_echo_length_1) (before_command_restore_flag): Vars deleted. (add_command_key): Don't handle before_command_restore_flag. (read_char, record_menu_key): Don't update before_command_key_count or before_command_echo_length. (read_char): Don't handle before_command_restore_flag. (command_loop_1): Don't call adjust_point_for_property in direct-output clauses if it wouldn't be called in the ordinary case.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c58
1 files changed, 40 insertions, 18 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 16de5d24239..704aebccba5 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -169,13 +169,6 @@ int this_single_command_key_start;
169 before this command was read. */ 169 before this command was read. */
170static int before_command_key_count; 170static int before_command_key_count;
171static int before_command_echo_length; 171static int before_command_echo_length;
172/* Values of before_command_key_count and before_command_echo_length
173 saved by reset-this-command-lengths. */
174static int before_command_key_count_1;
175static int before_command_echo_length_1;
176/* Flag set by reset-this-command-lengths,
177 saying to reset the lengths when add_command_key is called. */
178static int before_command_restore_flag;
179 172
180extern int minbuf_level; 173extern int minbuf_level;
181 174
@@ -603,6 +596,7 @@ extern Lisp_Object Vhistory_length, Vtranslation_table_for_input;
603extern char *x_get_keysym_name (); 596extern char *x_get_keysym_name ();
604 597
605static void record_menu_key (); 598static void record_menu_key ();
599static int echo_length ();
606 600
607Lisp_Object Qpolling_period; 601Lisp_Object Qpolling_period;
608 602
@@ -847,11 +841,26 @@ echo_now ()
847 for (i = 0; i < this_command_key_count; i++) 841 for (i = 0; i < this_command_key_count; i++)
848 { 842 {
849 Lisp_Object c; 843 Lisp_Object c;
844
845 /* Set before_command_echo_length to the value that would
846 have been saved before the start of this subcommand in
847 command_loop_1, if we had already been echoing then. */
848 if (i == this_single_command_key_start)
849 before_command_echo_length = echo_length ();
850
850 c = XVECTOR (this_command_keys)->contents[i]; 851 c = XVECTOR (this_command_keys)->contents[i];
851 if (! (EVENT_HAS_PARAMETERS (c) 852 if (! (EVENT_HAS_PARAMETERS (c)
852 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_movement))) 853 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_movement)))
853 echo_char (c); 854 echo_char (c);
854 } 855 }
856
857 /* Set before_command_echo_length to the value that would
858 have been saved before the start of this subcommand in
859 command_loop_1, if we had already been echoing then. */
860 if (this_command_key_count == this_single_command_key_start)
861 before_command_echo_length = echo_length ();
862
863 /* Put a dash at the end to invite the user to type more. */
855 echo_dash (); 864 echo_dash ();
856 } 865 }
857 866
@@ -913,6 +922,8 @@ static void
913add_command_key (key) 922add_command_key (key)
914 Lisp_Object key; 923 Lisp_Object key;
915{ 924{
925#if 0 /* Not needed after we made Freset_this_command_lengths
926 do the job immediately. */
916 /* If reset-this-command-length was called recently, obey it now. 927 /* If reset-this-command-length was called recently, obey it now.
917 See the doc string of that function for an explanation of why. */ 928 See the doc string of that function for an explanation of why. */
918 if (before_command_restore_flag) 929 if (before_command_restore_flag)
@@ -923,6 +934,7 @@ add_command_key (key)
923 echo_truncate (before_command_echo_length_1); 934 echo_truncate (before_command_echo_length_1);
924 before_command_restore_flag = 0; 935 before_command_restore_flag = 0;
925 } 936 }
937#endif
926 938
927 if (this_command_key_count >= ASIZE (this_command_keys)) 939 if (this_command_key_count >= ASIZE (this_command_keys))
928 this_command_keys = larger_vector (this_command_keys, 940 this_command_keys = larger_vector (this_command_keys,
@@ -1587,7 +1599,11 @@ command_loop_1 ()
1587 /* Put this before calling adjust_point_for_property 1599 /* Put this before calling adjust_point_for_property
1588 so it will only get called once in any case. */ 1600 so it will only get called once in any case. */
1589 goto directly_done; 1601 goto directly_done;
1590 adjust_point_for_property (last_point_position, 0); 1602 if (current_buffer == prev_buffer
1603 && last_point_position != PT
1604 && NILP (Vdisable_point_adjustment)
1605 && NILP (Vglobal_disable_point_adjustment))
1606 adjust_point_for_property (last_point_position, 0);
1591 already_adjusted = 1; 1607 already_adjusted = 1;
1592 if (PT == last_point_position + 1 1608 if (PT == last_point_position + 1
1593 && (dp 1609 && (dp
@@ -1621,7 +1637,11 @@ command_loop_1 ()
1621 lose = FETCH_CHAR (PT_BYTE); 1637 lose = FETCH_CHAR (PT_BYTE);
1622 if (! NILP (Vpost_command_hook)) 1638 if (! NILP (Vpost_command_hook))
1623 goto directly_done; 1639 goto directly_done;
1624 adjust_point_for_property (last_point_position, 0); 1640 if (current_buffer == prev_buffer
1641 && last_point_position != PT
1642 && NILP (Vdisable_point_adjustment)
1643 && NILP (Vglobal_disable_point_adjustment))
1644 adjust_point_for_property (last_point_position, 0);
1625 already_adjusted = 1; 1645 already_adjusted = 1;
1626 if (PT == last_point_position - 1 1646 if (PT == last_point_position - 1
1627 && (dp 1647 && (dp
@@ -2289,8 +2309,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2289 2309
2290 also_record = Qnil; 2310 also_record = Qnil;
2291 2311
2312#if 0 /* This was commented out as part of fixing echo for C-u left. */
2292 before_command_key_count = this_command_key_count; 2313 before_command_key_count = this_command_key_count;
2293 before_command_echo_length = echo_length (); 2314 before_command_echo_length = echo_length ();
2315#endif
2294 c = Qnil; 2316 c = Qnil;
2295 previous_echo_area_message = Qnil; 2317 previous_echo_area_message = Qnil;
2296 2318
@@ -2362,10 +2384,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2362 goto reread_for_input_method; 2384 goto reread_for_input_method;
2363 } 2385 }
2364 2386
2365 /* If there is no function key translated before
2366 reset-this-command-lengths takes effect, forget about it. */
2367 before_command_restore_flag = 0;
2368
2369 if (!NILP (Vexecuting_macro)) 2387 if (!NILP (Vexecuting_macro))
2370 { 2388 {
2371 /* We set this to Qmacro; since that's not a frame, nobody will 2389 /* We set this to Qmacro; since that's not a frame, nobody will
@@ -2940,6 +2958,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2940 struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause; 2958 struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause;
2941 int saved_echo_after_prompt = current_kboard->echo_after_prompt; 2959 int saved_echo_after_prompt = current_kboard->echo_after_prompt;
2942 2960
2961#if 0
2943 if (before_command_restore_flag) 2962 if (before_command_restore_flag)
2944 { 2963 {
2945 this_command_key_count = before_command_key_count_1; 2964 this_command_key_count = before_command_key_count_1;
@@ -2948,6 +2967,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2948 echo_truncate (before_command_echo_length_1); 2967 echo_truncate (before_command_echo_length_1);
2949 before_command_restore_flag = 0; 2968 before_command_restore_flag = 0;
2950 } 2969 }
2970#endif
2951 2971
2952 /* Save the this_command_keys status. */ 2972 /* Save the this_command_keys status. */
2953 key_count = this_command_key_count; 2973 key_count = this_command_key_count;
@@ -3033,8 +3053,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
3033 3053
3034 if (this_command_key_count == 0 || ! reread) 3054 if (this_command_key_count == 0 || ! reread)
3035 { 3055 {
3036 before_command_key_count = this_command_key_count;
3037 before_command_echo_length = echo_length ();
3038 3056
3039 /* Don't echo mouse motion events. */ 3057 /* Don't echo mouse motion events. */
3040 if ((FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes)) 3058 if ((FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
@@ -3106,8 +3124,10 @@ record_menu_key (c)
3106 3124
3107 record_char (c); 3125 record_char (c);
3108 3126
3127#if 0
3109 before_command_key_count = this_command_key_count; 3128 before_command_key_count = this_command_key_count;
3110 before_command_echo_length = echo_length (); 3129 before_command_echo_length = echo_length ();
3130#endif
3111 3131
3112 /* Don't echo mouse motion events. */ 3132 /* Don't echo mouse motion events. */
3113 if ((FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes)) 3133 if ((FLOATP (Vecho_keystrokes) || INTEGERP (Vecho_keystrokes))
@@ -9884,9 +9904,11 @@ the original event, so that only one version of the event actually
9884appears in the echo area and in the value of `this-command-keys'. */) 9904appears in the echo area and in the value of `this-command-keys'. */)
9885 () 9905 ()
9886{ 9906{
9887 before_command_restore_flag = 1; 9907 this_command_key_count = before_command_key_count;
9888 before_command_key_count_1 = before_command_key_count; 9908 if (this_command_key_count < this_single_command_key_start)
9889 before_command_echo_length_1 = before_command_echo_length; 9909 this_single_command_key_start = this_command_key_count;
9910 echo_truncate (before_command_echo_length);
9911
9890 return Qnil; 9912 return Qnil;
9891} 9913}
9892 9914