aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2011-10-25 08:54:04 -0400
committerStefan Monnier2011-10-25 08:54:04 -0400
commite6346438e26069017f0eb5e1b15c53c30587462e (patch)
tree5c2c63cd56b148bfa0c7d5f751e62c70192f62fa /src
parent3f04efd64d76ea897cb3b27f971777c66042a23b (diff)
downloademacs-e6346438e26069017f0eb5e1b15c53c30587462e.tar.gz
emacs-e6346438e26069017f0eb5e1b15c53c30587462e.zip
Make function-key-map apply when key is bound to `undefined'.
* src/keyboard.c (test_undefined): New function. (read_key_sequence): Use it to detect when a key is bound to `undefined'. Fixes: debbugs:9751
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/keyboard.c16
2 files changed, 19 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cee48bd1731..52581be2863 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * keyboard.c (test_undefined): New function (bug#9751).
4 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5
12011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com> 62011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
2 7
3 * sysdep.c (init_sys_modes): Fix the check for the controlling 8 * sysdep.c (init_sys_modes): Fix the check for the controlling
diff --git a/src/keyboard.c b/src/keyboard.c
index 6f3bfd8c1e7..eb316947dcb 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -8902,6 +8902,14 @@ keyremap_step (Lisp_Object *keybuf, int bufsize, volatile keyremap *fkey,
8902 return 0; 8902 return 0;
8903} 8903}
8904 8904
8905static int
8906test_undefined (Lisp_Object binding)
8907{
8908 return (EQ (binding, Qundefined)
8909 || (!NILP (binding) && SYMBOLP (binding)
8910 && EQ (Fcommand_remapping (binding, Qnil, Qnil), Qundefined)));
8911}
8912
8905/* Read a sequence of keys that ends with a non prefix character, 8913/* Read a sequence of keys that ends with a non prefix character,
8906 storing it in KEYBUF, a buffer of size BUFSIZE. 8914 storing it in KEYBUF, a buffer of size BUFSIZE.
8907 Prompt with PROMPT. 8915 Prompt with PROMPT.
@@ -9852,7 +9860,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9852 } 9860 }
9853 } 9861 }
9854 9862
9855 if (first_binding < nmaps && NILP (submaps[first_binding]) 9863 if (first_binding < nmaps
9864 && NILP (submaps[first_binding])
9865 && !test_undefined (defs[first_binding])
9856 && indec.start >= t) 9866 && indec.start >= t)
9857 /* There is a binding and it's not a prefix. 9867 /* There is a binding and it's not a prefix.
9858 (and it doesn't have any input-decode-map translation pending). 9868 (and it doesn't have any input-decode-map translation pending).
@@ -9879,7 +9889,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
9879 /* If there's a binding (i.e. 9889 /* If there's a binding (i.e.
9880 first_binding >= nmaps) we don't want 9890 first_binding >= nmaps) we don't want
9881 to apply this function-key-mapping. */ 9891 to apply this function-key-mapping. */
9882 fkey.end + 1 == t && first_binding >= nmaps, 9892 fkey.end + 1 == t
9893 && (first_binding >= nmaps
9894 || test_undefined (defs[first_binding])),
9883 &diff, prompt); 9895 &diff, prompt);
9884 UNGCPRO; 9896 UNGCPRO;
9885 if (done) 9897 if (done)