aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2008-09-06 11:15:04 +0000
committerEli Zaretskii2008-09-06 11:15:04 +0000
commite779d63012784daf821e011d51fc274dbbd310ad (patch)
tree743cf89d82eb4fb857812dac1306f706ca584183
parentd632fb82ffc5a48ea42cfe182de83feed4b844ab (diff)
downloademacs-e779d63012784daf821e011d51fc274dbbd310ad.tar.gz
emacs-e779d63012784daf821e011d51fc274dbbd310ad.zip
(IT_menu_display): Use STRING_CHAR_ADVANCE instead of a "char *q" to access
menu text and advance through it. Revert the change that displayed ">" instead of ASCII character 0x10.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/msdos.c17
2 files changed, 15 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 307015eb7f9..018bcd399c1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12008-09-06 Eli Zaretskii <eliz@gnu.org>
2
3 * msdos.c (IT_menu_display): Use STRING_CHAR_ADVANCE instead of a
4 "char *q" to access menu text and advance through it. Revert the
5 change that displayed ">" instead of ASCII character 0x10.
6
12008-09-05 Eli Zaretskii <eliz@gnu.org> 72008-09-05 Eli Zaretskii <eliz@gnu.org>
2 8
3 * menu.c (single_menu_item) [!HAVE_BOXES]: Enable emulation of 9 * menu.c (single_menu_item) [!HAVE_BOXES]: Enable emulation of
diff --git a/src/msdos.c b/src/msdos.c
index 4063753c70a..c8a8b5f1b88 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -3556,7 +3556,7 @@ IT_menu_display (XMenu *menu, int y, int x, int pn, int *faces, int disp_help)
3556{ 3556{
3557 int i, j, face, width, mx, my, enabled, mousehere, row, col; 3557 int i, j, face, width, mx, my, enabled, mousehere, row, col;
3558 struct glyph *text, *p; 3558 struct glyph *text, *p;
3559 char *q; 3559 const unsigned char *q;
3560 struct frame *sf = SELECTED_FRAME(); 3560 struct frame *sf = SELECTED_FRAME();
3561 3561
3562 menu_help_message = NULL; 3562 menu_help_message = NULL;
@@ -3590,18 +3590,19 @@ IT_menu_display (XMenu *menu, int y, int x, int pn, int *faces, int disp_help)
3590 p++; 3590 p++;
3591 for (j = 0, q = menu->text[i]; *q; j++) 3591 for (j = 0, q = menu->text[i]; *q; j++)
3592 { 3592 {
3593 if (*q > 26) 3593 unsigned c = STRING_CHAR_ADVANCE (q);
3594
3595 if (c > 26)
3594 { 3596 {
3595 BUILD_CHAR_GLYPH (*p, *q++, face, 0); 3597 BUILD_CHAR_GLYPH (*p, c, face, 0);
3596 p++; 3598 p++;
3597 } 3599 }
3598 else /* make '^x' */ 3600 else /* make '^x' */
3599 { 3601 {
3600 /* FIXME: need to handle non-ASCII characters! */
3601 BUILD_CHAR_GLYPH (*p, '^', face, 0); 3602 BUILD_CHAR_GLYPH (*p, '^', face, 0);
3602 p++; 3603 p++;
3603 j++; 3604 j++;
3604 BUILD_CHAR_GLYPH (*p, *q++ + 64, face, 0); 3605 BUILD_CHAR_GLYPH (*p, c + 64, face, 0);
3605 p++; 3606 p++;
3606 } 3607 }
3607 } 3608 }
@@ -3614,9 +3615,9 @@ IT_menu_display (XMenu *menu, int y, int x, int pn, int *faces, int disp_help)
3614 for (; j < max_width - 2; j++, p++) 3615 for (; j < max_width - 2; j++, p++)
3615 BUILD_CHAR_GLYPH (*p, ' ', face, 0); 3616 BUILD_CHAR_GLYPH (*p, ' ', face, 0);
3616 3617
3617 /* FIXME: should use Unicode codepoint for what Emacs 22.x 3618 /* 16 is the character code of a character that on DOS terminal
3618 displayed here. */ 3619 produces a nice-looking right-pointing arrow glyph. */
3619 BUILD_CHAR_GLYPH (*p, menu->submenu[i] ? '>' : ' ', face, 0); 3620 BUILD_CHAR_GLYPH (*p, menu->submenu[i] ? 16 : ' ', face, 0);
3620 p++; 3621 p++;
3621 IT_write_glyphs (sf, text, max_width); 3622 IT_write_glyphs (sf, text, max_width);
3622 } 3623 }