Mercurial > emacs
comparison src/casefiddle.c @ 109351:c8a969d13eda
merge trunk
| author | Kenichi Handa <handa@etlken> |
|---|---|
| date | Fri, 09 Jul 2010 15:55:27 +0900 |
| parents | 8cfee7d2955f |
| children | 818e325e0469 |
comparison
equal
deleted
inserted
replaced
| 109350:c11d07f3d731 | 109351:c8a969d13eda |
|---|---|
| 151 DEFUN ("upcase", Fupcase, Supcase, 1, 1, 0, | 151 DEFUN ("upcase", Fupcase, Supcase, 1, 1, 0, |
| 152 doc: /* Convert argument to upper case and return that. | 152 doc: /* Convert argument to upper case and return that. |
| 153 The argument may be a character or string. The result has the same type. | 153 The argument may be a character or string. The result has the same type. |
| 154 The argument object is not altered--the value is a copy. | 154 The argument object is not altered--the value is a copy. |
| 155 See also `capitalize', `downcase' and `upcase-initials'. */) | 155 See also `capitalize', `downcase' and `upcase-initials'. */) |
| 156 (obj) | 156 (Lisp_Object obj) |
| 157 Lisp_Object obj; | |
| 158 { | 157 { |
| 159 return casify_object (CASE_UP, obj); | 158 return casify_object (CASE_UP, obj); |
| 160 } | 159 } |
| 161 | 160 |
| 162 DEFUN ("downcase", Fdowncase, Sdowncase, 1, 1, 0, | 161 DEFUN ("downcase", Fdowncase, Sdowncase, 1, 1, 0, |
| 163 doc: /* Convert argument to lower case and return that. | 162 doc: /* Convert argument to lower case and return that. |
| 164 The argument may be a character or string. The result has the same type. | 163 The argument may be a character or string. The result has the same type. |
| 165 The argument object is not altered--the value is a copy. */) | 164 The argument object is not altered--the value is a copy. */) |
| 166 (obj) | 165 (Lisp_Object obj) |
| 167 Lisp_Object obj; | |
| 168 { | 166 { |
| 169 return casify_object (CASE_DOWN, obj); | 167 return casify_object (CASE_DOWN, obj); |
| 170 } | 168 } |
| 171 | 169 |
| 172 DEFUN ("capitalize", Fcapitalize, Scapitalize, 1, 1, 0, | 170 DEFUN ("capitalize", Fcapitalize, Scapitalize, 1, 1, 0, |
| 173 doc: /* Convert argument to capitalized form and return that. | 171 doc: /* Convert argument to capitalized form and return that. |
| 174 This means that each word's first character is upper case | 172 This means that each word's first character is upper case |
| 175 and the rest is lower case. | 173 and the rest is lower case. |
| 176 The argument may be a character or string. The result has the same type. | 174 The argument may be a character or string. The result has the same type. |
| 177 The argument object is not altered--the value is a copy. */) | 175 The argument object is not altered--the value is a copy. */) |
| 178 (obj) | 176 (Lisp_Object obj) |
| 179 Lisp_Object obj; | |
| 180 { | 177 { |
| 181 return casify_object (CASE_CAPITALIZE, obj); | 178 return casify_object (CASE_CAPITALIZE, obj); |
| 182 } | 179 } |
| 183 | 180 |
| 184 /* Like Fcapitalize but change only the initials. */ | 181 /* Like Fcapitalize but change only the initials. */ |
| 186 DEFUN ("upcase-initials", Fupcase_initials, Supcase_initials, 1, 1, 0, | 183 DEFUN ("upcase-initials", Fupcase_initials, Supcase_initials, 1, 1, 0, |
| 187 doc: /* Convert the initial of each word in the argument to upper case. | 184 doc: /* Convert the initial of each word in the argument to upper case. |
| 188 Do not change the other letters of each word. | 185 Do not change the other letters of each word. |
| 189 The argument may be a character or string. The result has the same type. | 186 The argument may be a character or string. The result has the same type. |
| 190 The argument object is not altered--the value is a copy. */) | 187 The argument object is not altered--the value is a copy. */) |
| 191 (obj) | 188 (Lisp_Object obj) |
| 192 Lisp_Object obj; | |
| 193 { | 189 { |
| 194 return casify_object (CASE_CAPITALIZE_UP, obj); | 190 return casify_object (CASE_CAPITALIZE_UP, obj); |
| 195 } | 191 } |
| 196 | 192 |
| 197 /* flag is CASE_UP, CASE_DOWN or CASE_CAPITALIZE or CASE_CAPITALIZE_UP. | 193 /* flag is CASE_UP, CASE_DOWN or CASE_CAPITALIZE or CASE_CAPITALIZE_UP. |
| 304 doc: /* Convert the region to upper case. In programs, wants two arguments. | 300 doc: /* Convert the region to upper case. In programs, wants two arguments. |
| 305 These arguments specify the starting and ending character numbers of | 301 These arguments specify the starting and ending character numbers of |
| 306 the region to operate on. When used as a command, the text between | 302 the region to operate on. When used as a command, the text between |
| 307 point and the mark is operated on. | 303 point and the mark is operated on. |
| 308 See also `capitalize-region'. */) | 304 See also `capitalize-region'. */) |
| 309 (beg, end) | 305 (Lisp_Object beg, Lisp_Object end) |
| 310 Lisp_Object beg, end; | |
| 311 { | 306 { |
| 312 casify_region (CASE_UP, beg, end); | 307 casify_region (CASE_UP, beg, end); |
| 313 return Qnil; | 308 return Qnil; |
| 314 } | 309 } |
| 315 | 310 |
| 316 DEFUN ("downcase-region", Fdowncase_region, Sdowncase_region, 2, 2, "r", | 311 DEFUN ("downcase-region", Fdowncase_region, Sdowncase_region, 2, 2, "r", |
| 317 doc: /* Convert the region to lower case. In programs, wants two arguments. | 312 doc: /* Convert the region to lower case. In programs, wants two arguments. |
| 318 These arguments specify the starting and ending character numbers of | 313 These arguments specify the starting and ending character numbers of |
| 319 the region to operate on. When used as a command, the text between | 314 the region to operate on. When used as a command, the text between |
| 320 point and the mark is operated on. */) | 315 point and the mark is operated on. */) |
| 321 (beg, end) | 316 (Lisp_Object beg, Lisp_Object end) |
| 322 Lisp_Object beg, end; | |
| 323 { | 317 { |
| 324 casify_region (CASE_DOWN, beg, end); | 318 casify_region (CASE_DOWN, beg, end); |
| 325 return Qnil; | 319 return Qnil; |
| 326 } | 320 } |
| 327 | 321 |
| 329 doc: /* Convert the region to capitalized form. | 323 doc: /* Convert the region to capitalized form. |
| 330 Capitalized form means each word's first character is upper case | 324 Capitalized form means each word's first character is upper case |
| 331 and the rest of it is lower case. | 325 and the rest of it is lower case. |
| 332 In programs, give two arguments, the starting and ending | 326 In programs, give two arguments, the starting and ending |
| 333 character positions to operate on. */) | 327 character positions to operate on. */) |
| 334 (beg, end) | 328 (Lisp_Object beg, Lisp_Object end) |
| 335 Lisp_Object beg, end; | |
| 336 { | 329 { |
| 337 casify_region (CASE_CAPITALIZE, beg, end); | 330 casify_region (CASE_CAPITALIZE, beg, end); |
| 338 return Qnil; | 331 return Qnil; |
| 339 } | 332 } |
| 340 | 333 |
| 344 Supcase_initials_region, 2, 2, "r", | 337 Supcase_initials_region, 2, 2, "r", |
| 345 doc: /* Upcase the initial of each word in the region. | 338 doc: /* Upcase the initial of each word in the region. |
| 346 Subsequent letters of each word are not changed. | 339 Subsequent letters of each word are not changed. |
| 347 In programs, give two arguments, the starting and ending | 340 In programs, give two arguments, the starting and ending |
| 348 character positions to operate on. */) | 341 character positions to operate on. */) |
| 349 (beg, end) | 342 (Lisp_Object beg, Lisp_Object end) |
| 350 Lisp_Object beg, end; | |
| 351 { | 343 { |
| 352 casify_region (CASE_CAPITALIZE_UP, beg, end); | 344 casify_region (CASE_CAPITALIZE_UP, beg, end); |
| 353 return Qnil; | 345 return Qnil; |
| 354 } | 346 } |
| 355 | 347 |
| 374 | 366 |
| 375 DEFUN ("upcase-word", Fupcase_word, Supcase_word, 1, 1, "p", | 367 DEFUN ("upcase-word", Fupcase_word, Supcase_word, 1, 1, "p", |
| 376 doc: /* Convert following word (or ARG words) to upper case, moving over. | 368 doc: /* Convert following word (or ARG words) to upper case, moving over. |
| 377 With negative argument, convert previous words but do not move. | 369 With negative argument, convert previous words but do not move. |
| 378 See also `capitalize-word'. */) | 370 See also `capitalize-word'. */) |
| 379 (arg) | 371 (Lisp_Object arg) |
| 380 Lisp_Object arg; | |
| 381 { | 372 { |
| 382 Lisp_Object beg, end; | 373 Lisp_Object beg, end; |
| 383 EMACS_INT newpoint; | 374 EMACS_INT newpoint; |
| 384 XSETFASTINT (beg, PT); | 375 XSETFASTINT (beg, PT); |
| 385 end = operate_on_word (arg, &newpoint); | 376 end = operate_on_word (arg, &newpoint); |
| 389 } | 380 } |
| 390 | 381 |
| 391 DEFUN ("downcase-word", Fdowncase_word, Sdowncase_word, 1, 1, "p", | 382 DEFUN ("downcase-word", Fdowncase_word, Sdowncase_word, 1, 1, "p", |
| 392 doc: /* Convert following word (or ARG words) to lower case, moving over. | 383 doc: /* Convert following word (or ARG words) to lower case, moving over. |
| 393 With negative argument, convert previous words but do not move. */) | 384 With negative argument, convert previous words but do not move. */) |
| 394 (arg) | 385 (Lisp_Object arg) |
| 395 Lisp_Object arg; | |
| 396 { | 386 { |
| 397 Lisp_Object beg, end; | 387 Lisp_Object beg, end; |
| 398 EMACS_INT newpoint; | 388 EMACS_INT newpoint; |
| 399 XSETFASTINT (beg, PT); | 389 XSETFASTINT (beg, PT); |
| 400 end = operate_on_word (arg, &newpoint); | 390 end = operate_on_word (arg, &newpoint); |
| 406 DEFUN ("capitalize-word", Fcapitalize_word, Scapitalize_word, 1, 1, "p", | 396 DEFUN ("capitalize-word", Fcapitalize_word, Scapitalize_word, 1, 1, "p", |
| 407 doc: /* Capitalize the following word (or ARG words), moving over. | 397 doc: /* Capitalize the following word (or ARG words), moving over. |
| 408 This gives the word(s) a first character in upper case | 398 This gives the word(s) a first character in upper case |
| 409 and the rest lower case. | 399 and the rest lower case. |
| 410 With negative argument, capitalize previous words but do not move. */) | 400 With negative argument, capitalize previous words but do not move. */) |
| 411 (arg) | 401 (Lisp_Object arg) |
| 412 Lisp_Object arg; | |
| 413 { | 402 { |
| 414 Lisp_Object beg, end; | 403 Lisp_Object beg, end; |
| 415 EMACS_INT newpoint; | 404 EMACS_INT newpoint; |
| 416 XSETFASTINT (beg, PT); | 405 XSETFASTINT (beg, PT); |
| 417 end = operate_on_word (arg, &newpoint); | 406 end = operate_on_word (arg, &newpoint); |
