diff options
| author | Gerd Moellmann | 2001-07-23 14:47:42 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-07-23 14:47:42 +0000 |
| commit | f1004faf26f399e86f2000ef7702f4142de0a64b (patch) | |
| tree | 415193bb96c91411424a74e0ba2a0729104ce1df /src/indent.c | |
| parent | dd42b31ac43a08a15e5fa6e7ada37dbf8f4a05f9 (diff) | |
| download | emacs-f1004faf26f399e86f2000ef7702f4142de0a64b.tar.gz emacs-f1004faf26f399e86f2000ef7702f4142de0a64b.zip | |
(current_column): Fix column computation in the
presence of display table entries.
(current_column_1, Fmove_to_column, compute_motion): Likewise.
Diffstat (limited to 'src/indent.c')
| -rw-r--r-- | src/indent.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/indent.c b/src/indent.c index 49768ea5206..2d0ea9fcae9 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -465,6 +465,13 @@ current_column () | |||
| 465 | col = 0; | 465 | col = 0; |
| 466 | tab_seen = 1; | 466 | tab_seen = 1; |
| 467 | } | 467 | } |
| 468 | else if (VECTORP (charvec)) | ||
| 469 | /* With a display table entry, C is displayed as is, and | ||
| 470 | not displayed as \NNN or as ^N. If C is a single-byte | ||
| 471 | character, it takes one column. If C is multi-byte in | ||
| 472 | an unibyte buffer, it's translated to unibyte, so it | ||
| 473 | also takes one column. */ | ||
| 474 | ++col; | ||
| 468 | else | 475 | else |
| 469 | col += (ctl_arrow && c < 0200) ? 2 : 4; | 476 | col += (ctl_arrow && c < 0200) ? 2 : 4; |
| 470 | } | 477 | } |
| @@ -607,6 +614,8 @@ current_column_1 () | |||
| 607 | scan_byte += bytes; | 614 | scan_byte += bytes; |
| 608 | col += width; | 615 | col += width; |
| 609 | } | 616 | } |
| 617 | else if (VECTORP (charvec)) | ||
| 618 | ++col; | ||
| 610 | else if (ctl_arrow && (c < 040 || c == 0177)) | 619 | else if (ctl_arrow && (c < 040 || c == 0177)) |
| 611 | col += 2; | 620 | col += 2; |
| 612 | else if (c < 040 || c >= 0177) | 621 | else if (c < 040 || c >= 0177) |
| @@ -1016,6 +1025,8 @@ The return value is the current column.") | |||
| 1016 | col += tab_width; | 1025 | col += tab_width; |
| 1017 | col = col / tab_width * tab_width; | 1026 | col = col / tab_width * tab_width; |
| 1018 | } | 1027 | } |
| 1028 | else if (VECTORP (charvec)) | ||
| 1029 | ++col; | ||
| 1019 | else if (ctl_arrow && (c < 040 || c == 0177)) | 1030 | else if (ctl_arrow && (c < 040 || c == 0177)) |
| 1020 | col += 2; | 1031 | col += 2; |
| 1021 | else if (c < 040 || c == 0177) | 1032 | else if (c < 040 || c == 0177) |
| @@ -1654,6 +1665,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 1654 | wide_column_end_hpos = hpos + wide_column; | 1665 | wide_column_end_hpos = hpos + wide_column; |
| 1655 | hpos += width; | 1666 | hpos += width; |
| 1656 | } | 1667 | } |
| 1668 | else if (VECTORP (charvec)) | ||
| 1669 | ++hpos; | ||
| 1657 | else | 1670 | else |
| 1658 | hpos += (ctl_arrow && c < 0200) ? 2 : 4; | 1671 | hpos += (ctl_arrow && c < 0200) ? 2 : 4; |
| 1659 | } | 1672 | } |