aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
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/keymap.c
parent3ec838d7474e3d8e34948d3823f4f1c0c7e07b73 (diff)
downloademacs-3d9d7a9b30275a9569d2a25b0fd0194e2b378c71.tar.gz
emacs-3d9d7a9b30275a9569d2a25b0fd0194e2b378c71.zip
(Fsingle_key_description): Create a multibyte string
only if necessary.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c20
1 files changed, 12 insertions, 8 deletions
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 */