]> code.delx.au - gnu-emacs/blobdiff - src/casefiddle.c
(map_char_table): New arg SUBTABLE. Callers changed.
[gnu-emacs] / src / casefiddle.c
index a630025fa191593cbbdddcf7d6864b3abfd653f1..b0cc0b94991e1a3212ea9f757e2a0c0532ba3263 100644 (file)
@@ -35,6 +35,10 @@ casify_object (flag, obj)
   register int i, c, len;
   register int inword = flag == CASE_DOWN;
 
+  /* If the case table is flagged as modified, rescan it.  */
+  if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1]))
+    Fset_case_table (current_buffer->downcase_table);
+
   while (1)
     {
       if (INTEGERP (obj))
@@ -133,6 +137,10 @@ casify_region (flag, b, e)
     /* Not modifying because nothing marked */
     return;
 
+  /* If the case table is flagged as modified, rescan it.  */
+  if (NILP (XCHAR_TABLE (current_buffer->downcase_table)->extras[1]))
+    Fset_case_table (current_buffer->downcase_table);
+
   validate_region (&b, &e);
   start = XFASTINT (b);
   end = XFASTINT (e);
@@ -141,13 +149,13 @@ casify_region (flag, b, e)
 
   for (i = start; i < end; i++)
     {
-      c = FETCH_CHAR (i);
+      c = FETCH_BYTE (i);
       if (inword && flag != CASE_CAPITALIZE_UP)
        c = DOWNCASE (c);
       else if (!UPPERCASEP (c)
               && (!inword || flag != CASE_CAPITALIZE_UP))
        c = UPCASE1 (c);
-      FETCH_CHAR (i) = c;
+      FETCH_BYTE (i) = c;
       if ((int) flag >= (int) CASE_CAPITALIZE)
        inword = SYNTAX (c) == Sword;
     }
@@ -219,11 +227,11 @@ operate_on_word (arg, newpoint)
 
   CHECK_NUMBER (arg, 0);
   iarg = XINT (arg);
-  farend = scan_words (point, iarg);
+  farend = scan_words (PT, iarg);
   if (!farend)
     farend = iarg > 0 ? ZV : BEGV;
 
-  *newpoint = point > farend ? point : farend;
+  *newpoint = PT > farend ? PT : farend;
   XSETFASTINT (val, farend);
 
   return val;
@@ -238,7 +246,7 @@ See also `capitalize-word'.")
 {
   Lisp_Object beg, end;
   int newpoint;
-  XSETFASTINT (beg, point);
+  XSETFASTINT (beg, PT);
   end = operate_on_word (arg, &newpoint);
   casify_region (CASE_UP, beg, end);
   SET_PT (newpoint);
@@ -253,7 +261,7 @@ With negative argument, convert previous words but do not move.")
 {
   Lisp_Object beg, end;
   int newpoint;
-  XSETFASTINT (beg, point);
+  XSETFASTINT (beg, PT);
   end = operate_on_word (arg, &newpoint);
   casify_region (CASE_DOWN, beg, end);
   SET_PT (newpoint);
@@ -270,7 +278,7 @@ With negative argument, capitalize previous words but do not move.")
 {
   Lisp_Object beg, end;
   int newpoint;
-  XSETFASTINT (beg, point);
+  XSETFASTINT (beg, PT);
   end = operate_on_word (arg, &newpoint);
   casify_region (CASE_CAPITALIZE, beg, end);
   SET_PT (newpoint);