diff options
| author | Richard M. Stallman | 1994-09-24 02:03:32 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-09-24 02:03:32 +0000 |
| commit | 8cef1f785360141dbf660e9c8be9d5c1bb36d802 (patch) | |
| tree | 97d40efbe1446d6d6b181cd5d1a5b9633f3021eb | |
| parent | 96927ba4c55927ea77f9892bd274c65226c63af8 (diff) | |
| download | emacs-8cef1f785360141dbf660e9c8be9d5c1bb36d802.tar.gz emacs-8cef1f785360141dbf660e9c8be9d5c1bb36d802.zip | |
(Fupcase_initials_region): New function.
(Fupcase_initials): New function.
(syms_of_casefiddle): defsubr them.
| -rw-r--r-- | src/casefiddle.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/casefiddle.c b/src/casefiddle.c index 5597ba62ea3..4fcdcc0fee9 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -73,7 +73,8 @@ casify_object (flag, obj) | |||
| 73 | DEFUN ("upcase", Fupcase, Supcase, 1, 1, 0, | 73 | DEFUN ("upcase", Fupcase, Supcase, 1, 1, 0, |
| 74 | "Convert argument to upper case and return that.\n\ | 74 | "Convert argument to upper case and return that.\n\ |
| 75 | The argument may be a character or string. The result has the same type.\n\ | 75 | The argument may be a character or string. The result has the same type.\n\ |
| 76 | The argument object is not altered. See also `capitalize'.") | 76 | The argument object is not altered--the value is a copy.\n\ |
| 77 | See also `capitalize', `downcase' and `upcase-initials'.") | ||
| 77 | (obj) | 78 | (obj) |
| 78 | Lisp_Object obj; | 79 | Lisp_Object obj; |
| 79 | { | 80 | { |
| @@ -83,7 +84,7 @@ The argument object is not altered. See also `capitalize'.") | |||
| 83 | DEFUN ("downcase", Fdowncase, Sdowncase, 1, 1, 0, | 84 | DEFUN ("downcase", Fdowncase, Sdowncase, 1, 1, 0, |
| 84 | "Convert argument to lower case and return that.\n\ | 85 | "Convert argument to lower case and return that.\n\ |
| 85 | The argument may be a character or string. The result has the same type.\n\ | 86 | The argument may be a character or string. The result has the same type.\n\ |
| 86 | The argument object is not altered.") | 87 | The argument object is not altered--the value is a copy.") |
| 87 | (obj) | 88 | (obj) |
| 88 | Lisp_Object obj; | 89 | Lisp_Object obj; |
| 89 | { | 90 | { |
| @@ -95,13 +96,24 @@ DEFUN ("capitalize", Fcapitalize, Scapitalize, 1, 1, 0, | |||
| 95 | This means that each word's first character is upper case\n\ | 96 | This means that each word's first character is upper case\n\ |
| 96 | and the rest is lower case.\n\ | 97 | and the rest is lower case.\n\ |
| 97 | The argument may be a character or string. The result has the same type.\n\ | 98 | The argument may be a character or string. The result has the same type.\n\ |
| 98 | The argument object is not altered.") | 99 | The argument object is not altered--the value is a copy.") |
| 99 | (obj) | 100 | (obj) |
| 100 | Lisp_Object obj; | 101 | Lisp_Object obj; |
| 101 | { | 102 | { |
| 102 | return casify_object (CASE_CAPITALIZE, obj); | 103 | return casify_object (CASE_CAPITALIZE, obj); |
| 103 | } | 104 | } |
| 104 | 105 | ||
| 106 | DEFUN ("upcase-initials", Fupcase_initials, Supcase_initials, 1, 1, 0, | ||
| 107 | "Convert the initial of each word in the argument to upper case.\n\ | ||
| 108 | Do not change the other letters of each word.\n\ | ||
| 109 | The argument may be a character or string. The result has the same type.\n\ | ||
| 110 | The argument object is not altered--the value is a copy.") | ||
| 111 | (obj) | ||
| 112 | Lisp_Object obj; | ||
| 113 | { | ||
| 114 | return casify_object (CASE_CAPITALIZE_UP, obj); | ||
| 115 | } | ||
| 116 | |||
| 105 | /* Like Fcapitalize but change only the initials. */ | 117 | /* Like Fcapitalize but change only the initials. */ |
| 106 | 118 | ||
| 107 | Lisp_Object | 119 | Lisp_Object |
| @@ -186,6 +198,19 @@ character positions to operate on.") | |||
| 186 | return Qnil; | 198 | return Qnil; |
| 187 | } | 199 | } |
| 188 | 200 | ||
| 201 | DEFUN ("upcase-initials-region", Fupcase_initials_region, | ||
| 202 | Supcase_initials_region, 2, 2, "r", | ||
| 203 | "Upcase the initial of each word in the region.\n\ | ||
| 204 | Subsequent letters of each word are not changed.\n\ | ||
| 205 | In programs, give two arguments, the starting and ending\n\ | ||
| 206 | character positions to operate on.") | ||
| 207 | (b, e) | ||
| 208 | Lisp_Object b, e; | ||
| 209 | { | ||
| 210 | casify_region (CASE_CAPITALIZE_UP, b, e); | ||
| 211 | return Qnil; | ||
| 212 | } | ||
| 213 | |||
| 189 | /* Like Fcapitalize_region but change only the initials. */ | 214 | /* Like Fcapitalize_region but change only the initials. */ |
| 190 | 215 | ||
| 191 | Lisp_Object | 216 | Lisp_Object |
| @@ -268,9 +293,11 @@ syms_of_casefiddle () | |||
| 268 | defsubr (&Supcase); | 293 | defsubr (&Supcase); |
| 269 | defsubr (&Sdowncase); | 294 | defsubr (&Sdowncase); |
| 270 | defsubr (&Scapitalize); | 295 | defsubr (&Scapitalize); |
| 296 | defsubr (&Supcase_initials); | ||
| 271 | defsubr (&Supcase_region); | 297 | defsubr (&Supcase_region); |
| 272 | defsubr (&Sdowncase_region); | 298 | defsubr (&Sdowncase_region); |
| 273 | defsubr (&Scapitalize_region); | 299 | defsubr (&Scapitalize_region); |
| 300 | defsubr (&Supcase_initials_region); | ||
| 274 | defsubr (&Supcase_word); | 301 | defsubr (&Supcase_word); |
| 275 | defsubr (&Sdowncase_word); | 302 | defsubr (&Sdowncase_word); |
| 276 | defsubr (&Scapitalize_word); | 303 | defsubr (&Scapitalize_word); |