emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106187: Make function-key-map apply


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106187: Make function-key-map apply when key is bound to `undefined'.
Date: Tue, 25 Oct 2011 08:54:04 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106187
fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9751
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2011-10-25 08:54:04 -0400
message:
  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'.
modified:
  src/ChangeLog
  src/keyboard.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-10-25 04:27:47 +0000
+++ b/src/ChangeLog     2011-10-25 12:54:04 +0000
@@ -1,3 +1,8 @@
+2011-10-25  Stefan Monnier  <address@hidden>
+
+       * keyboard.c (test_undefined): New function (bug#9751).
+       (read_key_sequence): Use it to detect when a key is bound to 
`undefined'.
+
 2011-10-25  Enami Tsugutomo  <address@hidden>
 
        * sysdep.c (init_sys_modes): Fix the check for the controlling

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2011-10-03 20:50:54 +0000
+++ b/src/keyboard.c    2011-10-25 12:54:04 +0000
@@ -8902,6 +8902,14 @@
   return 0;
 }
 
+static int
+test_undefined (Lisp_Object binding)
+{
+  return (EQ (binding, Qundefined)
+         || (!NILP (binding) && SYMBOLP (binding)
+             && EQ (Fcommand_remapping (binding, Qnil, Qnil), Qundefined)));
+}
+
 /* Read a sequence of keys that ends with a non prefix character,
    storing it in KEYBUF, a buffer of size BUFSIZE.
    Prompt with PROMPT.
@@ -9852,7 +9860,9 @@
            }
        }
 
-      if (first_binding < nmaps && NILP (submaps[first_binding])
+      if (first_binding < nmaps
+         && NILP (submaps[first_binding])
+         && !test_undefined (defs[first_binding])
          && indec.start >= t)
        /* There is a binding and it's not a prefix.
           (and it doesn't have any input-decode-map translation pending).
@@ -9879,7 +9889,9 @@
                                  /* If there's a binding (i.e.
                                     first_binding >= nmaps) we don't want
                                     to apply this function-key-mapping.  */
-                                 fkey.end + 1 == t && first_binding >= nmaps,
+                                 fkey.end + 1 == t
+                                 && (first_binding >= nmaps
+                                     || test_undefined (defs[first_binding])),
                                  &diff, prompt);
            UNGCPRO;
            if (done)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]