aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2002-04-03 04:50:28 +0000
committerStefan Monnier2002-04-03 04:50:28 +0000
commit4c8bc8947949080161f255334eb8c7a2877cc175 (patch)
treedacc66c46955a56262368c49c60e8893606d8a20 /src
parent87a6a5d8d4ca5c5dcd8c9c11fc279dfd61c62f0f (diff)
downloademacs-4c8bc8947949080161f255334eb8c7a2877cc175.tar.gz
emacs-4c8bc8947949080161f255334eb8c7a2877cc175.zip
(make_lispy_event): Handle unknown keysyms together
with system-specific keysyms. Use it also for unknown function keys.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/keyboard.c49
2 files changed, 18 insertions, 34 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d8ae770d63e..4d4eee2dbcc 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12002-04-02 Stefan Monnier <monnier@cs.yale.edu> 12002-04-02 Stefan Monnier <monnier@cs.yale.edu>
2 2
3 * keyboard.c (make_lispy_event): Handle unknown keysyms together
4 with system-specific keysyms. Use it also for unknown function keys.
5
3 * doc.c (reread_doc_file): Return whether reload was attempted. 6 * doc.c (reread_doc_file): Return whether reload was attempted.
4 (Fdocumentation, Fdocumentation_property): Don't try to reload 7 (Fdocumentation, Fdocumentation_property): Don't try to reload
5 if the doc is 0 and only ask once. 8 if the doc is 0 and only ask once.
diff --git a/src/keyboard.c b/src/keyboard.c
index 3e263395fe8..3a20949f112 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4762,21 +4762,6 @@ make_lispy_event (event)
4762 (sizeof (lispy_accent_keys) 4762 (sizeof (lispy_accent_keys)
4763 / sizeof (lispy_accent_keys[0]))); 4763 / sizeof (lispy_accent_keys[0])));
4764 4764
4765 /* Handle system-specific keysyms. */
4766 if (event->code & (1 << 28))
4767 {
4768 /* We need to use an alist rather than a vector as the cache
4769 since we can't make a vector long enuf. */
4770 if (NILP (current_kboard->system_key_syms))
4771 current_kboard->system_key_syms = Fcons (Qnil, Qnil);
4772 return modify_event_symbol (event->code,
4773 event->modifiers,
4774 Qfunction_key,
4775 current_kboard->Vsystem_key_alist,
4776 0, &current_kboard->system_key_syms,
4777 (unsigned) -1);
4778 }
4779
4780#ifdef XK_kana_A 4765#ifdef XK_kana_A
4781 if (event->code >= 0x400 && event->code < 0x500) 4766 if (event->code >= 0x400 && event->code < 0x500)
4782 return modify_event_symbol (event->code - 0x400, 4767 return modify_event_symbol (event->code - 0x400,
@@ -4796,30 +4781,26 @@ make_lispy_event (event)
4796 iso_lispy_function_keys, &func_key_syms, 4781 iso_lispy_function_keys, &func_key_syms,
4797 (sizeof (iso_lispy_function_keys) 4782 (sizeof (iso_lispy_function_keys)
4798 / sizeof (iso_lispy_function_keys[0]))); 4783 / sizeof (iso_lispy_function_keys[0])));
4799 else
4800#endif 4784#endif
4801 4785
4802#ifdef HAVE_X_WINDOWS 4786 /* Handle system-specific or unknown keysyms. */
4803 if (event->code - FUNCTION_KEY_OFFSET < 0 4787 if (event->code & (1 << 28)
4788 || event->code - FUNCTION_KEY_OFFSET < 0
4804 || (event->code - FUNCTION_KEY_OFFSET 4789 || (event->code - FUNCTION_KEY_OFFSET
4805 >= sizeof lispy_function_keys / sizeof *lispy_function_keys)) 4790 >= sizeof lispy_function_keys / sizeof *lispy_function_keys)
4791 || !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET])
4806 { 4792 {
4807 /* EVENT->code is an unknown keysym, for example someone 4793 /* We need to use an alist rather than a vector as the cache
4808 assigned `ccaron' to a key in a locale where 4794 since we can't make a vector long enuf. */
4809 XmbLookupString doesn't return a translation for it. */ 4795 if (NILP (current_kboard->system_key_syms))
4810 char *name; 4796 current_kboard->system_key_syms = Fcons (Qnil, Qnil);
4811 Lisp_Object symbol; 4797 return modify_event_symbol (event->code,
4812 4798 event->modifiers,
4813 BLOCK_INPUT; 4799 Qfunction_key,
4814 /* This returns a pointer to a static area. Don't free it. */ 4800 current_kboard->Vsystem_key_alist,
4815 name = XKeysymToString (event->code); 4801 0, &current_kboard->system_key_syms,
4816 symbol = name ? intern (name) : Qnil; 4802 (unsigned) -1);
4817 UNBLOCK_INPUT;
4818
4819 if (!NILP (symbol))
4820 return apply_modifiers (event->modifiers, symbol);
4821 } 4803 }
4822#endif /* HAVE_X_WINDOWS */
4823 4804
4824 return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET, 4805 return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET,
4825 event->modifiers, 4806 event->modifiers,