diff options
| author | Chong Yidong | 2012-05-14 19:59:28 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-05-14 19:59:28 +0800 |
| commit | e18afed7d695edac870ddf55aabc85c0a95a4b5f (patch) | |
| tree | 81dfa2c4b4cbc9014cb621f20eb2c5b173823a66 /src | |
| parent | ac9f0b75eb3a7fb50226cda2cfa1980c2df2b429 (diff) | |
| parent | c8fb9dc689cdd9facc56d7220bdf3bb5864231f0 (diff) | |
| download | emacs-e18afed7d695edac870ddf55aabc85c0a95a4b5f.tar.gz emacs-e18afed7d695edac870ddf55aabc85c0a95a4b5f.zip | |
Merge from emacs-24; up to 2012-04-22T13:58:00Z!cyd@gnu.org
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 35 | ||||
| -rw-r--r-- | src/unexaix.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 98 |
3 files changed, 127 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8b29c10c38d..3f9d575dce2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,38 @@ | |||
| 1 | 2012-05-14 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we | ||
| 4 | already have overlays loaded. | ||
| 5 | (handle_single_display_spec): Before returning without displaying | ||
| 6 | fringe bitmap, synchronize the bidi iterator with the main display | ||
| 7 | iterator, by calling iterate_out_of_display_property. | ||
| 8 | (iterate_out_of_display_property): Detect buffer iteration by | ||
| 9 | testing that it->string is a Lisp string. | ||
| 10 | (get_next_display_element): When the current object is exhausted, | ||
| 11 | and there's something on it->stack, call set_iterator_to_next to | ||
| 12 | proceed with what's on the stack, instead of returning zero. | ||
| 13 | (set_iterator_to_next): If called at the end of a Lisp string, | ||
| 14 | proceed to consider_string_end without incrementing string | ||
| 15 | position. Don't increment display vector index past the end of | ||
| 16 | the display vector. (Bug#11417) | ||
| 17 | (pos_visible_p): Don't report a position visible when move_it_to | ||
| 18 | stopped at the last line of window, which happens to be scanned | ||
| 19 | backwards by the bidi iteration. (Bug#11464) | ||
| 20 | |||
| 21 | 2012-05-14 Eli Zaretskii <eliz@gnu.org> | ||
| 22 | |||
| 23 | * xdisp.c (handle_single_display_spec): Return 1 for left-margin | ||
| 24 | and right-margin display specs even if the spec is invalid or we | ||
| 25 | are on a TTY, and thus unable to display on the fringes. That's | ||
| 26 | because the text with the property will not be displayed anyway, | ||
| 27 | so we need to signal to the caller that this is a "replacing" | ||
| 28 | display spec. This fixes display when the spec is invalid or we | ||
| 29 | are on a TTY. | ||
| 30 | |||
| 31 | 2012-05-14 Paul Eggert <eggert@cs.ucla.edu> | ||
| 32 | |||
| 33 | * unexaix.c (make_hdr): Fix typo in prototype. | ||
| 34 | This bug broke the build on AIX. Problem reported by Gilles Pion. | ||
| 35 | |||
| 1 | 2012-05-14 Michael Albinus <michael.albinus@gmx.de> | 36 | 2012-05-14 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 37 | ||
| 3 | * keyboard.c (kbd_buffer_get_event): Read special events also in | 38 | * keyboard.c (kbd_buffer_get_event): Read special events also in |
diff --git a/src/unexaix.c b/src/unexaix.c index 1bf65b68518..e27fb1d136d 100644 --- a/src/unexaix.c +++ b/src/unexaix.c | |||
| @@ -110,7 +110,7 @@ report_error_1 (int fd, char *msg, int a1, int a2) | |||
| 110 | error (msg, a1, a2); | 110 | error (msg, a1, a2); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | static int make_hdr (int, int, unsigned, unsigned, unsigned, char *, char *); | 113 | static int make_hdr (int, int, char *, char *); |
| 114 | static void mark_x (char *); | 114 | static void mark_x (char *); |
| 115 | static int copy_text_and_data (int); | 115 | static int copy_text_and_data (int); |
| 116 | static int copy_sym (int, int, char *, char *); | 116 | static int copy_sym (int, int, char *, char *); |
diff --git a/src/xdisp.c b/src/xdisp.c index 36ca69956d4..e7ecd2c1d91 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -849,6 +849,7 @@ static int try_cursor_movement (Lisp_Object, struct text_pos, int *); | |||
| 849 | static int trailing_whitespace_p (EMACS_INT); | 849 | static int trailing_whitespace_p (EMACS_INT); |
| 850 | static intmax_t message_log_check_duplicate (EMACS_INT, EMACS_INT); | 850 | static intmax_t message_log_check_duplicate (EMACS_INT, EMACS_INT); |
| 851 | static void push_it (struct it *, struct text_pos *); | 851 | static void push_it (struct it *, struct text_pos *); |
| 852 | static void iterate_out_of_display_property (struct it *); | ||
| 852 | static void pop_it (struct it *); | 853 | static void pop_it (struct it *); |
| 853 | static void sync_frame_with_window_matrix_rows (struct window *); | 854 | static void sync_frame_with_window_matrix_rows (struct window *); |
| 854 | static void select_frame_for_redisplay (Lisp_Object); | 855 | static void select_frame_for_redisplay (Lisp_Object); |
| @@ -1313,8 +1314,8 @@ pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y, | |||
| 1313 | glyph. */ | 1314 | glyph. */ |
| 1314 | int top_x = it.current_x; | 1315 | int top_x = it.current_x; |
| 1315 | int top_y = it.current_y; | 1316 | int top_y = it.current_y; |
| 1316 | enum it_method it_method = it.method; | ||
| 1317 | /* Calling line_bottom_y may change it.method, it.position, etc. */ | 1317 | /* Calling line_bottom_y may change it.method, it.position, etc. */ |
| 1318 | enum it_method it_method = it.method; | ||
| 1318 | int bottom_y = (last_height = 0, line_bottom_y (&it)); | 1319 | int bottom_y = (last_height = 0, line_bottom_y (&it)); |
| 1319 | int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); | 1320 | int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); |
| 1320 | 1321 | ||
| @@ -1322,6 +1323,31 @@ pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y, | |||
| 1322 | visible_p = bottom_y > window_top_y; | 1323 | visible_p = bottom_y > window_top_y; |
| 1323 | else if (top_y < it.last_visible_y) | 1324 | else if (top_y < it.last_visible_y) |
| 1324 | visible_p = 1; | 1325 | visible_p = 1; |
| 1326 | if (bottom_y >= it.last_visible_y | ||
| 1327 | && it.bidi_p && it.bidi_it.scan_dir == -1 | ||
| 1328 | && IT_CHARPOS (it) < charpos) | ||
| 1329 | { | ||
| 1330 | /* When the last line of the window is scanned backwards | ||
| 1331 | under bidi iteration, we could be duped into thinking | ||
| 1332 | that we have passed CHARPOS, when in fact move_it_to | ||
| 1333 | simply stopped short of CHARPOS because it reached | ||
| 1334 | last_visible_y. To see if that's what happened, we call | ||
| 1335 | move_it_to again with a slightly larger vertical limit, | ||
| 1336 | and see if it actually moved vertically; if it did, we | ||
| 1337 | didn't really reach CHARPOS, which is beyond window end. */ | ||
| 1338 | struct it save_it = it; | ||
| 1339 | /* Why 10? because we don't know how many canonical lines | ||
| 1340 | will the height of the next line(s) be. So we guess. */ | ||
| 1341 | int ten_more_lines = | ||
| 1342 | 10 * FRAME_LINE_HEIGHT (XFRAME (WINDOW_FRAME (w))); | ||
| 1343 | |||
| 1344 | move_it_to (&it, charpos, -1, bottom_y + ten_more_lines, -1, | ||
| 1345 | MOVE_TO_POS | MOVE_TO_Y); | ||
| 1346 | if (it.current_y > top_y) | ||
| 1347 | visible_p = 0; | ||
| 1348 | |||
| 1349 | it = save_it; | ||
| 1350 | } | ||
| 1325 | if (visible_p) | 1351 | if (visible_p) |
| 1326 | { | 1352 | { |
| 1327 | if (it_method == GET_FROM_DISPLAY_VECTOR) | 1353 | if (it_method == GET_FROM_DISPLAY_VECTOR) |
| @@ -3135,7 +3161,15 @@ handle_stop (struct it *it) | |||
| 3135 | overlays even if the actual buffer text is replaced. */ | 3161 | overlays even if the actual buffer text is replaced. */ |
| 3136 | if (!handle_overlay_change_p | 3162 | if (!handle_overlay_change_p |
| 3137 | || it->sp > 1 | 3163 | || it->sp > 1 |
| 3138 | || !get_overlay_strings_1 (it, 0, 0)) | 3164 | /* Don't call get_overlay_strings_1 if we already |
| 3165 | have overlay strings loaded, because doing so | ||
| 3166 | will load them again and push the iterator state | ||
| 3167 | onto the stack one more time, which is not | ||
| 3168 | expected by the rest of the code that processes | ||
| 3169 | overlay strings. */ | ||
| 3170 | || (it->n_overlay_strings <= 0 | ||
| 3171 | ? !get_overlay_strings_1 (it, 0, 0) | ||
| 3172 | : 0)) | ||
| 3139 | { | 3173 | { |
| 3140 | if (it->ellipsis_p) | 3174 | if (it->ellipsis_p) |
| 3141 | setup_for_ellipsis (it, 0); | 3175 | setup_for_ellipsis (it, 0); |
| @@ -4691,10 +4725,22 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 4691 | if (!FRAME_WINDOW_P (it->f)) | 4725 | if (!FRAME_WINDOW_P (it->f)) |
| 4692 | /* If we return here, POSITION has been advanced | 4726 | /* If we return here, POSITION has been advanced |
| 4693 | across the text with this property. */ | 4727 | across the text with this property. */ |
| 4694 | return 0; | 4728 | { |
| 4729 | /* Synchronize the bidi iterator with POSITION. This is | ||
| 4730 | needed because we are not going to push the iterator | ||
| 4731 | on behalf of this display property, so there will be | ||
| 4732 | no pop_it call to do this synchronization for us. */ | ||
| 4733 | if (it->bidi_p) | ||
| 4734 | { | ||
| 4735 | it->position = *position; | ||
| 4736 | iterate_out_of_display_property (it); | ||
| 4737 | *position = it->position; | ||
| 4738 | } | ||
| 4739 | return 1; | ||
| 4740 | } | ||
| 4695 | } | 4741 | } |
| 4696 | else if (!frame_window_p) | 4742 | else if (!frame_window_p) |
| 4697 | return 0; | 4743 | return 1; |
| 4698 | 4744 | ||
| 4699 | #ifdef HAVE_WINDOW_SYSTEM | 4745 | #ifdef HAVE_WINDOW_SYSTEM |
| 4700 | value = XCAR (XCDR (spec)); | 4746 | value = XCAR (XCDR (spec)); |
| @@ -4702,7 +4748,15 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 4702 | || !(fringe_bitmap = lookup_fringe_bitmap (value))) | 4748 | || !(fringe_bitmap = lookup_fringe_bitmap (value))) |
| 4703 | /* If we return here, POSITION has been advanced | 4749 | /* If we return here, POSITION has been advanced |
| 4704 | across the text with this property. */ | 4750 | across the text with this property. */ |
| 4705 | return 0; | 4751 | { |
| 4752 | if (it && it->bidi_p) | ||
| 4753 | { | ||
| 4754 | it->position = *position; | ||
| 4755 | iterate_out_of_display_property (it); | ||
| 4756 | *position = it->position; | ||
| 4757 | } | ||
| 4758 | return 1; | ||
| 4759 | } | ||
| 4706 | 4760 | ||
| 4707 | if (it) | 4761 | if (it) |
| 4708 | { | 4762 | { |
| @@ -5621,7 +5675,7 @@ push_it (struct it *it, struct text_pos *position) | |||
| 5621 | static void | 5675 | static void |
| 5622 | iterate_out_of_display_property (struct it *it) | 5676 | iterate_out_of_display_property (struct it *it) |
| 5623 | { | 5677 | { |
| 5624 | int buffer_p = BUFFERP (it->object); | 5678 | int buffer_p = !STRINGP (it->string); |
| 5625 | EMACS_INT eob = (buffer_p ? ZV : it->end_charpos); | 5679 | EMACS_INT eob = (buffer_p ? ZV : it->end_charpos); |
| 5626 | EMACS_INT bob = (buffer_p ? BEGV : 0); | 5680 | EMACS_INT bob = (buffer_p ? BEGV : 0); |
| 5627 | 5681 | ||
| @@ -6790,6 +6844,16 @@ get_next_display_element (struct it *it) | |||
| 6790 | && FACE_FROM_ID (it->f, face_id)->box == FACE_NO_BOX); | 6844 | && FACE_FROM_ID (it->f, face_id)->box == FACE_NO_BOX); |
| 6791 | } | 6845 | } |
| 6792 | } | 6846 | } |
| 6847 | /* If we reached the end of the object we've been iterating (e.g., a | ||
| 6848 | display string or an overlay string), and there's something on | ||
| 6849 | IT->stack, proceed with what's on the stack. It doesn't make | ||
| 6850 | sense to return zero if there's unprocessed stuff on the stack, | ||
| 6851 | because otherwise that stuff will never be displayed. */ | ||
| 6852 | if (!success_p && it->sp > 0) | ||
| 6853 | { | ||
| 6854 | set_iterator_to_next (it, 0); | ||
| 6855 | success_p = get_next_display_element (it); | ||
| 6856 | } | ||
| 6793 | 6857 | ||
| 6794 | /* Value is 0 if end of buffer or string reached. */ | 6858 | /* Value is 0 if end of buffer or string reached. */ |
| 6795 | return success_p; | 6859 | return success_p; |
| @@ -6971,7 +7035,7 @@ set_iterator_to_next (struct it *it, int reseat_p) | |||
| 6971 | display vector entry (these entries may contain faces). */ | 7035 | display vector entry (these entries may contain faces). */ |
| 6972 | it->face_id = it->saved_face_id; | 7036 | it->face_id = it->saved_face_id; |
| 6973 | 7037 | ||
| 6974 | if (it->dpvec + it->current.dpvec_index == it->dpend) | 7038 | if (it->dpvec + it->current.dpvec_index >= it->dpend) |
| 6975 | { | 7039 | { |
| 6976 | int recheck_faces = it->ellipsis_p; | 7040 | int recheck_faces = it->ellipsis_p; |
| 6977 | 7041 | ||
| @@ -7009,6 +7073,26 @@ set_iterator_to_next (struct it *it, int reseat_p) | |||
| 7009 | case GET_FROM_STRING: | 7073 | case GET_FROM_STRING: |
| 7010 | /* Current display element is a character from a Lisp string. */ | 7074 | /* Current display element is a character from a Lisp string. */ |
| 7011 | xassert (it->s == NULL && STRINGP (it->string)); | 7075 | xassert (it->s == NULL && STRINGP (it->string)); |
| 7076 | /* Don't advance past string end. These conditions are true | ||
| 7077 | when set_iterator_to_next is called at the end of | ||
| 7078 | get_next_display_element, in which case the Lisp string is | ||
| 7079 | already exhausted, and all we want is pop the iterator | ||
| 7080 | stack. */ | ||
| 7081 | if (it->current.overlay_string_index >= 0) | ||
| 7082 | { | ||
| 7083 | /* This is an overlay string, so there's no padding with | ||
| 7084 | spaces, and the number of characters in the string is | ||
| 7085 | where the string ends. */ | ||
| 7086 | if (IT_STRING_CHARPOS (*it) >= SCHARS (it->string)) | ||
| 7087 | goto consider_string_end; | ||
| 7088 | } | ||
| 7089 | else | ||
| 7090 | { | ||
| 7091 | /* Not an overlay string. There could be padding, so test | ||
| 7092 | against it->end_charpos . */ | ||
| 7093 | if (IT_STRING_CHARPOS (*it) >= it->end_charpos) | ||
| 7094 | goto consider_string_end; | ||
| 7095 | } | ||
| 7012 | if (it->cmp_it.id >= 0) | 7096 | if (it->cmp_it.id >= 0) |
| 7013 | { | 7097 | { |
| 7014 | int i; | 7098 | int i; |