Commit 96927ba4 authored by Richard M. Stallman's avatar Richard M. Stallman

(upcase_initials): New function.

(casify_object): Handle CASE_CAPITALIZE_UP.
parent 0cf61204
......@@ -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);
}
/* 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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment