diff options
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 153 |
1 files changed, 79 insertions, 74 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 26407785c86..318ada35eb3 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -122,7 +122,7 @@ static Lisp_Object recent_keys; | |||
| 122 | actually mean something. | 122 | actually mean something. |
| 123 | It's easier to staticpro a single Lisp_Object than an array. */ | 123 | It's easier to staticpro a single Lisp_Object than an array. */ |
| 124 | Lisp_Object this_command_keys; | 124 | Lisp_Object this_command_keys; |
| 125 | int this_command_key_count; | 125 | ptrdiff_t this_command_key_count; |
| 126 | 126 | ||
| 127 | /* 1 after calling Freset_this_command_lengths. | 127 | /* 1 after calling Freset_this_command_lengths. |
| 128 | Usually it is 0. */ | 128 | Usually it is 0. */ |
| @@ -135,16 +135,16 @@ static int raw_keybuf_count; | |||
| 135 | 135 | ||
| 136 | #define GROW_RAW_KEYBUF \ | 136 | #define GROW_RAW_KEYBUF \ |
| 137 | if (raw_keybuf_count == ASIZE (raw_keybuf)) \ | 137 | if (raw_keybuf_count == ASIZE (raw_keybuf)) \ |
| 138 | raw_keybuf = larger_vector (raw_keybuf, raw_keybuf_count * 2, Qnil) \ | 138 | raw_keybuf = larger_vector (raw_keybuf, 1, -1) |
| 139 | 139 | ||
| 140 | /* Number of elements of this_command_keys | 140 | /* Number of elements of this_command_keys |
| 141 | that precede this key sequence. */ | 141 | that precede this key sequence. */ |
| 142 | static int this_single_command_key_start; | 142 | static ptrdiff_t this_single_command_key_start; |
| 143 | 143 | ||
| 144 | /* Record values of this_command_key_count and echo_length () | 144 | /* Record values of this_command_key_count and echo_length () |
| 145 | before this command was read. */ | 145 | before this command was read. */ |
| 146 | static int before_command_key_count; | 146 | static ptrdiff_t before_command_key_count; |
| 147 | static int before_command_echo_length; | 147 | static ptrdiff_t before_command_echo_length; |
| 148 | 148 | ||
| 149 | /* For longjmp to where kbd input is being done. */ | 149 | /* For longjmp to where kbd input is being done. */ |
| 150 | 150 | ||
| @@ -208,20 +208,20 @@ EMACS_INT command_loop_level; | |||
| 208 | Lisp_Object unread_switch_frame; | 208 | Lisp_Object unread_switch_frame; |
| 209 | 209 | ||
| 210 | /* Last size recorded for a current buffer which is not a minibuffer. */ | 210 | /* Last size recorded for a current buffer which is not a minibuffer. */ |
| 211 | static EMACS_INT last_non_minibuf_size; | 211 | static ptrdiff_t last_non_minibuf_size; |
| 212 | 212 | ||
| 213 | /* Total number of times read_char has returned, modulo UINTMAX_MAX + 1. */ | 213 | /* Total number of times read_char has returned, modulo UINTMAX_MAX + 1. */ |
| 214 | uintmax_t num_input_events; | 214 | uintmax_t num_input_events; |
| 215 | 215 | ||
| 216 | /* Value of num_nonmacro_input_events as of last auto save. */ | 216 | /* Value of num_nonmacro_input_events as of last auto save. */ |
| 217 | 217 | ||
| 218 | static int last_auto_save; | 218 | static EMACS_INT last_auto_save; |
| 219 | 219 | ||
| 220 | /* This is like Vthis_command, except that commands never set it. */ | 220 | /* This is like Vthis_command, except that commands never set it. */ |
| 221 | Lisp_Object real_this_command; | 221 | Lisp_Object real_this_command; |
| 222 | 222 | ||
| 223 | /* The value of point when the last command was started. */ | 223 | /* The value of point when the last command was started. */ |
| 224 | static EMACS_INT last_point_position; | 224 | static ptrdiff_t last_point_position; |
| 225 | 225 | ||
| 226 | /* The buffer that was current when the last command was started. */ | 226 | /* The buffer that was current when the last command was started. */ |
| 227 | static Lisp_Object last_point_position_buffer; | 227 | static Lisp_Object last_point_position_buffer; |
| @@ -375,7 +375,7 @@ EMACS_TIME timer_check (void); | |||
| 375 | 375 | ||
| 376 | static void record_menu_key (Lisp_Object c); | 376 | static void record_menu_key (Lisp_Object c); |
| 377 | static void echo_now (void); | 377 | static void echo_now (void); |
| 378 | static int echo_length (void); | 378 | static ptrdiff_t echo_length (void); |
| 379 | 379 | ||
| 380 | static Lisp_Object Qpolling_period; | 380 | static Lisp_Object Qpolling_period; |
| 381 | 381 | ||
| @@ -446,9 +446,9 @@ static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object, | |||
| 446 | Lisp_Object, Lisp_Object, | 446 | Lisp_Object, Lisp_Object, |
| 447 | Time); | 447 | Time); |
| 448 | #endif | 448 | #endif |
| 449 | static Lisp_Object modify_event_symbol (EMACS_INT, unsigned, Lisp_Object, | 449 | static Lisp_Object modify_event_symbol (ptrdiff_t, int, Lisp_Object, |
| 450 | Lisp_Object, const char *const *, | 450 | Lisp_Object, const char *const *, |
| 451 | Lisp_Object *, EMACS_INT); | 451 | Lisp_Object *, ptrdiff_t); |
| 452 | static Lisp_Object make_lispy_switch_frame (Lisp_Object); | 452 | static Lisp_Object make_lispy_switch_frame (Lisp_Object); |
| 453 | static int help_char_p (Lisp_Object); | 453 | static int help_char_p (Lisp_Object); |
| 454 | static void save_getcjmp (jmp_buf); | 454 | static void save_getcjmp (jmp_buf); |
| @@ -612,7 +612,7 @@ echo_now (void) | |||
| 612 | { | 612 | { |
| 613 | if (!current_kboard->immediate_echo) | 613 | if (!current_kboard->immediate_echo) |
| 614 | { | 614 | { |
| 615 | int i; | 615 | ptrdiff_t i; |
| 616 | current_kboard->immediate_echo = 1; | 616 | current_kboard->immediate_echo = 1; |
| 617 | 617 | ||
| 618 | for (i = 0; i < this_command_key_count; i++) | 618 | for (i = 0; i < this_command_key_count; i++) |
| @@ -670,7 +670,7 @@ cancel_echoing (void) | |||
| 670 | 670 | ||
| 671 | /* Return the length of the current echo string. */ | 671 | /* Return the length of the current echo string. */ |
| 672 | 672 | ||
| 673 | static int | 673 | static ptrdiff_t |
| 674 | echo_length (void) | 674 | echo_length (void) |
| 675 | { | 675 | { |
| 676 | return (STRINGP (KVAR (current_kboard, echo_string)) | 676 | return (STRINGP (KVAR (current_kboard, echo_string)) |
| @@ -683,7 +683,7 @@ echo_length (void) | |||
| 683 | switches frames while entering a key sequence. */ | 683 | switches frames while entering a key sequence. */ |
| 684 | 684 | ||
| 685 | static void | 685 | static void |
| 686 | echo_truncate (EMACS_INT nchars) | 686 | echo_truncate (ptrdiff_t nchars) |
| 687 | { | 687 | { |
| 688 | if (STRINGP (KVAR (current_kboard, echo_string))) | 688 | if (STRINGP (KVAR (current_kboard, echo_string))) |
| 689 | KVAR (current_kboard, echo_string) | 689 | KVAR (current_kboard, echo_string) |
| @@ -712,9 +712,7 @@ add_command_key (Lisp_Object key) | |||
| 712 | #endif | 712 | #endif |
| 713 | 713 | ||
| 714 | if (this_command_key_count >= ASIZE (this_command_keys)) | 714 | if (this_command_key_count >= ASIZE (this_command_keys)) |
| 715 | this_command_keys = larger_vector (this_command_keys, | 715 | this_command_keys = larger_vector (this_command_keys, 1, -1); |
| 716 | 2 * ASIZE (this_command_keys), | ||
| 717 | Qnil); | ||
| 718 | 716 | ||
| 719 | ASET (this_command_keys, this_command_key_count, key); | 717 | ASET (this_command_keys, this_command_key_count, key); |
| 720 | ++this_command_key_count; | 718 | ++this_command_key_count; |
| @@ -724,7 +722,7 @@ add_command_key (Lisp_Object key) | |||
| 724 | Lisp_Object | 722 | Lisp_Object |
| 725 | recursive_edit_1 (void) | 723 | recursive_edit_1 (void) |
| 726 | { | 724 | { |
| 727 | int count = SPECPDL_INDEX (); | 725 | ptrdiff_t count = SPECPDL_INDEX (); |
| 728 | Lisp_Object val; | 726 | Lisp_Object val; |
| 729 | 727 | ||
| 730 | if (command_loop_level > 0) | 728 | if (command_loop_level > 0) |
| @@ -792,7 +790,7 @@ Alternatively, `(throw 'exit t)' makes this function signal an error. | |||
| 792 | This function is called by the editor initialization to begin editing. */) | 790 | This function is called by the editor initialization to begin editing. */) |
| 793 | (void) | 791 | (void) |
| 794 | { | 792 | { |
| 795 | int count = SPECPDL_INDEX (); | 793 | ptrdiff_t count = SPECPDL_INDEX (); |
| 796 | Lisp_Object buffer; | 794 | Lisp_Object buffer; |
| 797 | 795 | ||
| 798 | /* If we enter while input is blocked, don't lock up here. | 796 | /* If we enter while input is blocked, don't lock up here. |
| @@ -1253,7 +1251,7 @@ Normally, mouse motion is ignored. | |||
| 1253 | usage: (track-mouse BODY...) */) | 1251 | usage: (track-mouse BODY...) */) |
| 1254 | (Lisp_Object args) | 1252 | (Lisp_Object args) |
| 1255 | { | 1253 | { |
| 1256 | int count = SPECPDL_INDEX (); | 1254 | ptrdiff_t count = SPECPDL_INDEX (); |
| 1257 | Lisp_Object val; | 1255 | Lisp_Object val; |
| 1258 | 1256 | ||
| 1259 | record_unwind_protect (tracking_off, do_mouse_tracking); | 1257 | record_unwind_protect (tracking_off, do_mouse_tracking); |
| @@ -1304,7 +1302,7 @@ some_mouse_moved (void) | |||
| 1304 | static int read_key_sequence (Lisp_Object *, int, Lisp_Object, | 1302 | static int read_key_sequence (Lisp_Object *, int, Lisp_Object, |
| 1305 | int, int, int); | 1303 | int, int, int); |
| 1306 | void safe_run_hooks (Lisp_Object); | 1304 | void safe_run_hooks (Lisp_Object); |
| 1307 | static void adjust_point_for_property (EMACS_INT, int); | 1305 | static void adjust_point_for_property (ptrdiff_t, int); |
| 1308 | 1306 | ||
| 1309 | /* Cancel hourglass from protect_unwind. | 1307 | /* Cancel hourglass from protect_unwind. |
| 1310 | ARG is not used. */ | 1308 | ARG is not used. */ |
| @@ -1328,7 +1326,7 @@ command_loop_1 (void) | |||
| 1328 | Lisp_Object cmd; | 1326 | Lisp_Object cmd; |
| 1329 | Lisp_Object keybuf[30]; | 1327 | Lisp_Object keybuf[30]; |
| 1330 | int i; | 1328 | int i; |
| 1331 | int prev_modiff = 0; | 1329 | EMACS_INT prev_modiff = 0; |
| 1332 | struct buffer *prev_buffer = NULL; | 1330 | struct buffer *prev_buffer = NULL; |
| 1333 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ | 1331 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ |
| 1334 | int was_locked = single_kboard; | 1332 | int was_locked = single_kboard; |
| @@ -1400,7 +1398,7 @@ command_loop_1 (void) | |||
| 1400 | { | 1398 | { |
| 1401 | /* Bind inhibit-quit to t so that C-g gets read in | 1399 | /* Bind inhibit-quit to t so that C-g gets read in |
| 1402 | rather than quitting back to the minibuffer. */ | 1400 | rather than quitting back to the minibuffer. */ |
| 1403 | int count = SPECPDL_INDEX (); | 1401 | ptrdiff_t count = SPECPDL_INDEX (); |
| 1404 | specbind (Qinhibit_quit, Qt); | 1402 | specbind (Qinhibit_quit, Qt); |
| 1405 | 1403 | ||
| 1406 | sit_for (Vminibuffer_message_timeout, 0, 2); | 1404 | sit_for (Vminibuffer_message_timeout, 0, 2); |
| @@ -1558,7 +1556,7 @@ command_loop_1 (void) | |||
| 1558 | /* Here for a command that isn't executed directly */ | 1556 | /* Here for a command that isn't executed directly */ |
| 1559 | 1557 | ||
| 1560 | #ifdef HAVE_WINDOW_SYSTEM | 1558 | #ifdef HAVE_WINDOW_SYSTEM |
| 1561 | int scount = SPECPDL_INDEX (); | 1559 | ptrdiff_t scount = SPECPDL_INDEX (); |
| 1562 | 1560 | ||
| 1563 | if (display_hourglass_p | 1561 | if (display_hourglass_p |
| 1564 | && NILP (Vexecuting_kbd_macro)) | 1562 | && NILP (Vexecuting_kbd_macro)) |
| @@ -1651,9 +1649,9 @@ command_loop_1 (void) | |||
| 1651 | && !NILP (Vtransient_mark_mode))) | 1649 | && !NILP (Vtransient_mark_mode))) |
| 1652 | && !EQ (Vthis_command, Qhandle_switch_frame)) | 1650 | && !EQ (Vthis_command, Qhandle_switch_frame)) |
| 1653 | { | 1651 | { |
| 1654 | EMACS_INT beg = | 1652 | ptrdiff_t beg = |
| 1655 | XINT (Fmarker_position (BVAR (current_buffer, mark))); | 1653 | XINT (Fmarker_position (BVAR (current_buffer, mark))); |
| 1656 | EMACS_INT end = PT; | 1654 | ptrdiff_t end = PT; |
| 1657 | if (beg < end) | 1655 | if (beg < end) |
| 1658 | call2 (Qx_set_selection, QPRIMARY, | 1656 | call2 (Qx_set_selection, QPRIMARY, |
| 1659 | make_buffer_string (beg, end, 0)); | 1657 | make_buffer_string (beg, end, 0)); |
| @@ -1713,16 +1711,16 @@ command_loop_1 (void) | |||
| 1713 | LAST_PT is the last position of point. */ | 1711 | LAST_PT is the last position of point. */ |
| 1714 | 1712 | ||
| 1715 | static void | 1713 | static void |
| 1716 | adjust_point_for_property (EMACS_INT last_pt, int modified) | 1714 | adjust_point_for_property (ptrdiff_t last_pt, int modified) |
| 1717 | { | 1715 | { |
| 1718 | EMACS_INT beg, end; | 1716 | ptrdiff_t beg, end; |
| 1719 | Lisp_Object val, overlay, tmp; | 1717 | Lisp_Object val, overlay, tmp; |
| 1720 | /* When called after buffer modification, we should temporarily | 1718 | /* When called after buffer modification, we should temporarily |
| 1721 | suppress the point adjustment for automatic composition so that a | 1719 | suppress the point adjustment for automatic composition so that a |
| 1722 | user can keep inserting another character at point or keep | 1720 | user can keep inserting another character at point or keep |
| 1723 | deleting characters around point. */ | 1721 | deleting characters around point. */ |
| 1724 | int check_composition = ! modified, check_display = 1, check_invisible = 1; | 1722 | int check_composition = ! modified, check_display = 1, check_invisible = 1; |
| 1725 | EMACS_INT orig_pt = PT; | 1723 | ptrdiff_t orig_pt = PT; |
| 1726 | 1724 | ||
| 1727 | /* FIXME: cycling is probably not necessary because these properties | 1725 | /* FIXME: cycling is probably not necessary because these properties |
| 1728 | can't be usefully combined anyway. */ | 1726 | can't be usefully combined anyway. */ |
| @@ -1935,7 +1933,7 @@ safe_run_hooks (Lisp_Object hook) | |||
| 1935 | /* FIXME: our `internal_condition_case' does not provide any way to pass data | 1933 | /* FIXME: our `internal_condition_case' does not provide any way to pass data |
| 1936 | to its body or to its handlers other than via globals such as | 1934 | to its body or to its handlers other than via globals such as |
| 1937 | dynamically-bound variables ;-) */ | 1935 | dynamically-bound variables ;-) */ |
| 1938 | int count = SPECPDL_INDEX (); | 1936 | ptrdiff_t count = SPECPDL_INDEX (); |
| 1939 | specbind (Qinhibit_quit, hook); | 1937 | specbind (Qinhibit_quit, hook); |
| 1940 | 1938 | ||
| 1941 | run_hook_with_args (1, &hook, safe_run_hook_funcall); | 1939 | run_hook_with_args (1, &hook, safe_run_hook_funcall); |
| @@ -2273,7 +2271,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2273 | int *used_mouse_menu, struct timeval *end_time) | 2271 | int *used_mouse_menu, struct timeval *end_time) |
| 2274 | { | 2272 | { |
| 2275 | volatile Lisp_Object c; | 2273 | volatile Lisp_Object c; |
| 2276 | int jmpcount; | 2274 | ptrdiff_t jmpcount; |
| 2277 | jmp_buf local_getcjmp; | 2275 | jmp_buf local_getcjmp; |
| 2278 | jmp_buf save_jump; | 2276 | jmp_buf save_jump; |
| 2279 | volatile int key_already_recorded = 0; | 2277 | volatile int key_already_recorded = 0; |
| @@ -2662,7 +2660,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2662 | if (INTERACTIVE && NILP (c)) | 2660 | if (INTERACTIVE && NILP (c)) |
| 2663 | { | 2661 | { |
| 2664 | int delay_level; | 2662 | int delay_level; |
| 2665 | EMACS_INT buffer_size; | 2663 | ptrdiff_t buffer_size; |
| 2666 | 2664 | ||
| 2667 | /* Slow down auto saves logarithmically in size of current buffer, | 2665 | /* Slow down auto saves logarithmically in size of current buffer, |
| 2668 | and garbage collect while we're at it. */ | 2666 | and garbage collect while we're at it. */ |
| @@ -2683,8 +2681,9 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2683 | && XINT (Vauto_save_timeout) > 0) | 2681 | && XINT (Vauto_save_timeout) > 0) |
| 2684 | { | 2682 | { |
| 2685 | Lisp_Object tem0; | 2683 | Lisp_Object tem0; |
| 2686 | int timeout = delay_level * XFASTINT (Vauto_save_timeout) / 4; | 2684 | EMACS_INT timeout = (delay_level |
| 2687 | 2685 | * min (XFASTINT (Vauto_save_timeout) / 4, | |
| 2686 | MOST_POSITIVE_FIXNUM / delay_level)); | ||
| 2688 | save_getcjmp (save_jump); | 2687 | save_getcjmp (save_jump); |
| 2689 | restore_getcjmp (local_getcjmp); | 2688 | restore_getcjmp (local_getcjmp); |
| 2690 | tem0 = sit_for (make_number (timeout), 1, 1); | 2689 | tem0 = sit_for (make_number (timeout), 1, 1); |
| @@ -2878,7 +2877,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 2878 | struct buffer *prev_buffer = current_buffer; | 2877 | struct buffer *prev_buffer = current_buffer; |
| 2879 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ | 2878 | #if 0 /* This shouldn't be necessary anymore. --lorentey */ |
| 2880 | int was_locked = single_kboard; | 2879 | int was_locked = single_kboard; |
| 2881 | int count = SPECPDL_INDEX (); | 2880 | ptrdiff_t count = SPECPDL_INDEX (); |
| 2882 | record_single_kboard_state (); | 2881 | record_single_kboard_state (); |
| 2883 | #endif | 2882 | #endif |
| 2884 | 2883 | ||
| @@ -3000,9 +2999,10 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 3000 | && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127) | 2999 | && ' ' <= XINT (c) && XINT (c) < 256 && XINT (c) != 127) |
| 3001 | { | 3000 | { |
| 3002 | Lisp_Object keys; | 3001 | Lisp_Object keys; |
| 3003 | int key_count, key_count_reset; | 3002 | ptrdiff_t key_count; |
| 3003 | int key_count_reset; | ||
| 3004 | struct gcpro inner_gcpro1; | 3004 | struct gcpro inner_gcpro1; |
| 3005 | int count = SPECPDL_INDEX (); | 3005 | ptrdiff_t count = SPECPDL_INDEX (); |
| 3006 | 3006 | ||
| 3007 | /* Save the echo status. */ | 3007 | /* Save the echo status. */ |
| 3008 | int saved_immediate_echo = current_kboard->immediate_echo; | 3008 | int saved_immediate_echo = current_kboard->immediate_echo; |
| @@ -3139,7 +3139,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, | |||
| 3139 | /* Process the help character specially if enabled */ | 3139 | /* Process the help character specially if enabled */ |
| 3140 | if (!NILP (Vhelp_form) && help_char_p (c)) | 3140 | if (!NILP (Vhelp_form) && help_char_p (c)) |
| 3141 | { | 3141 | { |
| 3142 | int count = SPECPDL_INDEX (); | 3142 | ptrdiff_t count = SPECPDL_INDEX (); |
| 3143 | 3143 | ||
| 3144 | help_form_saved_window_configs | 3144 | help_form_saved_window_configs |
| 3145 | = Fcons (Fcurrent_window_configuration (Qnil), | 3145 | = Fcons (Fcurrent_window_configuration (Qnil), |
| @@ -3299,7 +3299,7 @@ record_char (Lisp_Object c) | |||
| 3299 | 3299 | ||
| 3300 | if (!recorded) | 3300 | if (!recorded) |
| 3301 | { | 3301 | { |
| 3302 | total_keys++; | 3302 | total_keys += total_keys < NUM_RECENT_KEYS; |
| 3303 | ASET (recent_keys, recent_keys_index, c); | 3303 | ASET (recent_keys, recent_keys_index, c); |
| 3304 | if (++recent_keys_index >= NUM_RECENT_KEYS) | 3304 | if (++recent_keys_index >= NUM_RECENT_KEYS) |
| 3305 | recent_keys_index = 0; | 3305 | recent_keys_index = 0; |
| @@ -3668,7 +3668,7 @@ kbd_buffer_unget_event (register struct input_event *event) | |||
| 3668 | 3668 | ||
| 3669 | void | 3669 | void |
| 3670 | gen_help_event (Lisp_Object help, Lisp_Object frame, Lisp_Object window, | 3670 | gen_help_event (Lisp_Object help, Lisp_Object frame, Lisp_Object window, |
| 3671 | Lisp_Object object, EMACS_INT pos) | 3671 | Lisp_Object object, ptrdiff_t pos) |
| 3672 | { | 3672 | { |
| 3673 | struct input_event event; | 3673 | struct input_event event; |
| 3674 | 3674 | ||
| @@ -4418,7 +4418,7 @@ timer_check_2 (void) | |||
| 4418 | { | 4418 | { |
| 4419 | if (NILP (vector[0])) | 4419 | if (NILP (vector[0])) |
| 4420 | { | 4420 | { |
| 4421 | int count = SPECPDL_INDEX (); | 4421 | ptrdiff_t count = SPECPDL_INDEX (); |
| 4422 | Lisp_Object old_deactivate_mark = Vdeactivate_mark; | 4422 | Lisp_Object old_deactivate_mark = Vdeactivate_mark; |
| 4423 | 4423 | ||
| 4424 | /* Mark the timer as triggered to prevent problems if the lisp | 4424 | /* Mark the timer as triggered to prevent problems if the lisp |
| @@ -5129,7 +5129,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, | |||
| 5129 | /* It's a click in window window at frame coordinates (x,y) */ | 5129 | /* It's a click in window window at frame coordinates (x,y) */ |
| 5130 | struct window *w = XWINDOW (window); | 5130 | struct window *w = XWINDOW (window); |
| 5131 | Lisp_Object string_info = Qnil; | 5131 | Lisp_Object string_info = Qnil; |
| 5132 | EMACS_INT textpos = -1; | 5132 | ptrdiff_t textpos = -1; |
| 5133 | int col = -1, row = -1; | 5133 | int col = -1, row = -1; |
| 5134 | int dx = -1, dy = -1; | 5134 | int dx = -1, dy = -1; |
| 5135 | int width = -1, height = -1; | 5135 | int width = -1, height = -1; |
| @@ -5153,7 +5153,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, | |||
| 5153 | else if (part == ON_MODE_LINE || part == ON_HEADER_LINE) | 5153 | else if (part == ON_MODE_LINE || part == ON_HEADER_LINE) |
| 5154 | { | 5154 | { |
| 5155 | Lisp_Object string; | 5155 | Lisp_Object string; |
| 5156 | EMACS_INT charpos; | 5156 | ptrdiff_t charpos; |
| 5157 | 5157 | ||
| 5158 | posn = (part == ON_MODE_LINE) ? Qmode_line : Qheader_line; | 5158 | posn = (part == ON_MODE_LINE) ? Qmode_line : Qheader_line; |
| 5159 | /* Note that mode_line_string takes COL, ROW as pixels and | 5159 | /* Note that mode_line_string takes COL, ROW as pixels and |
| @@ -5176,7 +5176,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, | |||
| 5176 | else if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN) | 5176 | else if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN) |
| 5177 | { | 5177 | { |
| 5178 | Lisp_Object string; | 5178 | Lisp_Object string; |
| 5179 | EMACS_INT charpos; | 5179 | ptrdiff_t charpos; |
| 5180 | 5180 | ||
| 5181 | posn = (part == ON_LEFT_MARGIN) ? Qleft_margin : Qright_margin; | 5181 | posn = (part == ON_LEFT_MARGIN) ? Qleft_margin : Qright_margin; |
| 5182 | col = wx; | 5182 | col = wx; |
| @@ -5404,7 +5404,7 @@ make_lispy_event (struct input_event *event) | |||
| 5404 | Qfunction_key, | 5404 | Qfunction_key, |
| 5405 | KVAR (current_kboard, Vsystem_key_alist), | 5405 | KVAR (current_kboard, Vsystem_key_alist), |
| 5406 | 0, &KVAR (current_kboard, system_key_syms), | 5406 | 0, &KVAR (current_kboard, system_key_syms), |
| 5407 | TYPE_MAXIMUM (EMACS_INT)); | 5407 | PTRDIFF_MAX); |
| 5408 | } | 5408 | } |
| 5409 | 5409 | ||
| 5410 | return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET, | 5410 | return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET, |
| @@ -5536,9 +5536,10 @@ make_lispy_event (struct input_event *event) | |||
| 5536 | 5536 | ||
| 5537 | if (button >= ASIZE (button_down_location)) | 5537 | if (button >= ASIZE (button_down_location)) |
| 5538 | { | 5538 | { |
| 5539 | ptrdiff_t incr = button - ASIZE (button_down_location) + 1; | ||
| 5539 | button_down_location = larger_vector (button_down_location, | 5540 | button_down_location = larger_vector (button_down_location, |
| 5540 | button + 1, Qnil); | 5541 | incr, -1); |
| 5541 | mouse_syms = larger_vector (mouse_syms, button + 1, Qnil); | 5542 | mouse_syms = larger_vector (mouse_syms, incr, -1); |
| 5542 | } | 5543 | } |
| 5543 | 5544 | ||
| 5544 | start_pos_ptr = &AREF (button_down_location, button); | 5545 | start_pos_ptr = &AREF (button_down_location, button); |
| @@ -5838,7 +5839,9 @@ make_lispy_event (struct input_event *event) | |||
| 5838 | event->modifiers &= ~up_modifier; | 5839 | event->modifiers &= ~up_modifier; |
| 5839 | 5840 | ||
| 5840 | if (event->code >= ASIZE (mouse_syms)) | 5841 | if (event->code >= ASIZE (mouse_syms)) |
| 5841 | mouse_syms = larger_vector (mouse_syms, event->code + 1, Qnil); | 5842 | mouse_syms = larger_vector (mouse_syms, |
| 5843 | event->code - ASIZE (mouse_syms) + 1, | ||
| 5844 | -1); | ||
| 5842 | 5845 | ||
| 5843 | /* Get the symbol we should use for the mouse click. */ | 5846 | /* Get the symbol we should use for the mouse click. */ |
| 5844 | head = modify_event_symbol (event->code, | 5847 | head = modify_event_symbol (event->code, |
| @@ -5941,9 +5944,10 @@ make_lispy_event (struct input_event *event) | |||
| 5941 | 5944 | ||
| 5942 | if (button >= ASIZE (button_down_location)) | 5945 | if (button >= ASIZE (button_down_location)) |
| 5943 | { | 5946 | { |
| 5947 | ptrdiff_t incr = button - ASIZE (button_down_location) + 1; | ||
| 5944 | button_down_location = larger_vector (button_down_location, | 5948 | button_down_location = larger_vector (button_down_location, |
| 5945 | button + 1, Qnil); | 5949 | incr, -1); |
| 5946 | mouse_syms = larger_vector (mouse_syms, button + 1, Qnil); | 5950 | mouse_syms = larger_vector (mouse_syms, incr, -1); |
| 5947 | } | 5951 | } |
| 5948 | 5952 | ||
| 5949 | start_pos_ptr = &AREF (button_down_location, button); | 5953 | start_pos_ptr = &AREF (button_down_location, button); |
| @@ -6045,10 +6049,10 @@ make_lispy_switch_frame (Lisp_Object frame) | |||
| 6045 | This doesn't use any caches. */ | 6049 | This doesn't use any caches. */ |
| 6046 | 6050 | ||
| 6047 | static int | 6051 | static int |
| 6048 | parse_modifiers_uncached (Lisp_Object symbol, EMACS_INT *modifier_end) | 6052 | parse_modifiers_uncached (Lisp_Object symbol, ptrdiff_t *modifier_end) |
| 6049 | { | 6053 | { |
| 6050 | Lisp_Object name; | 6054 | Lisp_Object name; |
| 6051 | EMACS_INT i; | 6055 | ptrdiff_t i; |
| 6052 | int modifiers; | 6056 | int modifiers; |
| 6053 | 6057 | ||
| 6054 | CHECK_SYMBOL (symbol); | 6058 | CHECK_SYMBOL (symbol); |
| @@ -6056,9 +6060,9 @@ parse_modifiers_uncached (Lisp_Object symbol, EMACS_INT *modifier_end) | |||
| 6056 | modifiers = 0; | 6060 | modifiers = 0; |
| 6057 | name = SYMBOL_NAME (symbol); | 6061 | name = SYMBOL_NAME (symbol); |
| 6058 | 6062 | ||
| 6059 | for (i = 0; i+2 <= SBYTES (name); ) | 6063 | for (i = 0; 2 <= SBYTES (name) - i; ) |
| 6060 | { | 6064 | { |
| 6061 | EMACS_INT this_mod_end = 0; | 6065 | ptrdiff_t this_mod_end = 0; |
| 6062 | int this_mod = 0; | 6066 | int this_mod = 0; |
| 6063 | 6067 | ||
| 6064 | /* See if the name continues with a modifier word. | 6068 | /* See if the name continues with a modifier word. |
| @@ -6255,7 +6259,7 @@ parse_modifiers (Lisp_Object symbol) | |||
| 6255 | return elements; | 6259 | return elements; |
| 6256 | else | 6260 | else |
| 6257 | { | 6261 | { |
| 6258 | EMACS_INT end; | 6262 | ptrdiff_t end; |
| 6259 | int modifiers = parse_modifiers_uncached (symbol, &end); | 6263 | int modifiers = parse_modifiers_uncached (symbol, &end); |
| 6260 | Lisp_Object unmodified; | 6264 | Lisp_Object unmodified; |
| 6261 | Lisp_Object mask; | 6265 | Lisp_Object mask; |
| @@ -6421,9 +6425,9 @@ reorder_modifiers (Lisp_Object symbol) | |||
| 6421 | in the symbol's name. */ | 6425 | in the symbol's name. */ |
| 6422 | 6426 | ||
| 6423 | static Lisp_Object | 6427 | static Lisp_Object |
| 6424 | modify_event_symbol (EMACS_INT symbol_num, unsigned int modifiers, Lisp_Object symbol_kind, | 6428 | modify_event_symbol (ptrdiff_t symbol_num, int modifiers, Lisp_Object symbol_kind, |
| 6425 | Lisp_Object name_alist_or_stem, const char *const *name_table, | 6429 | Lisp_Object name_alist_or_stem, const char *const *name_table, |
| 6426 | Lisp_Object *symbol_table, EMACS_INT table_size) | 6430 | Lisp_Object *symbol_table, ptrdiff_t table_size) |
| 6427 | { | 6431 | { |
| 6428 | Lisp_Object value; | 6432 | Lisp_Object value; |
| 6429 | Lisp_Object symbol_int; | 6433 | Lisp_Object symbol_int; |
| @@ -7525,7 +7529,7 @@ menu_bar_items (Lisp_Object old) | |||
| 7525 | int i = menu_bar_items_index; | 7529 | int i = menu_bar_items_index; |
| 7526 | if (i + 4 > ASIZE (menu_bar_items_vector)) | 7530 | if (i + 4 > ASIZE (menu_bar_items_vector)) |
| 7527 | menu_bar_items_vector = | 7531 | menu_bar_items_vector = |
| 7528 | larger_vector (menu_bar_items_vector, 2 * i, Qnil); | 7532 | larger_vector (menu_bar_items_vector, 4, -1); |
| 7529 | /* Add this item. */ | 7533 | /* Add this item. */ |
| 7530 | XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; | 7534 | XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; |
| 7531 | XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; | 7535 | XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; |
| @@ -7596,7 +7600,7 @@ menu_bar_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy1, void *dumm | |||
| 7596 | { | 7600 | { |
| 7597 | /* If vector is too small, get a bigger one. */ | 7601 | /* If vector is too small, get a bigger one. */ |
| 7598 | if (i + 4 > ASIZE (menu_bar_items_vector)) | 7602 | if (i + 4 > ASIZE (menu_bar_items_vector)) |
| 7599 | menu_bar_items_vector = larger_vector (menu_bar_items_vector, 2 * i, Qnil); | 7603 | menu_bar_items_vector = larger_vector (menu_bar_items_vector, 4, -1); |
| 7600 | /* Add this item. */ | 7604 | /* Add this item. */ |
| 7601 | XVECTOR (menu_bar_items_vector)->contents[i++] = key; | 7605 | XVECTOR (menu_bar_items_vector)->contents[i++] = key; |
| 7602 | XVECTOR (menu_bar_items_vector)->contents[i++] | 7606 | XVECTOR (menu_bar_items_vector)->contents[i++] |
| @@ -7640,7 +7644,7 @@ eval_dyn (Lisp_Object form) | |||
| 7640 | Lisp_Object | 7644 | Lisp_Object |
| 7641 | menu_item_eval_property (Lisp_Object sexpr) | 7645 | menu_item_eval_property (Lisp_Object sexpr) |
| 7642 | { | 7646 | { |
| 7643 | int count = SPECPDL_INDEX (); | 7647 | ptrdiff_t count = SPECPDL_INDEX (); |
| 7644 | Lisp_Object val; | 7648 | Lisp_Object val; |
| 7645 | specbind (Qinhibit_redisplay, Qt); | 7649 | specbind (Qinhibit_redisplay, Qt); |
| 7646 | val = internal_condition_case_1 (eval_dyn, sexpr, Qerror, | 7650 | val = internal_condition_case_1 (eval_dyn, sexpr, Qerror, |
| @@ -8365,13 +8369,14 @@ static void | |||
| 8365 | append_tool_bar_item (void) | 8369 | append_tool_bar_item (void) |
| 8366 | { | 8370 | { |
| 8367 | Lisp_Object *to, *from; | 8371 | Lisp_Object *to, *from; |
| 8372 | ptrdiff_t incr = | ||
| 8373 | (ntool_bar_items | ||
| 8374 | - (ASIZE (tool_bar_items_vector) - TOOL_BAR_ITEM_NSLOTS)); | ||
| 8368 | 8375 | ||
| 8369 | /* Enlarge tool_bar_items_vector if necessary. */ | 8376 | /* Enlarge tool_bar_items_vector if necessary. */ |
| 8370 | if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS | 8377 | if (0 < incr) |
| 8371 | >= ASIZE (tool_bar_items_vector)) | ||
| 8372 | tool_bar_items_vector | 8378 | tool_bar_items_vector |
| 8373 | = larger_vector (tool_bar_items_vector, | 8379 | = larger_vector (tool_bar_items_vector, incr, -1); |
| 8374 | 2 * ASIZE (tool_bar_items_vector), Qnil); | ||
| 8375 | 8380 | ||
| 8376 | /* Append entries from tool_bar_item_properties to the end of | 8381 | /* Append entries from tool_bar_item_properties to the end of |
| 8377 | tool_bar_items_vector. */ | 8382 | tool_bar_items_vector. */ |
| @@ -8948,15 +8953,15 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 8948 | int fix_current_buffer) | 8953 | int fix_current_buffer) |
| 8949 | { | 8954 | { |
| 8950 | Lisp_Object from_string; | 8955 | Lisp_Object from_string; |
| 8951 | int count = SPECPDL_INDEX (); | 8956 | ptrdiff_t count = SPECPDL_INDEX (); |
| 8952 | 8957 | ||
| 8953 | /* How many keys there are in the current key sequence. */ | 8958 | /* How many keys there are in the current key sequence. */ |
| 8954 | int t; | 8959 | int t; |
| 8955 | 8960 | ||
| 8956 | /* The length of the echo buffer when we started reading, and | 8961 | /* The length of the echo buffer when we started reading, and |
| 8957 | the length of this_command_keys when we started reading. */ | 8962 | the length of this_command_keys when we started reading. */ |
| 8958 | int echo_start IF_LINT (= 0); | 8963 | ptrdiff_t echo_start IF_LINT (= 0); |
| 8959 | int keys_start; | 8964 | ptrdiff_t keys_start; |
| 8960 | 8965 | ||
| 8961 | /* The number of keymaps we're scanning right now, and the number of | 8966 | /* The number of keymaps we're scanning right now, and the number of |
| 8962 | keymaps we have allocated space for. */ | 8967 | keymaps we have allocated space for. */ |
| @@ -9212,7 +9217,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, | |||
| 9212 | while those allow us to restart the entire key sequence, | 9217 | while those allow us to restart the entire key sequence, |
| 9213 | echo_local_start and keys_local_start allow us to throw away | 9218 | echo_local_start and keys_local_start allow us to throw away |
| 9214 | just one key. */ | 9219 | just one key. */ |
| 9215 | int echo_local_start IF_LINT (= 0); | 9220 | ptrdiff_t echo_local_start IF_LINT (= 0); |
| 9216 | int keys_local_start; | 9221 | int keys_local_start; |
| 9217 | ptrdiff_t local_first_binding; | 9222 | ptrdiff_t local_first_binding; |
| 9218 | 9223 | ||
| @@ -10089,7 +10094,7 @@ will read just one key sequence. */) | |||
| 10089 | Lisp_Object keybuf[30]; | 10094 | Lisp_Object keybuf[30]; |
| 10090 | register int i; | 10095 | register int i; |
| 10091 | struct gcpro gcpro1; | 10096 | struct gcpro gcpro1; |
| 10092 | int count = SPECPDL_INDEX (); | 10097 | ptrdiff_t count = SPECPDL_INDEX (); |
| 10093 | 10098 | ||
| 10094 | if (!NILP (prompt)) | 10099 | if (!NILP (prompt)) |
| 10095 | CHECK_STRING (prompt); | 10100 | CHECK_STRING (prompt); |
| @@ -10146,7 +10151,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector, | |||
| 10146 | Lisp_Object keybuf[30]; | 10151 | Lisp_Object keybuf[30]; |
| 10147 | register int i; | 10152 | register int i; |
| 10148 | struct gcpro gcpro1; | 10153 | struct gcpro gcpro1; |
| 10149 | int count = SPECPDL_INDEX (); | 10154 | ptrdiff_t count = SPECPDL_INDEX (); |
| 10150 | 10155 | ||
| 10151 | if (!NILP (prompt)) | 10156 | if (!NILP (prompt)) |
| 10152 | CHECK_STRING (prompt); | 10157 | CHECK_STRING (prompt); |
| @@ -10292,7 +10297,7 @@ give to the command you invoke, if it asks for an argument. */) | |||
| 10292 | (Lisp_Object prefixarg) | 10297 | (Lisp_Object prefixarg) |
| 10293 | { | 10298 | { |
| 10294 | Lisp_Object function; | 10299 | Lisp_Object function; |
| 10295 | EMACS_INT saved_last_point_position; | 10300 | ptrdiff_t saved_last_point_position; |
| 10296 | Lisp_Object saved_keys, saved_last_point_position_buffer; | 10301 | Lisp_Object saved_keys, saved_last_point_position_buffer; |
| 10297 | Lisp_Object bindings, value; | 10302 | Lisp_Object bindings, value; |
| 10298 | struct gcpro gcpro1, gcpro2, gcpro3; | 10303 | struct gcpro gcpro1, gcpro2, gcpro3; |
| @@ -10386,7 +10391,7 @@ give to the command you invoke, if it asks for an argument. */) | |||
| 10386 | Lisp_Object binding; | 10391 | Lisp_Object binding; |
| 10387 | char *newmessage; | 10392 | char *newmessage; |
| 10388 | int message_p = push_message (); | 10393 | int message_p = push_message (); |
| 10389 | int count = SPECPDL_INDEX (); | 10394 | ptrdiff_t count = SPECPDL_INDEX (); |
| 10390 | ptrdiff_t newmessage_len, newmessage_alloc; | 10395 | ptrdiff_t newmessage_len, newmessage_alloc; |
| 10391 | USE_SAFE_ALLOCA; | 10396 | USE_SAFE_ALLOCA; |
| 10392 | 10397 | ||
| @@ -10711,7 +10716,7 @@ Some operating systems cannot stop the Emacs process and resume it later. | |||
| 10711 | On such systems, Emacs starts a subshell instead of suspending. */) | 10716 | On such systems, Emacs starts a subshell instead of suspending. */) |
| 10712 | (Lisp_Object stuffstring) | 10717 | (Lisp_Object stuffstring) |
| 10713 | { | 10718 | { |
| 10714 | int count = SPECPDL_INDEX (); | 10719 | ptrdiff_t count = SPECPDL_INDEX (); |
| 10715 | int old_height, old_width; | 10720 | int old_height, old_width; |
| 10716 | int width, height; | 10721 | int width, height; |
| 10717 | struct gcpro gcpro1; | 10722 | struct gcpro gcpro1; |
| @@ -10767,7 +10772,7 @@ stuff_buffered_input (Lisp_Object stuffstring) | |||
| 10767 | 10772 | ||
| 10768 | if (STRINGP (stuffstring)) | 10773 | if (STRINGP (stuffstring)) |
| 10769 | { | 10774 | { |
| 10770 | register EMACS_INT count; | 10775 | register ptrdiff_t count; |
| 10771 | 10776 | ||
| 10772 | p = SDATA (stuffstring); | 10777 | p = SDATA (stuffstring); |
| 10773 | count = SBYTES (stuffstring); | 10778 | count = SBYTES (stuffstring); |