aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2001-05-28 16:21:41 +0000
committerGerd Moellmann2001-05-28 16:21:41 +0000
commit3d9d7a9b30275a9569d2a25b0fd0194e2b378c71 (patch)
treeedd338651edf237da0660dbfb825e4ce9e162839 /src
parent3ec838d7474e3d8e34948d3823f4f1c0c7e07b73 (diff)
downloademacs-3d9d7a9b30275a9569d2a25b0fd0194e2b378c71.tar.gz
emacs-3d9d7a9b30275a9569d2a25b0fd0194e2b378c71.zip
(Fsingle_key_description): Create a multibyte string
only if necessary.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/keymap.c20
2 files changed, 19 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2bf591053df..32b377031a2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
12001-05-28 Gerd Moellmann <gerd@gnu.org> 12001-05-28 Gerd Moellmann <gerd@gnu.org>
2 2
3 * xmenu.c (xmenu_show) [!HAVE_MULTILINGUAL_MENU]: Don't overwrite
4 an item's name with its key description in case the description
5 is a multibyte string.
6
7 * keymap.c (Fsingle_key_description): Create a multibyte string
8 only if necessary.
9
3 * macros.c (Fstart_kbd_macro): Doc fix. 10 * macros.c (Fstart_kbd_macro): Doc fix.
4 11
5 * xterm.c (cursor_in_mouse_face_p): New function. 12 * xterm.c (cursor_in_mouse_face_p): New function.
diff --git a/src/keymap.c b/src/keymap.c
index a1f0de1c09a..f96c109c9cd 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1959,14 +1959,18 @@ around function keys and event symbols.")
1959 } 1959 }
1960 else 1960 else
1961 { 1961 {
1962 char tem[KEY_DESCRIPTION_SIZE]; 1962 char tem[KEY_DESCRIPTION_SIZE], *end;
1963 int len; 1963 int nbytes, nchars;
1964 1964 Lisp_Object string;
1965 *push_key_description (XUINT (key), tem, 1) = 0; 1965
1966 len = strlen (tem); 1966 end = push_key_description (XUINT (key), tem, 1);
1967 return make_multibyte_string (tem, 1967 nbytes = end - tem;
1968 multibyte_chars_in_text (tem, len), 1968 nchars = multibyte_chars_in_text (tem, nbytes);
1969 len); 1969 if (nchars == nbytes)
1970 string = build_string (tem);
1971 else
1972 string = make_multibyte_string (tem, nchars, nbytes);
1973 return string;
1970 } 1974 }
1971 } 1975 }
1972 else if (SYMBOLP (key)) /* Function key or event-symbol */ 1976 else if (SYMBOLP (key)) /* Function key or event-symbol */