diff options
| author | Juri Linkov | 2016-06-06 00:23:21 +0300 |
|---|---|---|
| committer | Juri Linkov | 2016-06-06 00:23:21 +0300 |
| commit | 66d5c75e2dd9f4204b51a5d3299456ecc4ea6842 (patch) | |
| tree | 167eaba896127f2c9ddb01c914e003893291b2ec /src | |
| parent | efde23dcdd110ae9d85449a04a66408d5e8a2b23 (diff) | |
| download | emacs-66d5c75e2dd9f4204b51a5d3299456ecc4ea6842.tar.gz emacs-66d5c75e2dd9f4204b51a5d3299456ecc4ea6842.zip | |
* src/casefiddle.c (Fupcase_region): Add arg ‘region-noncontiguous-p’.
If non-nil, operate on multiple chunks. (Bug#23655)
* src/search.c (Freplace_match): Use Qnil for new arg of Fupcase_region.
Diffstat (limited to 'src')
| -rw-r--r-- | src/casefiddle.c | 22 | ||||
| -rw-r--r-- | src/search.c | 3 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/casefiddle.c b/src/casefiddle.c index 34a65edd008..6114a6f7857 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -294,15 +294,31 @@ casify_region (enum case_action flag, Lisp_Object b, Lisp_Object e) | |||
| 294 | } | 294 | } |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | DEFUN ("upcase-region", Fupcase_region, Supcase_region, 2, 2, "r", | 297 | DEFUN ("upcase-region", Fupcase_region, Supcase_region, 2, 3, |
| 298 | "(list (region-beginning) (region-end) (region-noncontiguous-p))", | ||
| 298 | doc: /* Convert the region to upper case. In programs, wants two arguments. | 299 | doc: /* Convert the region to upper case. In programs, wants two arguments. |
| 299 | These arguments specify the starting and ending character numbers of | 300 | These arguments specify the starting and ending character numbers of |
| 300 | the region to operate on. When used as a command, the text between | 301 | the region to operate on. When used as a command, the text between |
| 301 | point and the mark is operated on. | 302 | point and the mark is operated on. |
| 302 | See also `capitalize-region'. */) | 303 | See also `capitalize-region'. */) |
| 303 | (Lisp_Object beg, Lisp_Object end) | 304 | (Lisp_Object beg, Lisp_Object end, Lisp_Object region_noncontiguous_p) |
| 304 | { | 305 | { |
| 305 | casify_region (CASE_UP, beg, end); | 306 | Lisp_Object bounds = Qnil; |
| 307 | |||
| 308 | if (!NILP (region_noncontiguous_p)) | ||
| 309 | { | ||
| 310 | bounds = call1 (Fsymbol_value (intern ("region-extract-function")), | ||
| 311 | intern ("bounds")); | ||
| 312 | |||
| 313 | while (CONSP (bounds)) | ||
| 314 | { | ||
| 315 | casify_region (CASE_UP, XCAR (XCAR (bounds)), XCDR (XCAR (bounds))); | ||
| 316 | bounds = XCDR (bounds); | ||
| 317 | } | ||
| 318 | } | ||
| 319 | else | ||
| 320 | casify_region (CASE_UP, beg, end); | ||
| 321 | |||
| 306 | return Qnil; | 322 | return Qnil; |
| 307 | } | 323 | } |
| 308 | 324 | ||
diff --git a/src/search.c b/src/search.c index f39df6784c3..7cb18a2059a 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -2691,7 +2691,8 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2691 | 2691 | ||
| 2692 | if (case_action == all_caps) | 2692 | if (case_action == all_caps) |
| 2693 | Fupcase_region (make_number (search_regs.start[sub]), | 2693 | Fupcase_region (make_number (search_regs.start[sub]), |
| 2694 | make_number (newpoint)); | 2694 | make_number (newpoint), |
| 2695 | Qnil); | ||
| 2695 | else if (case_action == cap_initial) | 2696 | else if (case_action == cap_initial) |
| 2696 | Fupcase_initials_region (make_number (search_regs.start[sub]), | 2697 | Fupcase_initials_region (make_number (search_regs.start[sub]), |
| 2697 | make_number (newpoint)); | 2698 | make_number (newpoint)); |