diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-09-24 01:57:54 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-09-24 01:57:54 +0000 |
commit | 91c35f692c0b3b83a90e3036a5f80b5b1dc53686 (patch) | |
tree | 7b3cb429e4f7dd6bd3d97e467d1f850da049fe2b /src/casefiddle.c | |
parent | 19abddedeaa8ed67d855d9ac73ae071adfd28161 (diff) | |
download | emacs-91c35f692c0b3b83a90e3036a5f80b5b1dc53686.tar.gz |
(upcase_initials): New function.
(casify_object): Handle CASE_CAPITALIZE_UP.
Diffstat (limited to 'src/casefiddle.c')
-rw-r--r-- | src/casefiddle.c | 18 |
1 files 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) |