emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/character.c,v


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/character.c,v
Date: Wed, 05 Mar 2008 05:12:07 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/03/05 05:12:06

Index: character.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/character.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- character.c 5 Mar 2008 04:18:00 -0000       1.6
+++ character.c 5 Mar 2008 05:12:06 -0000       1.7
@@ -115,24 +115,18 @@
        c &= ~CHAR_SHIFT;
       else if ((c & 0377) >= 'a' && (c & 0377) <= 'z')
        c = (c & ~CHAR_SHIFT) - ('a' - 'A');
-      /* Shift modifier with ASCII control characters should be
-        ignored.  */
-      else if ((c & ~CHAR_MODIFIER_MASK) < 0x20)
+      /* Shift modifier for control characters and SPC is ignored.  */
+      else if ((c & ~CHAR_MODIFIER_MASK) <= 0x20)
        c &= ~CHAR_SHIFT;
     }
-  if (c & CHAR_META)
-    {
-      /* Move the meta bit to the right place for a string.  */
-      c = (c & ~CHAR_META) | 0x80;
-    }
   if (c & CHAR_CTL)
     {
       /* Simulate the code in lread.c.  */
       /* Allow `\C- ' and `\C-?'.  */
-      if ((c & ~CHAR_CTL) == ' ')
-       c = 0;
-      else if ((c & ~CHAR_CTL) == '?')
-       c = 127;
+      if ((c & 0377) == ' ')
+       c &= ~0177 & ~ CHAR_CTL;
+      else if ((c & 0377) == '?')
+       c = 0177 | (c & ~0177 & ~CHAR_CTL);
       /* ASCII control chars are made from letters (both cases),
         as well as the non-letters within 0100...0137.  */
       else if ((c & 0137) >= 0101 && (c & 0137) <= 0132)
@@ -140,6 +134,11 @@
       else if ((c & 0177) >= 0100 && (c & 0177) <= 0137)
        c &= (037 | (~0177 & ~CHAR_CTL));
     }
+  if (c & CHAR_META)
+    {
+      /* Move the meta bit to the right place for a string.  */
+      c = (c & ~CHAR_META) | 0x80;
+    }
 
   return c;
 }




reply via email to

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