]> code.delx.au - gnu-emacs/commitdiff
(upcase_initials): New function.
authorRichard M. Stallman <rms@gnu.org>
Sat, 24 Sep 1994 01:57:54 +0000 (01:57 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 24 Sep 1994 01:57:54 +0000 (01:57 +0000)
(casify_object): Handle CASE_CAPITALIZE_UP.

src/casefiddle.c

index 5d00a2b54c13a5f3327a5fceea4b51428f25970d..5597ba62ea3c1f09c4e30ec0c0f4bbec81b1eb10 100644 (file)
@@ -55,12 +55,13 @@ casify_object (flag, obj)
          for (i = 0; i < len; i++)
            {
              c = XSTRING (obj)->data[i];
-             if (inword)
+             if (inword && flag != CASE_CAPITALIZE_UP)
                c = DOWNCASE (c);
-             else if (!UPPERCASEP (c))
+             else if (!UPPERCASEP (c)
+                      && (!inword || flag != CASE_CAPITALIZE_UP))
                c = UPCASE1 (c);
              XSTRING (obj)->data[i] = c;
-             if (flag == CASE_CAPITALIZE)
+             if ((int) flag >= (int) CASE_CAPITALIZE)
                inword = SYNTAX (c) == Sword;
            }
          return obj;
@@ -100,6 +101,15 @@ The argument object is not altered.")
 {
   return casify_object (CASE_CAPITALIZE, obj);
 }
+
+/* Like Fcapitalize but change only the initials.  */
+
+Lisp_Object
+upcase_initials (obj)
+     Lisp_Object obj;
+{
+  return casify_object (CASE_CAPITALIZE_UP, obj);
+}
 \f
 /* flag is CASE_UP, CASE_DOWN or CASE_CAPITALIZE or CASE_CAPITALIZE_UP.
    b and e specify range of buffer to operate on. */
@@ -176,7 +186,7 @@ character positions to operate on.")
   return Qnil;
 }
 
-/* Like Fcapitalize but change only the initials.  */
+/* Like Fcapitalize_region but change only the initials.  */
 
 Lisp_Object
 upcase_initials_region (b, e)