diff src/keymap.c @ 90389:146cd8369025

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-60 Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 259-273) - Update from CVS - lisp/replace.el (occur-engine): Bind `inhibit-field-text-motion' to t - Merge from gnus--rel--5.10 - Rename "field-at-point" to "field-at-pos" - (comint-insert-input): Remove redundant calls to setq and goto-char * gnus--rel--5.10 (patch 99-100) - Merge from emacs--devo--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 10 May 2006 20:42:41 +0000
parents 2ecafc6d5db7 e1a064810f6f
children 9b61abfe926b
line wrap: on
line diff
--- a/src/keymap.c	Tue May 02 08:50:29 2006 +0000
+++ b/src/keymap.c	Wed May 10 20:42:41 2006 +0000
@@ -2120,12 +2120,21 @@
      int force_multibyte;
 {
   unsigned c2;
+  int valid_p;
 
   /* Clear all the meaningless bits above the meta bit.  */
   c &= meta_modifier | ~ - meta_modifier;
   c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier
 	     | meta_modifier | shift_modifier | super_modifier);
 
+  valid_p = SINGLE_BYTE_CHAR_P (c2) || char_valid_p (c2, 0);
+  if (! valid_p)
+    {
+      /* KEY_DESCRIPTION_SIZE is large enough for this.  */
+      p += sprintf (p, "[%d]", c);
+      return p;
+    }
+
   if (c & alt_modifier)
     {
       *p++ = 'A';
@@ -3310,7 +3319,9 @@
 	      tem = shadow_lookup (shadow, kludge, Qt);
 	      if (!NILP (tem))
 		{
-		  if (mention_shadow)
+		  /* Avoid generating duplicate entries if the
+		     shadowed binding has the same definition. */
+		  if (mention_shadow && !EQ (tem, definition))
 		    this_shadowed = 1;
 		  else
 		    continue;