diff options
| author | Glenn Morris | 2014-07-08 19:04:12 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-07-08 19:04:12 -0700 |
| commit | 5613a6f6d52bca0018c5777aba67a99f51016a35 (patch) | |
| tree | c070100c79442ae2f9876f82af4eeebadc39249c /src | |
| parent | 27e81f9f4e368176a3b17ceeadd2e0aa5dd9d1ed (diff) | |
| parent | d8899d09b992d733dc1cc6ec93b11cb75ce84f5d (diff) | |
| download | emacs-5613a6f6d52bca0018c5777aba67a99f51016a35.tar.gz emacs-5613a6f6d52bca0018c5777aba67a99f51016a35.zip | |
Merge from emacs-24; up to 2014-06-19T14:03:45Z!monnier@iro.umontreal.ca
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 34 | ||||
| -rw-r--r-- | src/syntax.c | 36 | ||||
| -rw-r--r-- | src/w32.c | 1 | ||||
| -rw-r--r-- | src/window.c | 26 | ||||
| -rw-r--r-- | src/xdisp.c | 40 |
5 files changed, 121 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4c4ca3a5e00..ba56edda715 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,37 @@ | |||
| 1 | 2014-07-09 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (move_it_to): Adjust calculation of line_start_x to what | ||
| 4 | x_produce_glyphs does when it generates a stretch glyph that | ||
| 5 | represents a TAB. (Bug#17969) | ||
| 6 | |||
| 7 | * xdisp.c (pos_visible_p): If CHARPOS is at beginning of window, | ||
| 8 | and there is a display property at that position, don't call | ||
| 9 | move_it_to to move to a position before window start. (Bug#17942) | ||
| 10 | Fix condition for finding CHARPOS by the first call to move_it_to. | ||
| 11 | (Bug#17944) | ||
| 12 | |||
| 13 | 2014-07-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 14 | |||
| 15 | * syntax.c (find_defun_start): Try the cache even | ||
| 16 | if !open_paren_in_column_0_is_defun_start. | ||
| 17 | (back_comment): If find_defun_start was pessimistic, use the | ||
| 18 | scan_sexps_forward result to improve the cache (bug#16526). | ||
| 19 | |||
| 20 | 2014-07-09 Eli Zaretskii <eliz@gnu.org> | ||
| 21 | |||
| 22 | * xdisp.c (redisplay_window): If redisplay of a window ends up | ||
| 23 | with point in a partially visible line at end of the window, make | ||
| 24 | sure the amended position of point actually has smaller Y | ||
| 25 | coordinate; if not, give up and scroll the display. (Bug#17905) | ||
| 26 | |||
| 27 | * window.c (window_scroll_pixel_based): When point ends up at the | ||
| 28 | last fully visible line, don't let move_it_to stop at the left | ||
| 29 | edge of the line and dupe us into thinking point is inside the | ||
| 30 | scroll margin. | ||
| 31 | |||
| 32 | * w32.c (network_interface_info): Make sure the argument is a | ||
| 33 | Lisp string. | ||
| 34 | |||
| 1 | 2014-07-08 Paul Eggert <eggert@cs.ucla.edu> | 35 | 2014-07-08 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 36 | ||
| 3 | * process.c (read_and_dispose_of_process_output): Fix typo | 37 | * process.c (read_and_dispose_of_process_output): Fix typo |
diff --git a/src/syntax.c b/src/syntax.c index f2451332b19..0ee48bb3725 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -530,17 +530,6 @@ find_defun_start (ptrdiff_t pos, ptrdiff_t pos_byte) | |||
| 530 | { | 530 | { |
| 531 | ptrdiff_t opoint = PT, opoint_byte = PT_BYTE; | 531 | ptrdiff_t opoint = PT, opoint_byte = PT_BYTE; |
| 532 | 532 | ||
| 533 | if (!open_paren_in_column_0_is_defun_start) | ||
| 534 | { | ||
| 535 | find_start_value = BEGV; | ||
| 536 | find_start_value_byte = BEGV_BYTE; | ||
| 537 | find_start_buffer = current_buffer; | ||
| 538 | find_start_modiff = MODIFF; | ||
| 539 | find_start_begv = BEGV; | ||
| 540 | find_start_pos = pos; | ||
| 541 | return BEGV; | ||
| 542 | } | ||
| 543 | |||
| 544 | /* Use previous finding, if it's valid and applies to this inquiry. */ | 533 | /* Use previous finding, if it's valid and applies to this inquiry. */ |
| 545 | if (current_buffer == find_start_buffer | 534 | if (current_buffer == find_start_buffer |
| 546 | /* Reuse the defun-start even if POS is a little farther on. | 535 | /* Reuse the defun-start even if POS is a little farther on. |
| @@ -552,6 +541,13 @@ find_defun_start (ptrdiff_t pos, ptrdiff_t pos_byte) | |||
| 552 | && MODIFF == find_start_modiff) | 541 | && MODIFF == find_start_modiff) |
| 553 | return find_start_value; | 542 | return find_start_value; |
| 554 | 543 | ||
| 544 | if (!open_paren_in_column_0_is_defun_start) | ||
| 545 | { | ||
| 546 | find_start_value = BEGV; | ||
| 547 | find_start_value_byte = BEGV_BYTE; | ||
| 548 | goto found; | ||
| 549 | } | ||
| 550 | |||
| 555 | /* Back up to start of line. */ | 551 | /* Back up to start of line. */ |
| 556 | scan_newline (pos, pos_byte, BEGV, BEGV_BYTE, -1, 1); | 552 | scan_newline (pos, pos_byte, BEGV, BEGV_BYTE, -1, 1); |
| 557 | 553 | ||
| @@ -582,13 +578,14 @@ find_defun_start (ptrdiff_t pos, ptrdiff_t pos_byte) | |||
| 582 | /* Record what we found, for the next try. */ | 578 | /* Record what we found, for the next try. */ |
| 583 | find_start_value = PT; | 579 | find_start_value = PT; |
| 584 | find_start_value_byte = PT_BYTE; | 580 | find_start_value_byte = PT_BYTE; |
| 581 | TEMP_SET_PT_BOTH (opoint, opoint_byte); | ||
| 582 | |||
| 583 | found: | ||
| 585 | find_start_buffer = current_buffer; | 584 | find_start_buffer = current_buffer; |
| 586 | find_start_modiff = MODIFF; | 585 | find_start_modiff = MODIFF; |
| 587 | find_start_begv = BEGV; | 586 | find_start_begv = BEGV; |
| 588 | find_start_pos = pos; | 587 | find_start_pos = pos; |
| 589 | 588 | ||
| 590 | TEMP_SET_PT_BOTH (opoint, opoint_byte); | ||
| 591 | |||
| 592 | return find_start_value; | 589 | return find_start_value; |
| 593 | } | 590 | } |
| 594 | 591 | ||
| @@ -841,7 +838,9 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, | |||
| 841 | else | 838 | else |
| 842 | { | 839 | { |
| 843 | struct lisp_parse_state state; | 840 | struct lisp_parse_state state; |
| 841 | bool adjusted; | ||
| 844 | lossage: | 842 | lossage: |
| 843 | adjusted = true; | ||
| 845 | /* We had two kinds of string delimiters mixed up | 844 | /* We had two kinds of string delimiters mixed up |
| 846 | together. Decode this going forwards. | 845 | together. Decode this going forwards. |
| 847 | Scan fwd from a known safe place (beginning-of-defun) | 846 | Scan fwd from a known safe place (beginning-of-defun) |
| @@ -852,6 +851,7 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, | |||
| 852 | { | 851 | { |
| 853 | defun_start = find_defun_start (comment_end, comment_end_byte); | 852 | defun_start = find_defun_start (comment_end, comment_end_byte); |
| 854 | defun_start_byte = find_start_value_byte; | 853 | defun_start_byte = find_start_value_byte; |
| 854 | adjusted = (defun_start > BEGV); | ||
| 855 | } | 855 | } |
| 856 | do | 856 | do |
| 857 | { | 857 | { |
| @@ -860,6 +860,16 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop, | |||
| 860 | comment_end, TYPE_MINIMUM (EMACS_INT), | 860 | comment_end, TYPE_MINIMUM (EMACS_INT), |
| 861 | 0, Qnil, 0); | 861 | 0, Qnil, 0); |
| 862 | defun_start = comment_end; | 862 | defun_start = comment_end; |
| 863 | if (!adjusted) | ||
| 864 | { | ||
| 865 | adjusted = true; | ||
| 866 | find_start_value | ||
| 867 | = CONSP (state.levelstarts) ? XINT (XCAR (state.levelstarts)) | ||
| 868 | : state.thislevelstart >= 0 ? state.thislevelstart | ||
| 869 | : find_start_value; | ||
| 870 | find_start_value_byte = CHAR_TO_BYTE (find_start_value); | ||
| 871 | } | ||
| 872 | |||
| 863 | if (state.incomment == (comnested ? 1 : -1) | 873 | if (state.incomment == (comnested ? 1 : -1) |
| 864 | && state.comstyle == comstyle) | 874 | && state.comstyle == comstyle) |
| 865 | from = state.comstr_start; | 875 | from = state.comstr_start; |
| @@ -8612,6 +8612,7 @@ network_interface_list (void) | |||
| 8612 | Lisp_Object | 8612 | Lisp_Object |
| 8613 | network_interface_info (Lisp_Object ifname) | 8613 | network_interface_info (Lisp_Object ifname) |
| 8614 | { | 8614 | { |
| 8615 | CHECK_STRING (ifname); | ||
| 8615 | return network_interface_get_info (ifname); | 8616 | return network_interface_get_info (ifname); |
| 8616 | } | 8617 | } |
| 8617 | 8618 | ||
diff --git a/src/window.c b/src/window.c index 8a608433ed7..6afe7454149 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -5161,6 +5161,32 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror) | |||
| 5161 | charpos = IT_CHARPOS (it); | 5161 | charpos = IT_CHARPOS (it); |
| 5162 | bytepos = IT_BYTEPOS (it); | 5162 | bytepos = IT_BYTEPOS (it); |
| 5163 | 5163 | ||
| 5164 | /* If PT is in the screen line at the last fully visible line, | ||
| 5165 | move_it_to will stop at X = 0 in that line, because the | ||
| 5166 | required Y coordinate is reached there. See if we can get to | ||
| 5167 | PT without descending lower in Y, and if we can, it means we | ||
| 5168 | reached PT before the scroll margin. */ | ||
| 5169 | if (charpos != PT) | ||
| 5170 | { | ||
| 5171 | struct it it2; | ||
| 5172 | void *it_data; | ||
| 5173 | |||
| 5174 | it2 = it; | ||
| 5175 | it_data = bidi_shelve_cache (); | ||
| 5176 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); | ||
| 5177 | if (IT_CHARPOS (it) == PT && it.current_y == it2.current_y) | ||
| 5178 | { | ||
| 5179 | charpos = IT_CHARPOS (it); | ||
| 5180 | bytepos = IT_BYTEPOS (it); | ||
| 5181 | bidi_unshelve_cache (it_data, 1); | ||
| 5182 | } | ||
| 5183 | else | ||
| 5184 | { | ||
| 5185 | it = it2; | ||
| 5186 | bidi_unshelve_cache (it_data, 0); | ||
| 5187 | } | ||
| 5188 | } | ||
| 5189 | |||
| 5164 | /* See if point is on a partially visible line at the end. */ | 5190 | /* See if point is on a partially visible line at the end. */ |
| 5165 | if (it.what == IT_EOB) | 5191 | if (it.what == IT_EOB) |
| 5166 | partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y; | 5192 | partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y; |
diff --git a/src/xdisp.c b/src/xdisp.c index 6cec0bf1925..6b2fa4be846 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1436,7 +1436,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, | |||
| 1436 | (charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y); | 1436 | (charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y); |
| 1437 | 1437 | ||
| 1438 | if (charpos >= 0 | 1438 | if (charpos >= 0 |
| 1439 | && (((!it.bidi_p || it.bidi_it.scan_dir == 1) | 1439 | && (((!it.bidi_p || it.bidi_it.scan_dir != -1) |
| 1440 | && IT_CHARPOS (it) >= charpos) | 1440 | && IT_CHARPOS (it) >= charpos) |
| 1441 | /* When scanning backwards under bidi iteration, move_it_to | 1441 | /* When scanning backwards under bidi iteration, move_it_to |
| 1442 | stops at or _before_ CHARPOS, because it stops at or to | 1442 | stops at or _before_ CHARPOS, because it stops at or to |
| @@ -1585,7 +1585,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, | |||
| 1585 | /* Move to the last buffer position before the | 1585 | /* Move to the last buffer position before the |
| 1586 | display property. */ | 1586 | display property. */ |
| 1587 | start_display (&it3, w, top); | 1587 | start_display (&it3, w, top); |
| 1588 | move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS); | 1588 | if (start > CHARPOS (top)) |
| 1589 | move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS); | ||
| 1589 | /* Move forward one more line if the position before | 1590 | /* Move forward one more line if the position before |
| 1590 | the display string is a newline or if it is the | 1591 | the display string is a newline or if it is the |
| 1591 | rightmost character on a line that is | 1592 | rightmost character on a line that is |
| @@ -1688,7 +1689,9 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, | |||
| 1688 | } | 1689 | } |
| 1689 | else | 1690 | else |
| 1690 | { | 1691 | { |
| 1691 | /* We were asked to provide info about WINDOW_END. */ | 1692 | /* Either we were asked to provide info about WINDOW_END, or |
| 1693 | CHARPOS is in the partially visible glyph row at end of | ||
| 1694 | window. */ | ||
| 1692 | struct it it2; | 1695 | struct it it2; |
| 1693 | void *it2data = NULL; | 1696 | void *it2data = NULL; |
| 1694 | 1697 | ||
| @@ -9247,6 +9250,25 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos | |||
| 9247 | { | 9250 | { |
| 9248 | line_start_x = it->current_x + it->pixel_width | 9251 | line_start_x = it->current_x + it->pixel_width |
| 9249 | - it->last_visible_x; | 9252 | - it->last_visible_x; |
| 9253 | if (FRAME_WINDOW_P (it->f)) | ||
| 9254 | { | ||
| 9255 | struct face *face = FACE_FROM_ID (it->f, it->face_id); | ||
| 9256 | struct font *face_font = face->font; | ||
| 9257 | |||
| 9258 | /* When display_line produces a continued line | ||
| 9259 | that ends in a TAB, it skips a tab stop that | ||
| 9260 | is closer than the font's space character | ||
| 9261 | width (see x_produce_glyphs where it produces | ||
| 9262 | the stretch glyph which represents a TAB). | ||
| 9263 | We need to reproduce the same logic here. */ | ||
| 9264 | eassert (face_font); | ||
| 9265 | if (face_font) | ||
| 9266 | { | ||
| 9267 | if (line_start_x < face_font->space_width) | ||
| 9268 | line_start_x | ||
| 9269 | += it->tab_width * face_font->space_width; | ||
| 9270 | } | ||
| 9271 | } | ||
| 9250 | set_iterator_to_next (it, 0); | 9272 | set_iterator_to_next (it, 0); |
| 9251 | } | 9273 | } |
| 9252 | } | 9274 | } |
| @@ -16088,6 +16110,18 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 16088 | /* Point does appear, but on a line partly visible at end of window. | 16110 | /* Point does appear, but on a line partly visible at end of window. |
| 16089 | Move it back to a fully-visible line. */ | 16111 | Move it back to a fully-visible line. */ |
| 16090 | new_vpos = window_box_height (w); | 16112 | new_vpos = window_box_height (w); |
| 16113 | /* But if window_box_height suggests a Y coordinate that is | ||
| 16114 | not less than we already have, that line will clearly not | ||
| 16115 | be fully visible, so give up and scroll the display. | ||
| 16116 | This can happen when the default face uses a font whose | ||
| 16117 | dimensions are different from the frame's default | ||
| 16118 | font. */ | ||
| 16119 | if (new_vpos >= w->cursor.y) | ||
| 16120 | { | ||
| 16121 | w->cursor.vpos = -1; | ||
| 16122 | clear_glyph_matrix (w->desired_matrix); | ||
| 16123 | goto try_to_scroll; | ||
| 16124 | } | ||
| 16091 | } | 16125 | } |
| 16092 | else if (w->cursor.vpos >= 0) | 16126 | else if (w->cursor.vpos >= 0) |
| 16093 | { | 16127 | { |