diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 50 |
1 files changed, 41 insertions, 9 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 8e36710e1f7..931ad978b73 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 34 | #include "dispextern.h" | 34 | #include "dispextern.h" |
| 35 | #include "cm.h" | 35 | #include "cm.h" |
| 36 | #include "buffer.h" | 36 | #include "buffer.h" |
| 37 | #include "charset.h" | ||
| 37 | #include "frame.h" | 38 | #include "frame.h" |
| 38 | #include "window.h" | 39 | #include "window.h" |
| 39 | #include "commands.h" | 40 | #include "commands.h" |
| @@ -42,7 +43,9 @@ Boston, MA 02111-1307, USA. */ | |||
| 42 | #include "intervals.h" | 43 | #include "intervals.h" |
| 43 | #include "blockinput.h" | 44 | #include "blockinput.h" |
| 44 | 45 | ||
| 45 | #include "systty.h" | 46 | /* I don't know why DEC Alpha OSF1 fail to compile this file if we |
| 47 | include the following file. */ | ||
| 48 | /* #include "systty.h" */ | ||
| 46 | #include "syssignal.h" | 49 | #include "syssignal.h" |
| 47 | 50 | ||
| 48 | #ifdef HAVE_X_WINDOWS | 51 | #ifdef HAVE_X_WINDOWS |
| @@ -346,7 +349,7 @@ remake_frame_glyphs (frame) | |||
| 346 | 349 | ||
| 347 | FRAME_MESSAGE_BUF (frame) | 350 | FRAME_MESSAGE_BUF (frame) |
| 348 | = (char *) xrealloc (FRAME_MESSAGE_BUF (frame), | 351 | = (char *) xrealloc (FRAME_MESSAGE_BUF (frame), |
| 349 | FRAME_WIDTH (frame) + 1); | 352 | FRAME_MESSAGE_BUF_SIZE (frame) + 1); |
| 350 | 353 | ||
| 351 | if (echo_area_glyphs == old_message_buf) | 354 | if (echo_area_glyphs == old_message_buf) |
| 352 | echo_area_glyphs = FRAME_MESSAGE_BUF (frame); | 355 | echo_area_glyphs = FRAME_MESSAGE_BUF (frame); |
| @@ -355,7 +358,7 @@ remake_frame_glyphs (frame) | |||
| 355 | } | 358 | } |
| 356 | else | 359 | else |
| 357 | FRAME_MESSAGE_BUF (frame) | 360 | FRAME_MESSAGE_BUF (frame) |
| 358 | = (char *) xmalloc (FRAME_WIDTH (frame) + 1); | 361 | = (char *) xmalloc (FRAME_MESSAGE_BUF_SIZE (frame) + 1); |
| 359 | 362 | ||
| 360 | FRAME_CURRENT_GLYPHS (frame) = make_frame_glyphs (frame, 0); | 363 | FRAME_CURRENT_GLYPHS (frame) = make_frame_glyphs (frame, 0); |
| 361 | FRAME_DESIRED_GLYPHS (frame) = make_frame_glyphs (frame, 0); | 364 | FRAME_DESIRED_GLYPHS (frame) = make_frame_glyphs (frame, 0); |
| @@ -1114,18 +1117,29 @@ direct_output_forward_char (n) | |||
| 1114 | register FRAME_PTR frame = selected_frame; | 1117 | register FRAME_PTR frame = selected_frame; |
| 1115 | register struct window *w = XWINDOW (selected_window); | 1118 | register struct window *w = XWINDOW (selected_window); |
| 1116 | Lisp_Object position; | 1119 | Lisp_Object position; |
| 1120 | /* This check is redundant. It's checked at "losing cursor" below. */ | ||
| 1121 | #if 0 | ||
| 1117 | int hpos = FRAME_CURSOR_X (frame); | 1122 | int hpos = FRAME_CURSOR_X (frame); |
| 1118 | 1123 | ||
| 1119 | /* Give up if in truncated text at end of line. */ | 1124 | /* Give up if in truncated text at end of line. */ |
| 1120 | if (hpos >= WINDOW_LEFT_MARGIN (w) + window_internal_width (w) - 1) | 1125 | if (hpos >= WINDOW_LEFT_MARGIN (w) + window_internal_width (w) - 1) |
| 1121 | return 0; | 1126 | return 0; |
| 1127 | #endif /* 0 */ | ||
| 1128 | |||
| 1129 | /* Give up if the buffer's direction is reversed (i.e. right-to-left). */ | ||
| 1130 | if (!NILP (XBUFFER(w->buffer)->direction_reversed)) | ||
| 1131 | return 0; | ||
| 1122 | 1132 | ||
| 1123 | /* Avoid losing if cursor is in invisible text off left margin | 1133 | /* Avoid losing if cursor is in invisible text off left margin |
| 1124 | or about to go off either side of window. */ | 1134 | or about to go off either side of window. */ |
| 1125 | if ((FRAME_CURSOR_X (frame) == WINDOW_LEFT_MARGIN (w) | 1135 | if ((FRAME_CURSOR_X (frame) == WINDOW_LEFT_MARGIN (w) |
| 1126 | && (XINT (w->hscroll) || n < 0)) | 1136 | && (XINT (w->hscroll) || n < 0)) |
| 1127 | || (n > 0 | 1137 | || (n > 0 |
| 1128 | && (FRAME_CURSOR_X (frame) + 1 >= window_internal_width (w) - 1)) | 1138 | && (FRAME_CURSOR_X (frame) + 1 |
| 1139 | >= XFASTINT (w->left) + window_internal_width (w) - 1)) | ||
| 1140 | /* BUG FIX: Added "XFASTINT (w->left)". Without this, | ||
| 1141 | direct_output_forward_char() always fails on "the right" | ||
| 1142 | window. */ | ||
| 1129 | || cursor_in_echo_area) | 1143 | || cursor_in_echo_area) |
| 1130 | return 0; | 1144 | return 0; |
| 1131 | 1145 | ||
| @@ -1547,7 +1561,7 @@ update_line (frame, vpos) | |||
| 1547 | int *temp1; | 1561 | int *temp1; |
| 1548 | int tem; | 1562 | int tem; |
| 1549 | int osp, nsp, begmatch, endmatch, olen, nlen; | 1563 | int osp, nsp, begmatch, endmatch, olen, nlen; |
| 1550 | int save; | 1564 | GLYPH save; |
| 1551 | register struct frame_glyphs *current_frame | 1565 | register struct frame_glyphs *current_frame |
| 1552 | = FRAME_CURRENT_GLYPHS (frame); | 1566 | = FRAME_CURRENT_GLYPHS (frame); |
| 1553 | register struct frame_glyphs *desired_frame | 1567 | register struct frame_glyphs *desired_frame |
| @@ -1663,8 +1677,10 @@ update_line (frame, vpos) | |||
| 1663 | if (i >= olen || nbody[i] != obody[i]) /* A non-matching char. */ | 1677 | if (i >= olen || nbody[i] != obody[i]) /* A non-matching char. */ |
| 1664 | { | 1678 | { |
| 1665 | cursor_to (vpos, i); | 1679 | cursor_to (vpos, i); |
| 1666 | for (j = 1; (i + j < nlen && | 1680 | for (j = 1; |
| 1667 | (i + j >= olen || nbody[i+j] != obody[i+j])); | 1681 | (i + j < nlen |
| 1682 | && (i + j >= olen || nbody[i + j] != obody[i + j] | ||
| 1683 | || (nbody[i + j] & GLYPH_MASK_PADDING))); | ||
| 1668 | j++); | 1684 | j++); |
| 1669 | 1685 | ||
| 1670 | /* Output this run of non-matching chars. */ | 1686 | /* Output this run of non-matching chars. */ |
| @@ -1851,8 +1867,24 @@ update_line (frame, vpos) | |||
| 1851 | } | 1867 | } |
| 1852 | else if (nlen > olen) | 1868 | else if (nlen > olen) |
| 1853 | { | 1869 | { |
| 1854 | write_glyphs (nbody + nsp + begmatch, olen - tem); | 1870 | /* Here, we used to have the following simple code: |
| 1855 | insert_glyphs (nbody + nsp + begmatch + olen - tem, nlen - olen); | 1871 | ---------------------------------------- |
| 1872 | write_glyphs (nbody + nsp + begmatch, olen - tem); | ||
| 1873 | insert_glyphs (nbody + nsp + begmatch + olen - tem, nlen - olen); | ||
| 1874 | ---------------------------------------- | ||
| 1875 | but it doesn't work if nbody[nsp + begmatch + olen - tem] | ||
| 1876 | is a padding glyph. */ | ||
| 1877 | int out = olen - tem; /* Columns to be overwritten originally. */ | ||
| 1878 | int del; | ||
| 1879 | |||
| 1880 | /* Calculate columns we can actually overwrite. */ | ||
| 1881 | while (nbody[nsp + begmatch + out] & GLYPH_MASK_PADDING) out--; | ||
| 1882 | write_glyphs (nbody + nsp + begmatch, out); | ||
| 1883 | /* If we left columns to be overwritten. we must delete them. */ | ||
| 1884 | del = olen - tem - out; | ||
| 1885 | if (del > 0) delete_glyphs (del); | ||
| 1886 | /* At last, we insert columns not yet written out. */ | ||
| 1887 | insert_glyphs (nbody + nsp + begmatch + out, nlen - olen + del); | ||
| 1856 | olen = nlen; | 1888 | olen = nlen; |
| 1857 | } | 1889 | } |
| 1858 | else if (olen > nlen) | 1890 | else if (olen > nlen) |