Subject: Re: bug#9751: 23.3; Alternative Keyboard Feature/Bug

From: Stefan Monnier <[email-masked]>
Date: Mon, 24 Oct 2011 12:05:52 -0400

>>>>> "Juri" == Juri Linkov <[email-masked]> writes:

>> So I think that fixing (3) is the best choice for now.
>> Does the patch below work for you?

> Sorry, it doesn't seem to work.  After (define-key function-key-map [?β] [?b]),
> typing `β' in Info still does nothing.

Oh, yes, it wasn't complete.  Here is a more complete one which seems to
work to remap 3 to 4 with 3 globally bound to `undefined'.

        Stefan

=== modified file 'src/keyboard.c'
--- src/keyboard.c	2011-10-03 20:50:54 +0000
+++ src/keyboard.c	2011-10-24 16:05:31 +0000
@@ -9852,7 +9852,9 @@
 	    }
 	}
 
-      if (first_binding < nmaps && NILP (submaps[first_binding])
+      if (first_binding < nmaps
+	  && NILP (submaps[first_binding])
+	  && !EQ (defs[first_binding], Qundefined)
 	  && 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 +9881,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
+				      || EQ (defs[first_binding], Qundefined)),
 				  &diff, prompt);
 	    UNGCPRO;
 	    if (done)