diff options
| author | Eli Zaretskii | 2014-08-01 16:10:07 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-08-01 16:10:07 +0300 |
| commit | 8afcf7e9d72d4d4173a00151dd8f2ba1866000c1 (patch) | |
| tree | 0f8439faf6ec04103c1741aa1edbc5d5a939ff19 /src | |
| parent | 4844e0422f7d318775cc7fce7845c0c568bd7ca3 (diff) | |
| parent | eef5843c3458907e4bef35be10d46fea99f412f9 (diff) | |
| download | emacs-8afcf7e9d72d4d4173a00151dd8f2ba1866000c1.tar.gz emacs-8afcf7e9d72d4d4173a00151dd8f2ba1866000c1.zip | |
Merge from emacs-24; up to 2014-06-26T21:51:25Z!rgm@gnu.org.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 32 | ||||
| -rw-r--r-- | src/macros.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 80 |
3 files changed, 106 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a0ac451f35b..c28f8a607aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,35 @@ | |||
| 1 | 2014-08-01 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | Fix display of R2L lines when the last character fits only partially. | ||
| 4 | See http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00476.html | ||
| 5 | for the details. | ||
| 6 | * xdisp.c (extend_face_to_end_of_line): If the last glyph of an | ||
| 7 | R2L row is visible only partially, give the row a negative x | ||
| 8 | offset. | ||
| 9 | (display_line): Fix the calculation of the glyph whose pixel width | ||
| 10 | is used to decide whether the last produced glyph fits on the | ||
| 11 | line. When the last glyph fits only partially, give the row a | ||
| 12 | negative x offset. | ||
| 13 | |||
| 14 | Fix hscroll of R2L lines that begin with a TAB or another wide glyph. | ||
| 15 | * xdisp.c (append_stretch_glyph): In a R2L glyph row, decrease the | ||
| 16 | pixel width of the first glyph that is hscrolled from display. | ||
| 17 | (display_line): In R2L glyph rows, don't give a negative offset to | ||
| 18 | row->x when the first glyph begins before first_visible_x. | ||
| 19 | |||
| 20 | * xdisp.c (display_line): If called with iterator set up to write | ||
| 21 | to a marginal area, delay the call to handle_line_prefix until we | ||
| 22 | switch back to the text area. (Bug#18035) | ||
| 23 | |||
| 24 | * .gdbinit (xwindow): The members total_cols, total_lines, | ||
| 25 | left_col, and top_line are C integers (and has been so for the | ||
| 26 | last 1.5 years). | ||
| 27 | |||
| 28 | 2014-08-01 Andreas Schwab <schwab@suse.de> | ||
| 29 | |||
| 30 | * macros.c (Fstart_kbd_macro): Initialize kbd_macro_ptr and | ||
| 31 | kbd_macro_end together with kbd_macro_buffer. (Bug#18140) | ||
| 32 | |||
| 1 | 2014-08-01 Dmitry Antipov <dmantipov@yandex.ru> | 33 | 2014-08-01 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 34 | ||
| 3 | * atimer.c (toplevel) [HAVE_TIMERFD]: Include errno.h. | 35 | * atimer.c (toplevel) [HAVE_TIMERFD]: Include errno.h. |
diff --git a/src/macros.c b/src/macros.c index 4730a8becc9..c3d26d0d5c2 100644 --- a/src/macros.c +++ b/src/macros.c | |||
| @@ -63,6 +63,8 @@ macro before appending to it. */) | |||
| 63 | { | 63 | { |
| 64 | current_kboard->kbd_macro_buffer = xmalloc (30 * word_size); | 64 | current_kboard->kbd_macro_buffer = xmalloc (30 * word_size); |
| 65 | current_kboard->kbd_macro_bufsize = 30; | 65 | current_kboard->kbd_macro_bufsize = 30; |
| 66 | current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_buffer; | ||
| 67 | current_kboard->kbd_macro_end = current_kboard->kbd_macro_buffer; | ||
| 66 | } | 68 | } |
| 67 | update_mode_lines = 19; | 69 | update_mode_lines = 19; |
| 68 | if (NILP (append)) | 70 | if (NILP (append)) |
diff --git a/src/xdisp.c b/src/xdisp.c index bbe810d1a08..fe16b2c6a07 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -19337,6 +19337,12 @@ extend_face_to_end_of_line (struct it *it) | |||
| 19337 | it->face_id = saved_face_id; | 19337 | it->face_id = saved_face_id; |
| 19338 | it->start_of_box_run_p = saved_box_start; | 19338 | it->start_of_box_run_p = saved_box_start; |
| 19339 | } | 19339 | } |
| 19340 | /* If stretch_width comes out negative, it means that the | ||
| 19341 | last glyph is only partially visible. In R2L rows, we | ||
| 19342 | want the leftmost glyph to be partially visible, so we | ||
| 19343 | need to give the row the corresponding left offset. */ | ||
| 19344 | if (stretch_width < 0) | ||
| 19345 | it->glyph_row->x = stretch_width; | ||
| 19340 | } | 19346 | } |
| 19341 | #endif /* HAVE_WINDOW_SYSTEM */ | 19347 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 19342 | } | 19348 | } |
| @@ -19963,6 +19969,7 @@ display_line (struct it *it) | |||
| 19963 | int cvpos; | 19969 | int cvpos; |
| 19964 | ptrdiff_t min_pos = ZV + 1, max_pos = 0; | 19970 | ptrdiff_t min_pos = ZV + 1, max_pos = 0; |
| 19965 | ptrdiff_t min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0); | 19971 | ptrdiff_t min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0); |
| 19972 | bool pending_handle_line_prefix = false; | ||
| 19966 | 19973 | ||
| 19967 | /* We always start displaying at hpos zero even if hscrolled. */ | 19974 | /* We always start displaying at hpos zero even if hscrolled. */ |
| 19968 | eassert (it->hpos == 0 && it->current_x == 0); | 19975 | eassert (it->hpos == 0 && it->current_x == 0); |
| @@ -20023,13 +20030,23 @@ display_line (struct it *it) | |||
| 20023 | min_pos = CHARPOS (this_line_min_pos); | 20030 | min_pos = CHARPOS (this_line_min_pos); |
| 20024 | min_bpos = BYTEPOS (this_line_min_pos); | 20031 | min_bpos = BYTEPOS (this_line_min_pos); |
| 20025 | } | 20032 | } |
| 20026 | else | 20033 | else if (it->area == TEXT_AREA) |
| 20027 | { | 20034 | { |
| 20028 | /* We only do this when not calling `move_it_in_display_line_to' | 20035 | /* We only do this when not calling move_it_in_display_line_to |
| 20029 | above, because move_it_in_display_line_to calls | 20036 | above, because that function calls itself handle_line_prefix. */ |
| 20030 | handle_line_prefix itself. */ | ||
| 20031 | handle_line_prefix (it); | 20037 | handle_line_prefix (it); |
| 20032 | } | 20038 | } |
| 20039 | else | ||
| 20040 | { | ||
| 20041 | /* Line-prefix and wrap-prefix are always displayed in the text | ||
| 20042 | area. But if this is the first call to display_line after | ||
| 20043 | init_iterator, the iterator might have been set up to write | ||
| 20044 | into a marginal area, e.g. if the line begins with some | ||
| 20045 | display property that writes to the margins. So we need to | ||
| 20046 | wait with the call to handle_line_prefix until whatever | ||
| 20047 | writes to the margin has done its job. */ | ||
| 20048 | pending_handle_line_prefix = true; | ||
| 20049 | } | ||
| 20033 | 20050 | ||
| 20034 | /* Get the initial row height. This is either the height of the | 20051 | /* Get the initial row height. This is either the height of the |
| 20035 | text hscrolled, if there is any, or zero. */ | 20052 | text hscrolled, if there is any, or zero. */ |
| @@ -20161,6 +20178,14 @@ display_line (struct it *it) | |||
| 20161 | row->extra_line_spacing = max (row->extra_line_spacing, | 20178 | row->extra_line_spacing = max (row->extra_line_spacing, |
| 20162 | it->max_extra_line_spacing); | 20179 | it->max_extra_line_spacing); |
| 20163 | set_iterator_to_next (it, 1); | 20180 | set_iterator_to_next (it, 1); |
| 20181 | /* If we didn't handle the line/wrap prefix above, and the | ||
| 20182 | call to set_iterator_to_next just switched to TEXT_AREA, | ||
| 20183 | process the prefix now. */ | ||
| 20184 | if (it->area == TEXT_AREA && pending_handle_line_prefix) | ||
| 20185 | { | ||
| 20186 | pending_handle_line_prefix = false; | ||
| 20187 | handle_line_prefix (it); | ||
| 20188 | } | ||
| 20164 | continue; | 20189 | continue; |
| 20165 | } | 20190 | } |
| 20166 | 20191 | ||
| @@ -20190,7 +20215,12 @@ display_line (struct it *it) | |||
| 20190 | it->max_phys_ascent + it->max_phys_descent); | 20215 | it->max_phys_ascent + it->max_phys_descent); |
| 20191 | row->extra_line_spacing = max (row->extra_line_spacing, | 20216 | row->extra_line_spacing = max (row->extra_line_spacing, |
| 20192 | it->max_extra_line_spacing); | 20217 | it->max_extra_line_spacing); |
| 20193 | if (it->current_x - it->pixel_width < it->first_visible_x) | 20218 | if (it->current_x - it->pixel_width < it->first_visible_x |
| 20219 | /* In R2L rows, we arrange in extend_face_to_end_of_line | ||
| 20220 | to add a right offset to the line, by a suitable | ||
| 20221 | change to the stretch glyph that is the leftmost | ||
| 20222 | glyph of the line. */ | ||
| 20223 | && !row->reversed_p) | ||
| 20194 | row->x = x - it->first_visible_x; | 20224 | row->x = x - it->first_visible_x; |
| 20195 | /* Record the maximum and minimum buffer positions seen so | 20225 | /* Record the maximum and minimum buffer positions seen so |
| 20196 | far in glyphs that will be displayed by this row. */ | 20226 | far in glyphs that will be displayed by this row. */ |
| @@ -20204,7 +20234,13 @@ display_line (struct it *it) | |||
| 20204 | 20234 | ||
| 20205 | for (i = 0; i < nglyphs; ++i, x = new_x) | 20235 | for (i = 0; i < nglyphs; ++i, x = new_x) |
| 20206 | { | 20236 | { |
| 20207 | glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i; | 20237 | /* Identify the glyphs added by the last call to |
| 20238 | PRODUCE_GLYPHS. In R2L rows, they are prepended to | ||
| 20239 | the previous glyphs. */ | ||
| 20240 | if (!row->reversed_p) | ||
| 20241 | glyph = row->glyphs[TEXT_AREA] + n_glyphs_before + i; | ||
| 20242 | else | ||
| 20243 | glyph = row->glyphs[TEXT_AREA] + nglyphs - 1 - i; | ||
| 20208 | new_x = x + glyph->pixel_width; | 20244 | new_x = x + glyph->pixel_width; |
| 20209 | 20245 | ||
| 20210 | if (/* Lines are continued. */ | 20246 | if (/* Lines are continued. */ |
| @@ -20404,10 +20440,20 @@ display_line (struct it *it) | |||
| 20404 | if (it->bidi_p) | 20440 | if (it->bidi_p) |
| 20405 | RECORD_MAX_MIN_POS (it); | 20441 | RECORD_MAX_MIN_POS (it); |
| 20406 | 20442 | ||
| 20407 | if (x < it->first_visible_x) | 20443 | if (x < it->first_visible_x && !row->reversed_p) |
| 20408 | /* Glyph is partially visible, i.e. row starts at | 20444 | /* Glyph is partially visible, i.e. row starts at |
| 20409 | negative X position. */ | 20445 | negative X position. Don't do that in R2L |
| 20446 | rows, where we arrange to add a right offset to | ||
| 20447 | the line in extend_face_to_end_of_line, by a | ||
| 20448 | suitable change to the stretch glyph that is | ||
| 20449 | the leftmost glyph of the line. */ | ||
| 20410 | row->x = x - it->first_visible_x; | 20450 | row->x = x - it->first_visible_x; |
| 20451 | /* When the last glyph of an R2L row only fits | ||
| 20452 | partially on the line, we need to set row->x to a | ||
| 20453 | negative offset, so that the leftmost glyph is | ||
| 20454 | the one that is partially visible. */ | ||
| 20455 | if (row->reversed_p && new_x > it->last_visible_x) | ||
| 20456 | row->x = it->last_visible_x - new_x; | ||
| 20411 | } | 20457 | } |
| 20412 | else | 20458 | else |
| 20413 | { | 20459 | { |
| @@ -25305,6 +25351,24 @@ append_stretch_glyph (struct it *it, Lisp_Object object, | |||
| 25305 | for (g = glyph - 1; g >= it->glyph_row->glyphs[area]; g--) | 25351 | for (g = glyph - 1; g >= it->glyph_row->glyphs[area]; g--) |
| 25306 | g[1] = *g; | 25352 | g[1] = *g; |
| 25307 | glyph = it->glyph_row->glyphs[area]; | 25353 | glyph = it->glyph_row->glyphs[area]; |
| 25354 | |||
| 25355 | /* Decrease the width of the first glyph of the row that | ||
| 25356 | begins before first_visible_x (e.g., due to hscroll). | ||
| 25357 | This is so the overall width of the row becomes smaller | ||
| 25358 | by the scroll amount, and the stretch glyph appended by | ||
| 25359 | extend_face_to_end_of_line will be wider, to shift the | ||
| 25360 | row glyphs to the right. (In L2R rows, the corresponding | ||
| 25361 | left-shift effect is accomplished by setting row->x to a | ||
| 25362 | negative value, which won't work with R2L rows.) | ||
| 25363 | |||
| 25364 | This must leave us with a positive value of WIDTH, since | ||
| 25365 | otherwise the call to move_it_in_display_line_to at the | ||
| 25366 | beginning of display_line would have got past the entire | ||
| 25367 | first glyph, and then it->current_x would have been | ||
| 25368 | greater or equal to it->first_visible_x. */ | ||
| 25369 | if (it->current_x < it->first_visible_x) | ||
| 25370 | width -= it->first_visible_x - it->current_x; | ||
| 25371 | eassert (width > 0); | ||
| 25308 | } | 25372 | } |
| 25309 | glyph->charpos = CHARPOS (it->position); | 25373 | glyph->charpos = CHARPOS (it->position); |
| 25310 | glyph->object = object; | 25374 | glyph->object = object; |