diff options
| author | Glenn Morris | 2014-08-27 18:59:29 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-08-27 18:59:29 -0700 |
| commit | 6d26235315194737c4dc8653cf6d05177a10fa9c (patch) | |
| tree | 4a80f49f2073d80610931dd8706e90527a98340b /src | |
| parent | 93b31b57283d369fefc5c95082d7b09288f05128 (diff) | |
| parent | b62da77c1c94b393f8be7854ff1cb30b012aa238 (diff) | |
| download | emacs-6d26235315194737c4dc8653cf6d05177a10fa9c.tar.gz emacs-6d26235315194737c4dc8653cf6d05177a10fa9c.zip | |
Merge from emacs-24; up to 2014-07-02T00:57:53Z!juri@jurta.org
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 17 | ||||
| -rw-r--r-- | src/conf_post.h | 7 | ||||
| -rw-r--r-- | src/dispnew.c | 9 | ||||
| -rw-r--r-- | src/indent.c | 31 | ||||
| -rw-r--r-- | src/xdisp.c | 53 |
5 files changed, 96 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e79cef6a8a4..d08b3780242 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2014-08-28 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Don't define. | ||
| 4 | |||
| 5 | * indent.c (Fvertical_motion): Fix vertical motion up through a | ||
| 6 | display property after a newline. (Bug#18276) | ||
| 7 | |||
| 8 | * xdisp.c (display_line): Don't assume that the call to | ||
| 9 | reseat_at_next_visible_line_start ends up at a character | ||
| 10 | immediately following the newline on the previous line. Avoids | ||
| 11 | setting the ends_at_zv_p flag on screen lines that are not at or | ||
| 12 | beyond ZV, which causes infloop in redisplay. For the details, see | ||
| 13 | http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00368.html. | ||
| 14 | |||
| 15 | * dispnew.c (buffer_posn_from_coords): Fix mirroring of X | ||
| 16 | coordinate for hscrolled R2L screen lines. (Bug#18277) | ||
| 17 | |||
| 1 | 2014-08-28 Paul Eggert <eggert@cs.ucla.edu> | 18 | 2014-08-28 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 19 | ||
| 3 | * sysdep.c (LC_COLLATE, LC_COLLATE_MASK): Give individual defaults | 20 | * sysdep.c (LC_COLLATE, LC_COLLATE_MASK): Give individual defaults |
diff --git a/src/conf_post.h b/src/conf_post.h index a995acfd915..c8e3672b228 100644 --- a/src/conf_post.h +++ b/src/conf_post.h | |||
| @@ -123,13 +123,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ | |||
| 123 | so we could reuse it in readlinkat; see msdos.c. */ | 123 | so we could reuse it in readlinkat; see msdos.c. */ |
| 124 | #define opendir sys_opendir | 124 | #define opendir sys_opendir |
| 125 | 125 | ||
| 126 | /* The "portable" definition of _GL_INLINE on config.h does not work | ||
| 127 | with DJGPP GCC 3.4.4: it causes unresolved externals in sysdep.c, | ||
| 128 | although lib/execinfo.h is included and the inline functions there | ||
| 129 | are visible. */ | ||
| 130 | #if __GNUC__ < 4 | ||
| 131 | # define _GL_EXECINFO_INLINE inline | ||
| 132 | #endif | ||
| 133 | /* End of gnulib-related stuff. */ | 126 | /* End of gnulib-related stuff. */ |
| 134 | 127 | ||
| 135 | #define emacs_raise(sig) msdos_fatal_signal (sig) | 128 | #define emacs_raise(sig) msdos_fatal_signal (sig) |
diff --git a/src/dispnew.c b/src/dispnew.c index b587852fc6e..43ffca7c181 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -5143,9 +5143,8 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5143 | move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y); | 5143 | move_it_to (&it, -1, 0, *y, -1, MOVE_TO_X | MOVE_TO_Y); |
| 5144 | 5144 | ||
| 5145 | /* TO_X is the pixel position that the iterator will compute for the | 5145 | /* TO_X is the pixel position that the iterator will compute for the |
| 5146 | glyph at *X. We add it.first_visible_x because iterator | 5146 | glyph at *X. */ |
| 5147 | positions include the hscroll. */ | 5147 | to_x = x0; |
| 5148 | to_x = x0 + it.first_visible_x; | ||
| 5149 | if (it.bidi_it.paragraph_dir == R2L) | 5148 | if (it.bidi_it.paragraph_dir == R2L) |
| 5150 | /* For lines in an R2L paragraph, we need to mirror TO_X wrt the | 5149 | /* For lines in an R2L paragraph, we need to mirror TO_X wrt the |
| 5151 | text area. This is because the iterator, even in R2L | 5150 | text area. This is because the iterator, even in R2L |
| @@ -5159,6 +5158,10 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p | |||
| 5159 | it should be mirrored into zero pixel position.) */ | 5158 | it should be mirrored into zero pixel position.) */ |
| 5160 | to_x = window_box_width (w, TEXT_AREA) - to_x - 1; | 5159 | to_x = window_box_width (w, TEXT_AREA) - to_x - 1; |
| 5161 | 5160 | ||
| 5161 | /* We need to add it.first_visible_x because iterator positions | ||
| 5162 | include the hscroll. */ | ||
| 5163 | to_x += it.first_visible_x; | ||
| 5164 | |||
| 5162 | /* Now move horizontally in the row to the glyph under *X. Second | 5165 | /* Now move horizontally in the row to the glyph under *X. Second |
| 5163 | argument is ZV to prevent move_it_in_display_line from matching | 5166 | argument is ZV to prevent move_it_in_display_line from matching |
| 5164 | based on buffer positions. */ | 5167 | based on buffer positions. */ |
diff --git a/src/indent.c b/src/indent.c index 79af42c5f7e..e6b267a3891 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -2004,6 +2004,8 @@ whether or not it is currently displayed in some window. */) | |||
| 2004 | int first_x; | 2004 | int first_x; |
| 2005 | bool overshoot_handled = 0; | 2005 | bool overshoot_handled = 0; |
| 2006 | bool disp_string_at_start_p = 0; | 2006 | bool disp_string_at_start_p = 0; |
| 2007 | ptrdiff_t nlines = XINT (lines); | ||
| 2008 | int vpos_init = 0; | ||
| 2007 | 2009 | ||
| 2008 | itdata = bidi_shelve_cache (); | 2010 | itdata = bidi_shelve_cache (); |
| 2009 | SET_TEXT_POS (pt, PT, PT_BYTE); | 2011 | SET_TEXT_POS (pt, PT, PT_BYTE); |
| @@ -2093,18 +2095,31 @@ whether or not it is currently displayed in some window. */) | |||
| 2093 | 2095 | ||
| 2094 | overshoot_handled = 1; | 2096 | overshoot_handled = 1; |
| 2095 | } | 2097 | } |
| 2096 | if (XINT (lines) <= 0) | 2098 | else if (IT_CHARPOS (it) == PT - 1 |
| 2099 | && FETCH_BYTE (PT - 1) == '\n' | ||
| 2100 | && nlines < 0) | ||
| 2097 | { | 2101 | { |
| 2098 | it.vpos = 0; | 2102 | /* The position we started from was covered by a display |
| 2103 | property, so we moved to position before the string, and | ||
| 2104 | backed up one line, because the character at PT - 1 is a | ||
| 2105 | newline. So we need one less line to go up. */ | ||
| 2106 | nlines++; | ||
| 2107 | /* But we still need to record that one line, in order to | ||
| 2108 | return the correct value to the caller. */ | ||
| 2109 | vpos_init = -1; | ||
| 2110 | } | ||
| 2111 | if (nlines <= 0) | ||
| 2112 | { | ||
| 2113 | it.vpos = vpos_init; | ||
| 2099 | /* Do this even if LINES is 0, so that we move back to the | 2114 | /* Do this even if LINES is 0, so that we move back to the |
| 2100 | beginning of the current line as we ought. */ | 2115 | beginning of the current line as we ought. */ |
| 2101 | if (XINT (lines) == 0 || IT_CHARPOS (it) > 0) | 2116 | if (nlines == 0 || IT_CHARPOS (it) > 0) |
| 2102 | move_it_by_lines (&it, max (PTRDIFF_MIN, XINT (lines))); | 2117 | move_it_by_lines (&it, max (PTRDIFF_MIN, nlines)); |
| 2103 | } | 2118 | } |
| 2104 | else if (overshoot_handled) | 2119 | else if (overshoot_handled) |
| 2105 | { | 2120 | { |
| 2106 | it.vpos = 0; | 2121 | it.vpos = 0; |
| 2107 | move_it_by_lines (&it, min (PTRDIFF_MAX, XINT (lines))); | 2122 | move_it_by_lines (&it, min (PTRDIFF_MAX, nlines)); |
| 2108 | } | 2123 | } |
| 2109 | else | 2124 | else |
| 2110 | { | 2125 | { |
| @@ -2119,13 +2134,13 @@ whether or not it is currently displayed in some window. */) | |||
| 2119 | it.vpos = 0; | 2134 | it.vpos = 0; |
| 2120 | move_it_by_lines (&it, 1); | 2135 | move_it_by_lines (&it, 1); |
| 2121 | } | 2136 | } |
| 2122 | if (XINT (lines) > 1) | 2137 | if (nlines > 1) |
| 2123 | move_it_by_lines (&it, min (PTRDIFF_MAX, XINT (lines) - 1)); | 2138 | move_it_by_lines (&it, min (PTRDIFF_MAX, nlines - 1)); |
| 2124 | } | 2139 | } |
| 2125 | else | 2140 | else |
| 2126 | { | 2141 | { |
| 2127 | it.vpos = 0; | 2142 | it.vpos = 0; |
| 2128 | move_it_by_lines (&it, min (PTRDIFF_MAX, XINT (lines))); | 2143 | move_it_by_lines (&it, min (PTRDIFF_MAX, nlines)); |
| 2129 | } | 2144 | } |
| 2130 | } | 2145 | } |
| 2131 | 2146 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 39e70717143..1f2c5a02d6c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3413,6 +3413,48 @@ handle_stop (struct it *it) | |||
| 3413 | if (it->selective_display_ellipsis_p) | 3413 | if (it->selective_display_ellipsis_p) |
| 3414 | it->saved_face_id = it->face_id; | 3414 | it->saved_face_id = it->face_id; |
| 3415 | 3415 | ||
| 3416 | /* Here's the description of the semantics of, and the logic behind, | ||
| 3417 | the various HANDLED_* statuses: | ||
| 3418 | |||
| 3419 | HANDLED_NORMALLY means the handler did its job, and the loop | ||
| 3420 | should proceed to calling the next handler in order. | ||
| 3421 | |||
| 3422 | HANDLED_RECOMPUTE_PROPS means the handler caused a significant | ||
| 3423 | change in the properties and overlays at current position, so the | ||
| 3424 | loop should be restarted, to re-invoke the handlers that were | ||
| 3425 | already called. This happens when fontification-functions were | ||
| 3426 | called by handle_fontified_prop, and actually fontified | ||
| 3427 | something. Another case where HANDLED_RECOMPUTE_PROPS is | ||
| 3428 | returned is when we discover overlay strings that need to be | ||
| 3429 | displayed right away. The loop below will continue for as long | ||
| 3430 | as the status is HANDLED_RECOMPUTE_PROPS. | ||
| 3431 | |||
| 3432 | HANDLED_RETURN means return immediately to the caller, to | ||
| 3433 | continue iteration without calling any further handlers. This is | ||
| 3434 | used when we need to act on some property right away, for example | ||
| 3435 | when we need to display the ellipsis or a replacing display | ||
| 3436 | property, such as display string or image. | ||
| 3437 | |||
| 3438 | HANDLED_OVERLAY_STRING_CONSUMED means an overlay string was just | ||
| 3439 | consumed, and the handler switched to the next overlay string. | ||
| 3440 | This signals the loop below to refrain from looking for more | ||
| 3441 | overlays before all the overlay strings of the current overlay | ||
| 3442 | are processed. | ||
| 3443 | |||
| 3444 | Some of the handlers called by the loop push the iterator state | ||
| 3445 | onto the stack (see 'push_it'), and arrange for the iteration to | ||
| 3446 | continue with another object, such as an image, a display string, | ||
| 3447 | or an overlay string. In most such cases, it->stop_charpos is | ||
| 3448 | set to the first character of the string, so that when the | ||
| 3449 | iteration resumes, this function will immediately be called | ||
| 3450 | again, to examine the properties at the beginning of the string. | ||
| 3451 | |||
| 3452 | When a display or overlay string is exhausted, the iterator state | ||
| 3453 | is popped (see 'pop_it'), and iteration continues with the | ||
| 3454 | previous object. Again, in many such cases this function is | ||
| 3455 | called again to find the next position where properties might | ||
| 3456 | change. */ | ||
| 3457 | |||
| 3416 | do | 3458 | do |
| 3417 | { | 3459 | { |
| 3418 | handled = HANDLED_NORMALLY; | 3460 | handled = HANDLED_NORMALLY; |
| @@ -20621,10 +20663,15 @@ display_line (struct it *it) | |||
| 20621 | row->truncated_on_right_p = 1; | 20663 | row->truncated_on_right_p = 1; |
| 20622 | it->continuation_lines_width = 0; | 20664 | it->continuation_lines_width = 0; |
| 20623 | reseat_at_next_visible_line_start (it, 0); | 20665 | reseat_at_next_visible_line_start (it, 0); |
| 20624 | if (IT_BYTEPOS (*it) <= BEG_BYTE) | 20666 | /* We insist below that IT's position be at ZV because in |
| 20625 | row->ends_at_zv_p = true; | 20667 | bidi-reordered lines the character at visible line start |
| 20668 | might not be the character that follows the newline in | ||
| 20669 | the logical order. */ | ||
| 20670 | if (IT_BYTEPOS (*it) > BEG_BYTE) | ||
| 20671 | row->ends_at_zv_p = | ||
| 20672 | IT_BYTEPOS (*it) >= ZV_BYTE && FETCH_BYTE (ZV_BYTE - 1) != '\n'; | ||
| 20626 | else | 20673 | else |
| 20627 | row->ends_at_zv_p = FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n'; | 20674 | row->ends_at_zv_p = false; |
| 20628 | break; | 20675 | break; |
| 20629 | } | 20676 | } |
| 20630 | } | 20677 | } |