diff options
| author | Gerd Moellmann | 2001-09-19 14:48:52 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-09-19 14:48:52 +0000 |
| commit | 72f62cb50cd1b98fe786985674e31546aa56323d (patch) | |
| tree | 3394034b42dfa28889eaffb32e61cca00c3d177a /src | |
| parent | a269702287bf8e97aa9c4200ab0ee1d96d1d6746 (diff) | |
| download | emacs-72f62cb50cd1b98fe786985674e31546aa56323d.tar.gz emacs-72f62cb50cd1b98fe786985674e31546aa56323d.zip | |
(decode_mode_spec): Add parameter MULTIBYTE.
(display_mode_element): Display the string from decode_mode_spec
depending on its multibyteness.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 39 |
2 files changed, 28 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c55917d77be..ef2f0947d21 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2001-09-19 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-09-19 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * xdisp.c (decode_mode_spec): Add parameter MULTIBYTE. | ||
| 4 | (display_mode_element): Display the string from decode_mode_spec | ||
| 5 | depending on its multibyteness. | ||
| 6 | |||
| 3 | * s/netbsd.h (LD_SWITCH_SYSTEM, C_SWITCH_SYSTEM): Add /usr/pkg. | 7 | * s/netbsd.h (LD_SWITCH_SYSTEM, C_SWITCH_SYSTEM): Add /usr/pkg. |
| 4 | 8 | ||
| 5 | * m/macppc.h (DATA_SEG_BITS): Also define for GCC 3. | 9 | * m/macppc.h (DATA_SEG_BITS): Also define for GCC 3. |
diff --git a/src/xdisp.c b/src/xdisp.c index df8720ee0e8..7ffa35b67a7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -732,7 +732,7 @@ static int display_line P_ ((struct it *)); | |||
| 732 | static int display_mode_lines P_ ((struct window *)); | 732 | static int display_mode_lines P_ ((struct window *)); |
| 733 | static int display_mode_line P_ ((struct window *, enum face_id, Lisp_Object)); | 733 | static int display_mode_line P_ ((struct window *, enum face_id, Lisp_Object)); |
| 734 | static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object)); | 734 | static int display_mode_element P_ ((struct it *, int, int, int, Lisp_Object)); |
| 735 | static char *decode_mode_spec P_ ((struct window *, int, int, int)); | 735 | static char *decode_mode_spec P_ ((struct window *, int, int, int, int *)); |
| 736 | static void display_menu_bar P_ ((struct window *)); | 736 | static void display_menu_bar P_ ((struct window *)); |
| 737 | static int display_count_lines P_ ((int, int, int, int, int *)); | 737 | static int display_count_lines P_ ((int, int, int, int, int *)); |
| 738 | static int display_string P_ ((unsigned char *, Lisp_Object, Lisp_Object, | 738 | static int display_string P_ ((unsigned char *, Lisp_Object, Lisp_Object, |
| @@ -13449,22 +13449,25 @@ display_mode_element (it, depth, field_width, precision, elt) | |||
| 13449 | Vglobal_mode_string); | 13449 | Vglobal_mode_string); |
| 13450 | else if (c != 0) | 13450 | else if (c != 0) |
| 13451 | { | 13451 | { |
| 13452 | int multibyte; | ||
| 13452 | unsigned char *spec | 13453 | unsigned char *spec |
| 13453 | = decode_mode_spec (it->w, c, field, prec); | 13454 | = decode_mode_spec (it->w, c, field, prec, &multibyte); |
| 13454 | 13455 | ||
| 13455 | if (frame_title_ptr) | 13456 | if (frame_title_ptr) |
| 13456 | n += store_frame_title (spec, field, prec); | 13457 | n += store_frame_title (spec, field, prec); |
| 13457 | else | 13458 | else |
| 13458 | { | 13459 | { |
| 13459 | int nglyphs_before | 13460 | int nglyphs_before, bytepos, charpos, nwritten; |
| 13460 | = it->glyph_row->used[TEXT_AREA]; | 13461 | |
| 13461 | int bytepos | 13462 | nglyphs_before = it->glyph_row->used[TEXT_AREA]; |
| 13462 | = percent_position - XSTRING (elt)->data; | 13463 | bytepos = percent_position - XSTRING (elt)->data; |
| 13463 | int charpos | 13464 | charpos = (multibyte |
| 13464 | = string_byte_to_char (elt, bytepos); | 13465 | ? string_byte_to_char (elt, bytepos) |
| 13465 | int nwritten | 13466 | : bytepos); |
| 13466 | = display_string (spec, Qnil, elt, charpos, 0, it, | 13467 | nwritten = display_string (spec, Qnil, elt, |
| 13467 | field, prec, 0, -1); | 13468 | charpos, 0, it, |
| 13469 | field, prec, 0, | ||
| 13470 | multibyte); | ||
| 13468 | 13471 | ||
| 13469 | /* Assign to the glyphs written above the | 13472 | /* Assign to the glyphs written above the |
| 13470 | string where the `%x' came from, position | 13473 | string where the `%x' came from, position |
| @@ -13760,15 +13763,17 @@ decode_mode_spec_coding (coding_system, buf, eol_flag) | |||
| 13760 | /* Return a string for the output of a mode line %-spec for window W, | 13763 | /* Return a string for the output of a mode line %-spec for window W, |
| 13761 | generated by character C. PRECISION >= 0 means don't return a | 13764 | generated by character C. PRECISION >= 0 means don't return a |
| 13762 | string longer than that value. FIELD_WIDTH > 0 means pad the | 13765 | string longer than that value. FIELD_WIDTH > 0 means pad the |
| 13763 | string returned with spaces to that value. */ | 13766 | string returned with spaces to that value. Return 1 in *MULTIBYTE |
| 13767 | if the result is multibyte text. */ | ||
| 13764 | 13768 | ||
| 13765 | static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------"; | 13769 | static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------"; |
| 13766 | 13770 | ||
| 13767 | static char * | 13771 | static char * |
| 13768 | decode_mode_spec (w, c, field_width, precision) | 13772 | decode_mode_spec (w, c, field_width, precision, multibyte) |
| 13769 | struct window *w; | 13773 | struct window *w; |
| 13770 | register int c; | 13774 | register int c; |
| 13771 | int field_width, precision; | 13775 | int field_width, precision; |
| 13776 | int *multibyte; | ||
| 13772 | { | 13777 | { |
| 13773 | Lisp_Object obj; | 13778 | Lisp_Object obj; |
| 13774 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 13779 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| @@ -13776,6 +13781,7 @@ decode_mode_spec (w, c, field_width, precision) | |||
| 13776 | struct buffer *b = XBUFFER (w->buffer); | 13781 | struct buffer *b = XBUFFER (w->buffer); |
| 13777 | 13782 | ||
| 13778 | obj = Qnil; | 13783 | obj = Qnil; |
| 13784 | *multibyte = 0; | ||
| 13779 | 13785 | ||
| 13780 | switch (c) | 13786 | switch (c) |
| 13781 | { | 13787 | { |
| @@ -14109,7 +14115,10 @@ decode_mode_spec (w, c, field_width, precision) | |||
| 14109 | } | 14115 | } |
| 14110 | 14116 | ||
| 14111 | if (STRINGP (obj)) | 14117 | if (STRINGP (obj)) |
| 14112 | return (char *) XSTRING (obj)->data; | 14118 | { |
| 14119 | *multibyte = STRING_MULTIBYTE (obj); | ||
| 14120 | return (char *) XSTRING (obj)->data; | ||
| 14121 | } | ||
| 14113 | else | 14122 | else |
| 14114 | return ""; | 14123 | return ""; |
| 14115 | } | 14124 | } |