diff options
| author | Richard M. Stallman | 1998-01-21 08:16:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-01-21 08:16:28 +0000 |
| commit | 813b81b37d03f75159e0a175451af7af613e21cf (patch) | |
| tree | b26d5292f3b4038b8b85bc754c9efe31466c98a7 /src | |
| parent | 09841f8db266d6f56b9c1af081c43f988c0af28b (diff) | |
| download | emacs-813b81b37d03f75159e0a175451af7af613e21cf.tar.gz emacs-813b81b37d03f75159e0a175451af7af613e21cf.zip | |
(current_column_1): Eliminate argument POS; use PT and PT_BYTE.
When doing FETCH_BYTE, use scan_byte.
(current_column): Check whether buffer really has multibyte chars,
not whether they are enabled.
Diffstat (limited to 'src')
| -rw-r--r-- | src/indent.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/indent.c b/src/indent.c index cf8e361a00c..195973fbf2f 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -308,13 +308,13 @@ current_column () | |||
| 308 | && MODIFF == last_known_column_modified) | 308 | && MODIFF == last_known_column_modified) |
| 309 | return last_known_column; | 309 | return last_known_column; |
| 310 | 310 | ||
| 311 | /* If the buffer has overlays, text properties, or multibyte, | 311 | /* If the buffer has overlays, text properties, |
| 312 | use a more general algorithm. */ | 312 | or multibyte characters, use a more general algorithm. */ |
| 313 | if (BUF_INTERVALS (current_buffer) | 313 | if (BUF_INTERVALS (current_buffer) |
| 314 | || !NILP (current_buffer->overlays_before) | 314 | || !NILP (current_buffer->overlays_before) |
| 315 | || !NILP (current_buffer->overlays_after) | 315 | || !NILP (current_buffer->overlays_after) |
| 316 | || !NILP (current_buffer->enable_multibyte_characters)) | 316 | || Z != Z_BYTE) |
| 317 | return current_column_1 (PT); | 317 | return current_column_1 (); |
| 318 | 318 | ||
| 319 | /* Scan backwards from point to the previous newline, | 319 | /* Scan backwards from point to the previous newline, |
| 320 | counting width. Tab characters are the only complicated case. */ | 320 | counting width. Tab characters are the only complicated case. */ |
| @@ -397,8 +397,7 @@ current_column () | |||
| 397 | due to text properties or overlays. */ | 397 | due to text properties or overlays. */ |
| 398 | 398 | ||
| 399 | static int | 399 | static int |
| 400 | current_column_1 (pos) | 400 | current_column_1 () |
| 401 | int pos; | ||
| 402 | { | 401 | { |
| 403 | register int tab_width = XINT (current_buffer->tab_width); | 402 | register int tab_width = XINT (current_buffer->tab_width); |
| 404 | register int ctl_arrow = !NILP (current_buffer->ctl_arrow); | 403 | register int ctl_arrow = !NILP (current_buffer->ctl_arrow); |
| @@ -411,7 +410,7 @@ current_column_1 (pos) | |||
| 411 | int next_boundary, next_boundary_byte; | 410 | int next_boundary, next_boundary_byte; |
| 412 | int opoint = PT, opoint_byte = PT_BYTE; | 411 | int opoint = PT, opoint_byte = PT_BYTE; |
| 413 | 412 | ||
| 414 | scan_newline (pos, CHAR_TO_BYTE (pos), BEGV, BEGV_BYTE, -1, 1); | 413 | scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -1, 1); |
| 415 | current_column_bol_cache = PT; | 414 | current_column_bol_cache = PT; |
| 416 | scan = PT, scan_byte = PT_BYTE; | 415 | scan = PT, scan_byte = PT_BYTE; |
| 417 | SET_PT_BOTH (opoint, opoint_byte); | 416 | SET_PT_BOTH (opoint, opoint_byte); |
| @@ -421,7 +420,7 @@ current_column_1 (pos) | |||
| 421 | if (tab_width <= 0 || tab_width > 1000) tab_width = 8; | 420 | if (tab_width <= 0 || tab_width > 1000) tab_width = 8; |
| 422 | 421 | ||
| 423 | /* Scan forward to the target position. */ | 422 | /* Scan forward to the target position. */ |
| 424 | while (scan < pos) | 423 | while (scan < opoint) |
| 425 | { | 424 | { |
| 426 | int c; | 425 | int c; |
| 427 | 426 | ||
| @@ -431,15 +430,15 @@ current_column_1 (pos) | |||
| 431 | int old_scan = scan; | 430 | int old_scan = scan; |
| 432 | /* This updates NEXT_BOUNDARY to the next place | 431 | /* This updates NEXT_BOUNDARY to the next place |
| 433 | where we might need to skip more invisible text. */ | 432 | where we might need to skip more invisible text. */ |
| 434 | scan = skip_invisible (scan, &next_boundary, pos, Qnil); | 433 | scan = skip_invisible (scan, &next_boundary, opoint, Qnil); |
| 435 | if (scan >= pos) | 434 | if (scan >= opoint) |
| 436 | goto endloop; | 435 | goto endloop; |
| 437 | if (scan != old_scan) | 436 | if (scan != old_scan) |
| 438 | scan_byte = CHAR_TO_BYTE (scan); | 437 | scan_byte = CHAR_TO_BYTE (scan); |
| 439 | next_boundary_byte = CHAR_TO_BYTE (next_boundary); | 438 | next_boundary_byte = CHAR_TO_BYTE (next_boundary); |
| 440 | } | 439 | } |
| 441 | 440 | ||
| 442 | c = FETCH_BYTE (scan); | 441 | c = FETCH_BYTE (scan_byte); |
| 443 | if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))) | 442 | if (dp != 0 && VECTORP (DISP_CHAR_VECTOR (dp, c))) |
| 444 | { | 443 | { |
| 445 | col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; | 444 | col += XVECTOR (DISP_CHAR_VECTOR (dp, c))->size; |