Mercurial > emacs
comparison src/keymap.c @ 23734:44546fc7faad
(Fsingle_key_description): Handle generic characters.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Thu, 19 Nov 1998 04:30:14 +0000 |
| parents | 330629423307 |
| children | e6bdd4559dc7 |
comparison
equal
deleted
inserted
replaced
| 23733:e963fc8ca03f | 23734:44546fc7faad |
|---|---|
| 1838 } | 1838 } |
| 1839 else | 1839 else |
| 1840 { | 1840 { |
| 1841 unsigned char work[4], *str; | 1841 unsigned char work[4], *str; |
| 1842 int i = CHAR_STRING (c, work, str); | 1842 int i = CHAR_STRING (c, work, str); |
| 1843 | |
| 1844 bcopy (str, p, i); | 1843 bcopy (str, p, i); |
| 1845 p += i; | 1844 p += i; |
| 1846 } | 1845 } |
| 1847 | 1846 |
| 1848 return p; | 1847 return p; |
| 1854 "Return a pretty description of command character KEY.\n\ | 1853 "Return a pretty description of command character KEY.\n\ |
| 1855 Control characters turn into C-whatever, etc.") | 1854 Control characters turn into C-whatever, etc.") |
| 1856 (key) | 1855 (key) |
| 1857 Lisp_Object key; | 1856 Lisp_Object key; |
| 1858 { | 1857 { |
| 1859 char tem[20]; | |
| 1860 | |
| 1861 key = EVENT_HEAD (key); | 1858 key = EVENT_HEAD (key); |
| 1862 | 1859 |
| 1863 if (INTEGERP (key)) /* Normal character */ | 1860 if (INTEGERP (key)) /* Normal character */ |
| 1864 { | 1861 { |
| 1865 *push_key_description (XUINT (key), tem) = 0; | 1862 unsigned int charset, c1, c2; |
| 1866 return build_string (tem); | 1863 |
| 1864 if (SINGLE_BYTE_CHAR_P (XINT (key))) | |
| 1865 charset = 0; | |
| 1866 else | |
| 1867 SPLIT_NON_ASCII_CHAR (XINT (key), charset, c1, c2); | |
| 1868 | |
| 1869 if (charset | |
| 1870 && ((c1 >= 0 && c1 < 32) | |
| 1871 || (c2 >= 0 && c2 < 32))) | |
| 1872 { | |
| 1873 /* Handle a generic character. */ | |
| 1874 Lisp_Object name; | |
| 1875 name = CHARSET_TABLE_INFO (charset, CHARSET_LONG_NAME_IDX); | |
| 1876 CHECK_STRING (name, 0); | |
| 1877 return concat2 (build_string ("Character set "), name); | |
| 1878 } | |
| 1879 else | |
| 1880 { | |
| 1881 char tem[20]; | |
| 1882 | |
| 1883 *push_key_description (XUINT (key), tem) = 0; | |
| 1884 return build_string (tem); | |
| 1885 } | |
| 1867 } | 1886 } |
| 1868 else if (SYMBOLP (key)) /* Function key or event-symbol */ | 1887 else if (SYMBOLP (key)) /* Function key or event-symbol */ |
| 1869 return Fsymbol_name (key); | 1888 return Fsymbol_name (key); |
| 1870 else if (STRINGP (key)) /* Buffer names in the menubar. */ | 1889 else if (STRINGP (key)) /* Buffer names in the menubar. */ |
| 1871 return Fcopy_sequence (key); | 1890 return Fcopy_sequence (key); |
