aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2010-01-13 10:29:58 +0900
committerKenichi Handa2010-01-13 10:29:58 +0900
commitdc954cb273234237b615b93b6368d4adbdea31c4 (patch)
tree2b644e57c6c8534510074c420cf90620525db99f /src
parentd8b8451f8ea52d751035449278ec36c3e598f9cf (diff)
downloademacs-dc954cb273234237b615b93b6368d4adbdea31c4.tar.gz
emacs-dc954cb273234237b615b93b6368d4adbdea31c4.zip
Display buffer name, etc. in mode line by composing correctly.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog18
-rw-r--r--src/composite.c2
-rw-r--r--src/xdisp.c36
-rw-r--r--src/xterm.c10
4 files changed, 52 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4342d39052d..55e69ff9340 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
12010-01-13 Kenichi Handa <handa@m17n.org>
2
3 Display buffer name, etc. in mode line by composing correctly.
4
5 * xdisp.c (reseat_to_string): Call composition_compute_stop_pos if
6 STRING is not nil.
7 (display_mode_element): Adjusted for the change of
8 decode_mode_spec and display_line.
9 (decode_mode_spec): Change arg MULTIBYTE to STRING.
10 (display_string): Handle the case that STRING is non-null and
11 LISP_STRING is not nil.
12
13 * xterm.c (x_draw_composite_glyph_string_foreground): Pay
14 attention to s->face->overstrike.
15
16 * composite.c (composition_reseat_it): Don't check PT if STRING is
17 non nil.
18
12010-01-11 Chong Yidong <cyd@stupidchicken.com> 192010-01-11 Chong Yidong <cyd@stupidchicken.com>
2 20
3 * nsterm.m (syms_of_nsterm): Initialize Qcontrol etc. before 21 * nsterm.m (syms_of_nsterm): Initialize Qcontrol etc. before
diff --git a/src/composite.c b/src/composite.c
index a24abd0fe8f..edebf1e3136 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1104,7 +1104,7 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string)
1104 struct face *face; 1104 struct face *face;
1105 Lisp_Object string; 1105 Lisp_Object string;
1106{ 1106{
1107 if (charpos < PT && PT < endpos) 1107 if (NILP (string) && charpos < PT && PT < endpos)
1108 endpos = PT; 1108 endpos = PT;
1109 1109
1110 if (cmp_it->ch == -2) 1110 if (cmp_it->ch == -2)
diff --git a/src/xdisp.c b/src/xdisp.c
index fd0f6e51695..f7155599a12 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -953,7 +953,8 @@ static int display_mode_lines P_ ((struct window *));
953static int display_mode_line P_ ((struct window *, enum face_id, Lisp_Object)); 953static int display_mode_line P_ ((struct window *, enum face_id, Lisp_Object));
954static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object, Lisp_Object, int)); 954static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object, Lisp_Object, int));
955static int store_mode_line_string P_ ((char *, Lisp_Object, int, int, int, Lisp_Object)); 955static int store_mode_line_string P_ ((char *, Lisp_Object, int, int, int, Lisp_Object));
956static char *decode_mode_spec P_ ((struct window *, int, int, int, int *)); 956static char *decode_mode_spec P_ ((struct window *, int, int, int,
957 Lisp_Object *));
957static void display_menu_bar P_ ((struct window *)); 958static void display_menu_bar P_ ((struct window *));
958static int display_count_lines P_ ((int, int, int, int, int *)); 959static int display_count_lines P_ ((int, int, int, int, int *));
959static int display_string P_ ((unsigned char *, Lisp_Object, Lisp_Object, 960static int display_string P_ ((unsigned char *, Lisp_Object, Lisp_Object,
@@ -5607,6 +5608,9 @@ reseat_to_string (it, s, string, charpos, precision, field_width, multibyte)
5607 it->dp = XCHAR_TABLE (Vstandard_display_table); 5608 it->dp = XCHAR_TABLE (Vstandard_display_table);
5608 5609
5609 it->stop_charpos = charpos; 5610 it->stop_charpos = charpos;
5611 if (s == NULL && it->multibyte_p)
5612 composition_compute_stop_pos (&it->cmp_it, charpos, -1, it->end_charpos,
5613 it->string);
5610 CHECK_IT (it); 5614 CHECK_IT (it);
5611} 5615}
5612 5616
@@ -17576,13 +17580,14 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
17576 int multibyte; 17580 int multibyte;
17577 int bytepos, charpos; 17581 int bytepos, charpos;
17578 unsigned char *spec; 17582 unsigned char *spec;
17583 Lisp_Object string;
17579 17584
17580 bytepos = percent_position; 17585 bytepos = percent_position;
17581 charpos = (STRING_MULTIBYTE (elt) 17586 charpos = (STRING_MULTIBYTE (elt)
17582 ? string_byte_to_char (elt, bytepos) 17587 ? string_byte_to_char (elt, bytepos)
17583 : bytepos); 17588 : bytepos);
17584 spec 17589 spec = decode_mode_spec (it->w, c, field, prec, &string);
17585 = decode_mode_spec (it->w, c, field, prec, &multibyte); 17590 multibyte = STRINGP (string) && STRING_MULTIBYTE (string);
17586 17591
17587 switch (mode_line_target) 17592 switch (mode_line_target)
17588 { 17593 {
@@ -17604,7 +17609,7 @@ display_mode_element (it, depth, field_width, precision, elt, props, risky)
17604 int nglyphs_before, nwritten; 17609 int nglyphs_before, nwritten;
17605 17610
17606 nglyphs_before = it->glyph_row->used[TEXT_AREA]; 17611 nglyphs_before = it->glyph_row->used[TEXT_AREA];
17607 nwritten = display_string (spec, Qnil, elt, 17612 nwritten = display_string (spec, string, elt,
17608 charpos, 0, it, 17613 charpos, 0, it,
17609 field, prec, 0, 17614 field, prec, 0,
17610 multibyte); 17615 multibyte);
@@ -18267,8 +18272,8 @@ decode_mode_spec_coding (coding_system, buf, eol_flag)
18267/* Return a string for the output of a mode line %-spec for window W, 18272/* Return a string for the output of a mode line %-spec for window W,
18268 generated by character C. PRECISION >= 0 means don't return a 18273 generated by character C. PRECISION >= 0 means don't return a
18269 string longer than that value. FIELD_WIDTH > 0 means pad the 18274 string longer than that value. FIELD_WIDTH > 0 means pad the
18270 string returned with spaces to that value. Return 1 in *MULTIBYTE 18275 string returned with spaces to that value. Return a Lisp string in
18271 if the result is multibyte text. 18276 *STRING if the resulting string is taken from that Lisp string.
18272 18277
18273 Note we operate on the current buffer for most purposes, 18278 Note we operate on the current buffer for most purposes,
18274 the exception being w->base_line_pos. */ 18279 the exception being w->base_line_pos. */
@@ -18276,11 +18281,11 @@ decode_mode_spec_coding (coding_system, buf, eol_flag)
18276static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------"; 18281static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------";
18277 18282
18278static char * 18283static char *
18279decode_mode_spec (w, c, field_width, precision, multibyte) 18284decode_mode_spec (w, c, field_width, precision, string)
18280 struct window *w; 18285 struct window *w;
18281 register int c; 18286 register int c;
18282 int field_width, precision; 18287 int field_width, precision;
18283 int *multibyte; 18288 Lisp_Object *string;
18284{ 18289{
18285 Lisp_Object obj; 18290 Lisp_Object obj;
18286 struct frame *f = XFRAME (WINDOW_FRAME (w)); 18291 struct frame *f = XFRAME (WINDOW_FRAME (w));
@@ -18288,7 +18293,7 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
18288 struct buffer *b = current_buffer; 18293 struct buffer *b = current_buffer;
18289 18294
18290 obj = Qnil; 18295 obj = Qnil;
18291 *multibyte = 0; 18296 *string = Qnil;
18292 18297
18293 switch (c) 18298 switch (c)
18294 { 18299 {
@@ -18682,7 +18687,7 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
18682 18687
18683 if (STRINGP (obj)) 18688 if (STRINGP (obj))
18684 { 18689 {
18685 *multibyte = STRING_MULTIBYTE (obj); 18690 *string = obj;
18686 return (char *) SDATA (obj); 18691 return (char *) SDATA (obj);
18687 } 18692 }
18688 else 18693 else
@@ -18803,7 +18808,10 @@ display_count_lines (start, start_byte, limit_byte, count, byte_pos_ptr)
18803/* Display a NUL-terminated string, starting with index START. 18808/* Display a NUL-terminated string, starting with index START.
18804 18809
18805 If STRING is non-null, display that C string. Otherwise, the Lisp 18810 If STRING is non-null, display that C string. Otherwise, the Lisp
18806 string LISP_STRING is displayed. 18811 string LISP_STRING is displayed. There's a case that STRING is
18812 non-null and LISP_STRING is not nil. It means STRING is a string
18813 data of LISP_STRING. In that case, we display LISP_STRING while
18814 ignoring its text properties.
18807 18815
18808 If FACE_STRING is not nil, FACE_STRING_POS is a position in 18816 If FACE_STRING is not nil, FACE_STRING_POS is a position in
18809 FACE_STRING. Display STRING or LISP_STRING with the face at 18817 FACE_STRING. Display STRING or LISP_STRING with the face at
@@ -18853,8 +18861,12 @@ display_string (string, lisp_string, face_string, face_string_pos,
18853 18861
18854 /* Initialize the iterator IT for iteration over STRING beginning 18862 /* Initialize the iterator IT for iteration over STRING beginning
18855 with index START. */ 18863 with index START. */
18856 reseat_to_string (it, string, lisp_string, start, 18864 reseat_to_string (it, NILP (lisp_string) ? string : NULL, lisp_string, start,
18857 precision, field_width, multibyte); 18865 precision, field_width, multibyte);
18866 if (string && STRINGP (lisp_string))
18867 /* LISP_STRING is the one returned by decode_mode_spec. We should
18868 ignore its text properties. */
18869 it->stop_charpos = -1;
18858 18870
18859 /* If displaying STRING, set up the face of the iterator 18871 /* If displaying STRING, set up the face of the iterator
18860 from LISP_STRING, if that's given. */ 18872 from LISP_STRING, if that's given. */
diff --git a/src/xterm.c b/src/xterm.c
index 2093b68c110..5af8a64e2ea 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1378,19 +1378,27 @@ x_draw_composite_glyph_string_foreground (s)
1378 if (j < i) 1378 if (j < i)
1379 { 1379 {
1380 font->driver->draw (s, j, i, x, y, 0); 1380 font->driver->draw (s, j, i, x, y, 0);
1381 if (s->face->overstrike)
1382 font->driver->draw (s, j, i, x + 1, y, 0);
1381 x += width; 1383 x += width;
1382 } 1384 }
1383 xoff = LGLYPH_XOFF (glyph); 1385 xoff = LGLYPH_XOFF (glyph);
1384 yoff = LGLYPH_YOFF (glyph); 1386 yoff = LGLYPH_YOFF (glyph);
1385 wadjust = LGLYPH_WADJUST (glyph); 1387 wadjust = LGLYPH_WADJUST (glyph);
1386 font->driver->draw (s, i, i + 1, x + xoff, y + yoff, 0); 1388 font->driver->draw (s, i, i + 1, x + xoff, y + yoff, 0);
1389 if (s->face->overstrike)
1390 font->driver->draw (s, i, i + 1, x + xoff + 1, y + yoff, 0);
1387 x += wadjust; 1391 x += wadjust;
1388 j = i + 1; 1392 j = i + 1;
1389 width = 0; 1393 width = 0;
1390 } 1394 }
1391 } 1395 }
1392 if (j < i) 1396 if (j < i)
1393 font->driver->draw (s, j, i, x, y, 0); 1397 {
1398 font->driver->draw (s, j, i, x, y, 0);
1399 if (s->face->overstrike)
1400 font->driver->draw (s, j, i, x + 1, y, 0);
1401 }
1394 } 1402 }
1395} 1403}
1396 1404