diff src/casefiddle.c @ 9052:6de22822cf72

(upcase_initials): New function. (casify_object): Handle CASE_CAPITALIZE_UP.
author Richard M. Stallman <rms@gnu.org>
date Sat, 24 Sep 1994 01:57:54 +0000
parents cd81dba38a49
children 4887fc1a2dda
line wrap: on
line diff
--- a/src/casefiddle.c	Sat Sep 24 01:54:17 1994 +0000
+++ b/src/casefiddle.c	Sat Sep 24 01:57:54 1994 +0000
@@ -55,12 +55,13 @@
 	  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 @@
 {
   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);
+}
 
 /* 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 @@
   return Qnil;
 }
 
-/* Like Fcapitalize but change only the initials.  */
+/* Like Fcapitalize_region but change only the initials.  */
 
 Lisp_Object
 upcase_initials_region (b, e)