aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdisp.c
diff options
context:
space:
mode:
authorStefan Monnier2011-03-21 12:42:16 -0400
committerStefan Monnier2011-03-21 12:42:16 -0400
commitcafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch)
tree7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /src/xdisp.c
parenta08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff)
parent4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff)
downloademacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz
emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip
Merge from trunk
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c65
1 files changed, 34 insertions, 31 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 44cb7130119..a7955f41e0c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -10909,7 +10909,7 @@ hscroll_window_tree (Lisp_Object window)
10909 current_buffer = XBUFFER (w->buffer); 10909 current_buffer = XBUFFER (w->buffer);
10910 10910
10911 if (w == XWINDOW (selected_window)) 10911 if (w == XWINDOW (selected_window))
10912 pt = BUF_PT (current_buffer); 10912 pt = PT;
10913 else 10913 else
10914 { 10914 {
10915 pt = marker_position (w->pointm); 10915 pt = marker_position (w->pointm);
@@ -11347,7 +11347,7 @@ reconsider_clip_changes (struct window *w, struct buffer *b)
11347 EMACS_INT pt; 11347 EMACS_INT pt;
11348 11348
11349 if (w == XWINDOW (selected_window)) 11349 if (w == XWINDOW (selected_window))
11350 pt = BUF_PT (current_buffer); 11350 pt = PT;
11351 else 11351 else
11352 pt = marker_position (w->pointm); 11352 pt = marker_position (w->pointm);
11353 11353
@@ -13697,6 +13697,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
13697 int buffer_unchanged_p = 0; 13697 int buffer_unchanged_p = 0;
13698 int temp_scroll_step = 0; 13698 int temp_scroll_step = 0;
13699 int count = SPECPDL_INDEX (); 13699 int count = SPECPDL_INDEX ();
13700 int rc;
13700 int centering_position = -1; 13701 int centering_position = -1;
13701 int last_line_misfit = 0; 13702 int last_line_misfit = 0;
13702 EMACS_INT beg_unchanged, end_unchanged; 13703 EMACS_INT beg_unchanged, end_unchanged;
@@ -14008,15 +14009,12 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14008 /* Handle case where text has not changed, only point, and it has 14009 /* Handle case where text has not changed, only point, and it has
14009 not moved off the frame, and we are not retrying after hscroll. 14010 not moved off the frame, and we are not retrying after hscroll.
14010 (current_matrix_up_to_date_p is nonzero when retrying.) */ 14011 (current_matrix_up_to_date_p is nonzero when retrying.) */
14011 if (current_matrix_up_to_date_p) 14012 if (current_matrix_up_to_date_p
14013 && (rc = try_cursor_movement (window, startp, &temp_scroll_step),
14014 rc != CURSOR_MOVEMENT_CANNOT_BE_USED))
14012 { 14015 {
14013 int rc = try_cursor_movement (window, startp, &temp_scroll_step);
14014
14015 switch (rc) 14016 switch (rc)
14016 { 14017 {
14017 case CURSOR_MOVEMENT_CANNOT_BE_USED:
14018 break;
14019
14020 case CURSOR_MOVEMENT_SUCCESS: 14018 case CURSOR_MOVEMENT_SUCCESS:
14021 used_current_matrix_p = 1; 14019 used_current_matrix_p = 1;
14022 goto done; 14020 goto done;
@@ -14165,11 +14163,11 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14165 { 14163 {
14166 /* The function returns -1 if new fonts were loaded, 1 if 14164 /* The function returns -1 if new fonts were loaded, 1 if
14167 successful, 0 if not successful. */ 14165 successful, 0 if not successful. */
14168 int rc = try_scrolling (window, just_this_one_p, 14166 int ss = try_scrolling (window, just_this_one_p,
14169 scroll_conservatively, 14167 scroll_conservatively,
14170 emacs_scroll_step, 14168 emacs_scroll_step,
14171 temp_scroll_step, last_line_misfit); 14169 temp_scroll_step, last_line_misfit);
14172 switch (rc) 14170 switch (ss)
14173 { 14171 {
14174 case SCROLLING_SUCCESS: 14172 case SCROLLING_SUCCESS:
14175 goto done; 14173 goto done;
@@ -17231,14 +17229,16 @@ display_line (struct it *it)
17231 struct glyph_row *row = it->glyph_row; 17229 struct glyph_row *row = it->glyph_row;
17232 Lisp_Object overlay_arrow_string; 17230 Lisp_Object overlay_arrow_string;
17233 struct it wrap_it; 17231 struct it wrap_it;
17234 int may_wrap = 0, wrap_x; 17232 int may_wrap = 0, wrap_x IF_LINT (= 0);
17235 int wrap_row_used = -1, wrap_row_ascent, wrap_row_height; 17233 int wrap_row_used = -1;
17236 int wrap_row_phys_ascent, wrap_row_phys_height; 17234 int wrap_row_ascent IF_LINT (= 0), wrap_row_height IF_LINT (= 0);
17237 int wrap_row_extra_line_spacing; 17235 int wrap_row_phys_ascent IF_LINT (= 0), wrap_row_phys_height IF_LINT (= 0);
17238 EMACS_INT wrap_row_min_pos, wrap_row_min_bpos; 17236 int wrap_row_extra_line_spacing IF_LINT (= 0);
17239 EMACS_INT wrap_row_max_pos, wrap_row_max_bpos; 17237 EMACS_INT wrap_row_min_pos IF_LINT (= 0), wrap_row_min_bpos IF_LINT (= 0);
17238 EMACS_INT wrap_row_max_pos IF_LINT (= 0), wrap_row_max_bpos IF_LINT (= 0);
17240 int cvpos; 17239 int cvpos;
17241 EMACS_INT min_pos = ZV + 1, min_bpos, max_pos = 0, max_bpos; 17240 EMACS_INT min_pos = ZV + 1, max_pos = 0;
17241 EMACS_INT min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0);
17242 17242
17243 /* We always start displaying at hpos zero even if hscrolled. */ 17243 /* We always start displaying at hpos zero even if hscrolled. */
17244 xassert (it->hpos == 0 && it->current_x == 0); 17244 xassert (it->hpos == 0 && it->current_x == 0);
@@ -17912,16 +17912,13 @@ paragraphs, text begins at the right margin and is read from right to left.
17912See also `bidi-paragraph-direction'. */) 17912See also `bidi-paragraph-direction'. */)
17913 (Lisp_Object buffer) 17913 (Lisp_Object buffer)
17914{ 17914{
17915 struct buffer *buf; 17915 struct buffer *buf = current_buffer;
17916 struct buffer *old; 17916 struct buffer *old = buf;
17917 17917
17918 if (NILP (buffer)) 17918 if (! NILP (buffer))
17919 buf = current_buffer;
17920 else
17921 { 17919 {
17922 CHECK_BUFFER (buffer); 17920 CHECK_BUFFER (buffer);
17923 buf = XBUFFER (buffer); 17921 buf = XBUFFER (buffer);
17924 old = current_buffer;
17925 } 17922 }
17926 17923
17927 if (NILP (BVAR (buf, bidi_display_reordering))) 17924 if (NILP (BVAR (buf, bidi_display_reordering)))
@@ -17938,8 +17935,7 @@ See also `bidi-paragraph-direction'. */)
17938 EMACS_INT bytepos = BUF_PT_BYTE (buf); 17935 EMACS_INT bytepos = BUF_PT_BYTE (buf);
17939 int c; 17936 int c;
17940 17937
17941 if (buf != current_buffer) 17938 set_buffer_temp (buf);
17942 set_buffer_temp (buf);
17943 /* bidi_paragraph_init finds the base direction of the paragraph 17939 /* bidi_paragraph_init finds the base direction of the paragraph
17944 by searching forward from paragraph start. We need the base 17940 by searching forward from paragraph start. We need the base
17945 direction of the current or _previous_ paragraph, so we need 17941 direction of the current or _previous_ paragraph, so we need
@@ -17967,8 +17963,7 @@ See also `bidi-paragraph-direction'. */)
17967 itb.paragraph_dir = NEUTRAL_DIR; 17963 itb.paragraph_dir = NEUTRAL_DIR;
17968 17964
17969 bidi_paragraph_init (NEUTRAL_DIR, &itb, 1); 17965 bidi_paragraph_init (NEUTRAL_DIR, &itb, 1);
17970 if (buf != current_buffer) 17966 set_buffer_temp (old);
17971 set_buffer_temp (old);
17972 switch (itb.paragraph_dir) 17967 switch (itb.paragraph_dir)
17973 { 17968 {
17974 case L2R: 17969 case L2R:
@@ -21092,7 +21087,7 @@ compute_overhangs_and_x (struct glyph_string *s, int x, int backward_p)
21092 int cmp_id = (row)->glyphs[area][START].u.cmp.id; \ 21087 int cmp_id = (row)->glyphs[area][START].u.cmp.id; \
21093 struct composition *cmp = composition_table[cmp_id]; \ 21088 struct composition *cmp = composition_table[cmp_id]; \
21094 XChar2b *char2b; \ 21089 XChar2b *char2b; \
21095 struct glyph_string *first_s; \ 21090 struct glyph_string *first_s IF_LINT (= NULL); \
21096 int n; \ 21091 int n; \
21097 \ 21092 \
21098 char2b = (XChar2b *) alloca ((sizeof *char2b) * cmp->glyph_len); \ 21093 char2b = (XChar2b *) alloca ((sizeof *char2b) * cmp->glyph_len); \
@@ -21296,7 +21291,8 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
21296 { 21291 {
21297 struct glyph_string *h, *t; 21292 struct glyph_string *h, *t;
21298 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 21293 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
21299 int mouse_beg_col, mouse_end_col, check_mouse_face = 0; 21294 int mouse_beg_col IF_LINT (= 0), mouse_end_col IF_LINT (= 0);
21295 int check_mouse_face = 0;
21300 int dummy_x = 0; 21296 int dummy_x = 0;
21301 21297
21302 /* If mouse highlighting is on, we may need to draw adjacent 21298 /* If mouse highlighting is on, we may need to draw adjacent
@@ -22292,7 +22288,13 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym)
22292 if (metrics_upper.width >= metrics_lower.width) 22288 if (metrics_upper.width >= metrics_lower.width)
22293 lower_xoff = (width - metrics_lower.width) / 2; 22289 lower_xoff = (width - metrics_lower.width) / 2;
22294 else 22290 else
22295 upper_xoff = (width - metrics_upper.width) / 2; 22291 {
22292 /* FIXME: This code doesn't look right. It formerly was
22293 missing the "lower_xoff = 0;", which couldn't have
22294 been right since it left lower_xoff uninitialized. */
22295 lower_xoff = 0;
22296 upper_xoff = (width - metrics_upper.width) / 2;
22297 }
22296 } 22298 }
22297 22299
22298 /* +5 is for horizontal bars of a box plus 1-pixel spaces at 22300 /* +5 is for horizontal bars of a box plus 1-pixel spaces at
@@ -25453,7 +25455,8 @@ note_mouse_highlight (struct frame *f, int x, int y)
25453 { 25455 {
25454 /* The mouse-highlighting, if any, comes from an overlay 25456 /* The mouse-highlighting, if any, comes from an overlay
25455 or text property in the buffer. */ 25457 or text property in the buffer. */
25456 Lisp_Object buffer, cover_string; 25458 Lisp_Object buffer IF_LINT (= Qnil);
25459 Lisp_Object cover_string IF_LINT (= Qnil);
25457 25460
25458 if (STRINGP (object)) 25461 if (STRINGP (object))
25459 { 25462 {