GNU bug report logs - #9751
23.3; Alternative Keyboard Feature/Bug

Previous Next

Package: emacs;

Reported by: Nikos Pitsianis <nikos <at> cs.duke.edu>

Date: Fri, 14 Oct 2011 07:19:02 UTC

Severity: normal

Found in version 23.3

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: lekktu <at> gmail.com, Andreas Schwab <schwab <at> linux-m68k.org>, Nikos Pitsianis <nikos <at> cs.duke.edu>, 9751 <at> debbugs.gnu.org
Subject: bug#9751: 23.3; Alternative Keyboard Feature/Bug
Date: Mon, 24 Oct 2011 16:18:20 -0400
>> 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'.
> It still does nothing.  I guess for testing it, a Greek keyboard layout
> is not necessary.  It's enough to evaluate:
> (define-key function-key-map [?*] [?b])
> and typing `*' is expected to run `beginning-of-buffer' in Info.

Oh, right because * is not bound to `undefined', instead it's bound to
self-insert-command which is remapped to `undefined'.  Damn!
The patch below at least works for this test case,


        Stefan


=== modified file 'src/keyboard.c'
--- src/keyboard.c	2011-10-03 20:50:54 +0000
+++ src/keyboard.c	2011-10-24 20:15:14 +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)





This bug report was last modified 13 years and 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.