diff options
Diffstat (limited to 'src/cmds.c')
| -rw-r--r-- | src/cmds.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/cmds.c b/src/cmds.c index f12e759b7a6..e12d7c370d9 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -37,7 +37,7 @@ Lisp_Object Qkill_forward_chars, Qkill_backward_chars; | |||
| 37 | /* A possible value for a buffer's overwrite-mode variable. */ | 37 | /* A possible value for a buffer's overwrite-mode variable. */ |
| 38 | Lisp_Object Qoverwrite_mode_binary; | 38 | Lisp_Object Qoverwrite_mode_binary; |
| 39 | 39 | ||
| 40 | static int internal_self_insert (int, int); | 40 | static int internal_self_insert (int, EMACS_INT); |
| 41 | 41 | ||
| 42 | DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, | 42 | DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, |
| 43 | doc: /* Return buffer position N characters after (before if N negative) point. */) | 43 | doc: /* Return buffer position N characters after (before if N negative) point. */) |
| @@ -68,7 +68,7 @@ right or to the left on the screen. This is in contrast with | |||
| 68 | hooks, etcetera), that's not a good approach. So we validate the | 68 | hooks, etcetera), that's not a good approach. So we validate the |
| 69 | proposed position, then set point. */ | 69 | proposed position, then set point. */ |
| 70 | { | 70 | { |
| 71 | int new_point = PT + XINT (n); | 71 | EMACS_INT new_point = PT + XINT (n); |
| 72 | 72 | ||
| 73 | if (new_point < BEGV) | 73 | if (new_point < BEGV) |
| 74 | { | 74 | { |
| @@ -116,9 +116,9 @@ With positive N, a non-empty line at the end counts as one line | |||
| 116 | successfully moved (for the return value). */) | 116 | successfully moved (for the return value). */) |
| 117 | (Lisp_Object n) | 117 | (Lisp_Object n) |
| 118 | { | 118 | { |
| 119 | int opoint = PT, opoint_byte = PT_BYTE; | 119 | EMACS_INT opoint = PT, opoint_byte = PT_BYTE; |
| 120 | int pos, pos_byte; | 120 | EMACS_INT pos, pos_byte; |
| 121 | int count, shortage; | 121 | EMACS_INT count, shortage; |
| 122 | 122 | ||
| 123 | if (NILP (n)) | 123 | if (NILP (n)) |
| 124 | count = 1; | 124 | count = 1; |
| @@ -188,7 +188,7 @@ not move. To ignore field boundaries bind `inhibit-field-text-motion' | |||
| 188 | to t. */) | 188 | to t. */) |
| 189 | (Lisp_Object n) | 189 | (Lisp_Object n) |
| 190 | { | 190 | { |
| 191 | int newpos; | 191 | EMACS_INT newpos; |
| 192 | 192 | ||
| 193 | if (NILP (n)) | 193 | if (NILP (n)) |
| 194 | XSETFASTINT (n, 1); | 194 | XSETFASTINT (n, 1); |
| @@ -233,7 +233,7 @@ N was explicitly specified. | |||
| 233 | The command `delete-forward' is preferable for interactive use. */) | 233 | The command `delete-forward' is preferable for interactive use. */) |
| 234 | (Lisp_Object n, Lisp_Object killflag) | 234 | (Lisp_Object n, Lisp_Object killflag) |
| 235 | { | 235 | { |
| 236 | int pos; | 236 | EMACS_INT pos; |
| 237 | 237 | ||
| 238 | CHECK_NUMBER (n); | 238 | CHECK_NUMBER (n); |
| 239 | 239 | ||
| @@ -303,7 +303,7 @@ After insertion, the value of `auto-fill-function' is called if the | |||
| 303 | bitch_at_user (); | 303 | bitch_at_user (); |
| 304 | { | 304 | { |
| 305 | int character = translate_char (Vtranslation_table_for_input, | 305 | int character = translate_char (Vtranslation_table_for_input, |
| 306 | XINT (last_command_event)); | 306 | (int) XINT (last_command_event)); |
| 307 | int val = internal_self_insert (character, XFASTINT (n)); | 307 | int val = internal_self_insert (character, XFASTINT (n)); |
| 308 | if (val == 2) | 308 | if (val == 2) |
| 309 | nonundocount = 0; | 309 | nonundocount = 0; |
| @@ -323,7 +323,7 @@ static Lisp_Object Qexpand_abbrev; | |||
| 323 | static Lisp_Object Qpost_self_insert_hook, Vpost_self_insert_hook; | 323 | static Lisp_Object Qpost_self_insert_hook, Vpost_self_insert_hook; |
| 324 | 324 | ||
| 325 | static int | 325 | static int |
| 326 | internal_self_insert (int c, int n) | 326 | internal_self_insert (int c, EMACS_INT n) |
| 327 | { | 327 | { |
| 328 | int hairy = 0; | 328 | int hairy = 0; |
| 329 | Lisp_Object tem; | 329 | Lisp_Object tem; |
| @@ -333,8 +333,8 @@ internal_self_insert (int c, int n) | |||
| 333 | int len; | 333 | int len; |
| 334 | /* Working buffer and pointer for multi-byte form of C. */ | 334 | /* Working buffer and pointer for multi-byte form of C. */ |
| 335 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 335 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 336 | int chars_to_delete = 0; | 336 | EMACS_INT chars_to_delete = 0; |
| 337 | int spaces_to_insert = 0; | 337 | EMACS_INT spaces_to_insert = 0; |
| 338 | 338 | ||
| 339 | overwrite = current_buffer->overwrite_mode; | 339 | overwrite = current_buffer->overwrite_mode; |
| 340 | if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) | 340 | if (!NILP (Vbefore_change_functions) || !NILP (Vafter_change_functions)) |
| @@ -380,12 +380,12 @@ internal_self_insert (int c, int n) | |||
| 380 | chars_to_delete = n; | 380 | chars_to_delete = n; |
| 381 | else if (c != '\n' && c2 != '\n') | 381 | else if (c != '\n' && c2 != '\n') |
| 382 | { | 382 | { |
| 383 | int pos = PT; | 383 | EMACS_INT pos = PT; |
| 384 | int pos_byte = PT_BYTE; | 384 | EMACS_INT pos_byte = PT_BYTE; |
| 385 | /* Column the cursor should be placed at after this insertion. | 385 | /* Column the cursor should be placed at after this insertion. |
| 386 | The correct value should be calculated only when necessary. */ | 386 | The correct value should be calculated only when necessary. */ |
| 387 | int target_clm = ((int) current_column () /* iftc */ | 387 | int target_clm = ((int) current_column () /* iftc */ |
| 388 | + n * XINT (Fchar_width (make_number (c)))); | 388 | + n * (int) XINT (Fchar_width (make_number (c)))); |
| 389 | 389 | ||
| 390 | /* The actual cursor position after the trial of moving | 390 | /* The actual cursor position after the trial of moving |
| 391 | to column TARGET_CLM. It is greater than TARGET_CLM | 391 | to column TARGET_CLM. It is greater than TARGET_CLM |
| @@ -393,7 +393,8 @@ internal_self_insert (int c, int n) | |||
| 393 | character. In that case, the new point is set after | 393 | character. In that case, the new point is set after |
| 394 | that character. */ | 394 | that character. */ |
| 395 | int actual_clm | 395 | int actual_clm |
| 396 | = XFASTINT (Fmove_to_column (make_number (target_clm), Qnil)); | 396 | = (int) XFASTINT (Fmove_to_column (make_number (target_clm), |
| 397 | Qnil)); | ||
| 397 | 398 | ||
| 398 | chars_to_delete = PT - pos; | 399 | chars_to_delete = PT - pos; |
| 399 | 400 | ||
| @@ -524,7 +525,7 @@ syms_of_cmds (void) | |||
| 524 | 525 | ||
| 525 | DEFVAR_LISP ("post-self-insert-hook", &Vpost_self_insert_hook, | 526 | DEFVAR_LISP ("post-self-insert-hook", &Vpost_self_insert_hook, |
| 526 | doc: /* Hook run at the end of `self-insert-command'. | 527 | doc: /* Hook run at the end of `self-insert-command'. |
| 527 | This run is run after inserting the charater. */); | 528 | This is run after inserting the character. */); |
| 528 | Vpost_self_insert_hook = Qnil; | 529 | Vpost_self_insert_hook = Qnil; |
| 529 | 530 | ||
| 530 | defsubr (&Sforward_point); | 531 | defsubr (&Sforward_point); |