diff options
| author | Paul Eggert | 2011-03-06 02:27:06 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-03-06 02:27:06 -0800 |
| commit | 7831777b8a9e8d2f68bd17058359ea8849d66f70 (patch) | |
| tree | 633cc6fdd638927360ff83619a32def87ed02b4c /src/cmds.c | |
| parent | 179b8720a2e5c37d18ab8f601b982fdcabd19626 (diff) | |
| download | emacs-7831777b8a9e8d2f68bd17058359ea8849d66f70.tar.gz emacs-7831777b8a9e8d2f68bd17058359ea8849d66f70.zip | |
current_column: Now returns EMACS_INT, fixing some iftc.
* bytecode.c (Fbyte_code): Don't cast current_column () to int.
* cmds.c (internal_self_insert): Likewise.
* indent.c (Fcurrent_column): Likewise.
* keymap.c (describe_command): Likewise.
* minibuf.c (read_minibuf): Likewise.
* indent.c (Fcurrent_indentation): Don't cast position_indentation ()
to int.
* xdisp.c (redisplay_internal, redisplay_window, decode_mode_spec):
Likewise.
* cmds.c (internal_self_insert): Declare locals to be EMACS_INT,
not int or double, if they might contain a column number.
* indent.c (current_column, Findent_to, indented_beyond_p):
(compute_motion, vmotion): Likewise.
* keymap.c (describe_command): Likewise.
* xdisp.c (pint2str): Likewise.
* indent.c (last_known_column): Now EMACS_INT, not int.
* minibuf.c (minibuf_prompt_width): Likewise.
* indent.c (current_column, current_column_1, position_indentation):
Return EMACS_INT, not double.
* lisp.h (current_column): Likewise.
* indent.c (indented_beyond_p): Last arg is now EMACS_INT, not double.
All callers changed.
* lisp.h (indented_beyond_p): Likewise.
Diffstat (limited to 'src/cmds.c')
| -rw-r--r-- | src/cmds.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/cmds.c b/src/cmds.c index 7e0eec99bef..5e6884c0807 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -381,19 +381,22 @@ internal_self_insert (int c, EMACS_INT n) | |||
| 381 | { | 381 | { |
| 382 | EMACS_INT pos = PT; | 382 | EMACS_INT pos = PT; |
| 383 | EMACS_INT pos_byte = PT_BYTE; | 383 | EMACS_INT pos_byte = PT_BYTE; |
| 384 | |||
| 385 | /* FIXME: Check for integer overflow when calculating | ||
| 386 | target_clm and actual_clm. */ | ||
| 387 | |||
| 384 | /* Column the cursor should be placed at after this insertion. | 388 | /* Column the cursor should be placed at after this insertion. |
| 385 | The correct value should be calculated only when necessary. */ | 389 | The correct value should be calculated only when necessary. */ |
| 386 | int target_clm = ((int) current_column () /* iftc */ | 390 | EMACS_INT target_clm = (current_column () |
| 387 | + n * (int) XINT (Fchar_width (make_number (c)))); | 391 | + n * XINT (Fchar_width (make_number (c)))); |
| 388 | 392 | ||
| 389 | /* The actual cursor position after the trial of moving | 393 | /* The actual cursor position after the trial of moving |
| 390 | to column TARGET_CLM. It is greater than TARGET_CLM | 394 | to column TARGET_CLM. It is greater than TARGET_CLM |
| 391 | if the TARGET_CLM is middle of multi-column | 395 | if the TARGET_CLM is middle of multi-column |
| 392 | character. In that case, the new point is set after | 396 | character. In that case, the new point is set after |
| 393 | that character. */ | 397 | that character. */ |
| 394 | int actual_clm | 398 | EMACS_INT actual_clm |
| 395 | = (int) XFASTINT (Fmove_to_column (make_number (target_clm), | 399 | = XFASTINT (Fmove_to_column (make_number (target_clm), Qnil)); |
| 396 | Qnil)); | ||
| 397 | 400 | ||
| 398 | chars_to_delete = PT - pos; | 401 | chars_to_delete = PT - pos; |
| 399 | 402 | ||