Mercurial > emacs
comparison src/keymap.c @ 37930:ee47b5c14208
(Fsingle_key_description): Create a multibyte string
only if necessary.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 28 May 2001 16:21:10 +0000 |
parents | e5c590c9fe66 |
children | fdd419d4776a |
comparison
equal
deleted
inserted
replaced
37929:ca726d19c1be | 37930:ee47b5c14208 |
---|---|
1957 CHECK_STRING (name, 0); | 1957 CHECK_STRING (name, 0); |
1958 return concat2 (build_string ("Character set "), name); | 1958 return concat2 (build_string ("Character set "), name); |
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 */ |
1973 { | 1977 { |
1974 if (NILP (no_angles)) | 1978 if (NILP (no_angles)) |