From 96927ba4c55927ea77f9892bd274c65226c63af8 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 24 Sep 1994 01:57:54 +0000 Subject: [PATCH] (upcase_initials): New function. (casify_object): Handle CASE_CAPITALIZE_UP. --- src/casefiddle.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/casefiddle.c b/src/casefiddle.c index 5d00a2b54c1..5597ba62ea3 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -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) -- 2.39.5