diff options
| author | Stefan Monnier | 2005-03-12 23:29:04 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-03-12 23:29:04 +0000 |
| commit | 8af9fa555a7be05f2a37b8fbcc044be199b1fbcf (patch) | |
| tree | 4f603b4c77e2c86eab5b99cab820f8a18e6f7c89 /src/xmenu.c | |
| parent | bb07fa293e5360ce4c6fb6856d75b383bf72211d (diff) | |
| download | emacs-8af9fa555a7be05f2a37b8fbcc044be199b1fbcf.tar.gz emacs-8af9fa555a7be05f2a37b8fbcc044be199b1fbcf.zip | |
(ENCODE_MENU_STRING): Explicitly use string_make_unibyte.
(list_of_panes, list_of_items, Fx_popup_menu): Use XCAR/XCDR.
(digest_single_submenu, xmenu_show): Use ENCODE_MENU_STRING.
Diffstat (limited to 'src/xmenu.c')
| -rw-r--r-- | src/xmenu.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index b587fcf9e10..0de318323a3 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* X Communication module for terminals which understand the X protocol. | 1 | /* X Communication module for terminals which understand the X protocol. |
| 2 | Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004 | 2 | Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2003, 2004, |
| 3 | Free Software Foundation, Inc. | 3 | 2005 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -138,12 +138,7 @@ static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **)); | |||
| 138 | /* gtk just uses utf-8. */ | 138 | /* gtk just uses utf-8. */ |
| 139 | # define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str) | 139 | # define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str) |
| 140 | #else | 140 | #else |
| 141 | /* I'm not convinced ENCODE_SYSTEM is defined correctly, or maybe | 141 | # define ENCODE_MENU_STRING(str) string_make_unibyte (str) |
| 142 | something else should be used here. Except under MS-Windows it | ||
| 143 | just converts to unibyte, but encoding with `locale-coding-system' | ||
| 144 | seems better -- X may actually display the result correctly, and | ||
| 145 | it's not necessarily equivalent to the unibyte text. -- fx */ | ||
| 146 | # define ENCODE_MENU_STRING(str) ENCODE_SYSTEM (str) | ||
| 147 | #endif | 142 | #endif |
| 148 | 143 | ||
| 149 | static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, | 144 | static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, |
| @@ -645,10 +640,10 @@ list_of_panes (menu) | |||
| 645 | 640 | ||
| 646 | init_menu_items (); | 641 | init_menu_items (); |
| 647 | 642 | ||
| 648 | for (tail = menu; !NILP (tail); tail = Fcdr (tail)) | 643 | for (tail = menu; CONSP (tail); tail = XCDR (tail)) |
| 649 | { | 644 | { |
| 650 | Lisp_Object elt, pane_name, pane_data; | 645 | Lisp_Object elt, pane_name, pane_data; |
| 651 | elt = Fcar (tail); | 646 | elt = XCAR (tail); |
| 652 | pane_name = Fcar (elt); | 647 | pane_name = Fcar (elt); |
| 653 | CHECK_STRING (pane_name); | 648 | CHECK_STRING (pane_name); |
| 654 | push_menu_pane (ENCODE_MENU_STRING (pane_name), Qnil); | 649 | push_menu_pane (ENCODE_MENU_STRING (pane_name), Qnil); |
| @@ -668,22 +663,22 @@ list_of_items (pane) | |||
| 668 | { | 663 | { |
| 669 | Lisp_Object tail, item, item1; | 664 | Lisp_Object tail, item, item1; |
| 670 | 665 | ||
| 671 | for (tail = pane; !NILP (tail); tail = Fcdr (tail)) | 666 | for (tail = pane; CONSP (tail); tail = XCDR (tail)) |
| 672 | { | 667 | { |
| 673 | item = Fcar (tail); | 668 | item = XCAR (tail); |
| 674 | if (STRINGP (item)) | 669 | if (STRINGP (item)) |
| 675 | push_menu_item (ENCODE_MENU_STRING (item), Qnil, Qnil, Qt, | 670 | push_menu_item (ENCODE_MENU_STRING (item), Qnil, Qnil, Qt, |
| 676 | Qnil, Qnil, Qnil, Qnil); | 671 | Qnil, Qnil, Qnil, Qnil); |
| 677 | else if (NILP (item)) | 672 | else if (CONSP (item)) |
| 678 | push_left_right_boundary (); | ||
| 679 | else | ||
| 680 | { | 673 | { |
| 681 | CHECK_CONS (item); | 674 | item1 = XCAR (item); |
| 682 | item1 = Fcar (item); | ||
| 683 | CHECK_STRING (item1); | 675 | CHECK_STRING (item1); |
| 684 | push_menu_item (ENCODE_MENU_STRING (item1), Qt, Fcdr (item), | 676 | push_menu_item (ENCODE_MENU_STRING (item1), Qt, XCDR (item), |
| 685 | Qt, Qnil, Qnil, Qnil, Qnil); | 677 | Qt, Qnil, Qnil, Qnil, Qnil); |
| 686 | } | 678 | } |
| 679 | else | ||
| 680 | push_left_right_boundary (); | ||
| 681 | |||
| 687 | } | 682 | } |
| 688 | } | 683 | } |
| 689 | 684 | ||
| @@ -802,8 +797,8 @@ cached information about equivalent key sequences. */) | |||
| 802 | if (CONSP (tem)) | 797 | if (CONSP (tem)) |
| 803 | { | 798 | { |
| 804 | window = Fcar (Fcdr (position)); | 799 | window = Fcar (Fcdr (position)); |
| 805 | x = Fcar (tem); | 800 | x = XCAR (tem); |
| 806 | y = Fcar (Fcdr (tem)); | 801 | y = Fcar (XCDR (tem)); |
| 807 | } | 802 | } |
| 808 | else | 803 | else |
| 809 | { | 804 | { |
| @@ -931,11 +926,11 @@ cached information about equivalent key sequences. */) | |||
| 931 | 926 | ||
| 932 | /* The first keymap that has a prompt string | 927 | /* The first keymap that has a prompt string |
| 933 | supplies the menu title. */ | 928 | supplies the menu title. */ |
| 934 | for (tem = menu, i = 0; CONSP (tem); tem = Fcdr (tem)) | 929 | for (tem = menu, i = 0; CONSP (tem); tem = XCDR (tem)) |
| 935 | { | 930 | { |
| 936 | Lisp_Object prompt; | 931 | Lisp_Object prompt; |
| 937 | 932 | ||
| 938 | maps[i++] = keymap = get_keymap (Fcar (tem), 1, 0); | 933 | maps[i++] = keymap = get_keymap (XCAR (tem), 1, 0); |
| 939 | 934 | ||
| 940 | prompt = Fkeymap_prompt (keymap); | 935 | prompt = Fkeymap_prompt (keymap); |
| 941 | if (NILP (title) && !NILP (prompt)) | 936 | if (NILP (title) && !NILP (prompt)) |
| @@ -1750,7 +1745,7 @@ digest_single_submenu (start, end, top_level_items) | |||
| 1750 | #ifndef HAVE_MULTILINGUAL_MENU | 1745 | #ifndef HAVE_MULTILINGUAL_MENU |
| 1751 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) | 1746 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) |
| 1752 | { | 1747 | { |
| 1753 | pane_name = ENCODE_SYSTEM (pane_name); | 1748 | pane_name = ENCODE_MENU_STRING (pane_name); |
| 1754 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; | 1749 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; |
| 1755 | } | 1750 | } |
| 1756 | #endif | 1751 | #endif |
| @@ -2695,7 +2690,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2695 | #ifndef HAVE_MULTILINGUAL_MENU | 2690 | #ifndef HAVE_MULTILINGUAL_MENU |
| 2696 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) | 2691 | if (STRINGP (pane_name) && STRING_MULTIBYTE (pane_name)) |
| 2697 | { | 2692 | { |
| 2698 | pane_name = ENCODE_SYSTEM (pane_name); | 2693 | pane_name = ENCODE_MENU_STRING (pane_name); |
| 2699 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; | 2694 | AREF (menu_items, i + MENU_ITEMS_PANE_NAME) = pane_name; |
| 2700 | } | 2695 | } |
| 2701 | #endif | 2696 | #endif |