diff options
| author | Juri Linkov | 2007-12-09 23:47:04 +0000 |
|---|---|---|
| committer | Juri Linkov | 2007-12-09 23:47:04 +0000 |
| commit | 3be42fcdfbb97a7fb33a9c1394e86245e9867bc5 (patch) | |
| tree | 03d28f7050b05549487132a734e649fb0d1e0acc | |
| parent | 522bec736968730e9cf3e75b54a1c8ca7912c30a (diff) | |
| download | emacs-3be42fcdfbb97a7fb33a9c1394e86245e9867bc5.tar.gz emacs-3be42fcdfbb97a7fb33a9c1394e86245e9867bc5.zip | |
(keep-lines, flush-lines, how-many): Doc fix.
Check search-upper-case before calling isearch-no-upper-case-p
to set case-fold-search.
(occur): Doc fix.
(occur-1, perform-replace): Check search-upper-case before calling
isearch-no-upper-case-p to set case-fold-search.
| -rw-r--r-- | lisp/replace.el | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 34fdd5fe3df..8bd3bec20a0 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -552,8 +552,8 @@ A match split across lines preserves all the lines it lies in. | |||
| 552 | When called from Lisp (and usually interactively as well, see below) | 552 | When called from Lisp (and usually interactively as well, see below) |
| 553 | applies to all lines starting after point. | 553 | applies to all lines starting after point. |
| 554 | 554 | ||
| 555 | If REGEXP contains upper case characters (excluding those preceded by `\\'), | 555 | If REGEXP contains upper case characters (excluding those preceded by `\\') |
| 556 | the matching is case-sensitive. | 556 | and `search-upper-case' is non-nil, the matching is case-sensitive. |
| 557 | 557 | ||
| 558 | Second and third arg RSTART and REND specify the region to operate on. | 558 | Second and third arg RSTART and REND specify the region to operate on. |
| 559 | This command operates on (the accessible part of) all lines whose | 559 | This command operates on (the accessible part of) all lines whose |
| @@ -597,8 +597,10 @@ a previously found match." | |||
| 597 | (save-excursion | 597 | (save-excursion |
| 598 | (or (bolp) (forward-line 1)) | 598 | (or (bolp) (forward-line 1)) |
| 599 | (let ((start (point)) | 599 | (let ((start (point)) |
| 600 | (case-fold-search (and case-fold-search | 600 | (case-fold-search |
| 601 | (isearch-no-upper-case-p regexp t)))) | 601 | (if (and case-fold-search search-upper-case) |
| 602 | (isearch-no-upper-case-p regexp t) | ||
| 603 | case-fold-search))) | ||
| 602 | (while (< (point) rend) | 604 | (while (< (point) rend) |
| 603 | ;; Start is first char not preserved by previous match. | 605 | ;; Start is first char not preserved by previous match. |
| 604 | (if (not (re-search-forward regexp rend 'move)) | 606 | (if (not (re-search-forward regexp rend 'move)) |
| @@ -626,8 +628,8 @@ well, see below), applies to the part of the buffer after point. | |||
| 626 | The line point is in is deleted if and only if it contains a | 628 | The line point is in is deleted if and only if it contains a |
| 627 | match for regexp starting after point. | 629 | match for regexp starting after point. |
| 628 | 630 | ||
| 629 | If REGEXP contains upper case characters (excluding those preceded by `\\'), | 631 | If REGEXP contains upper case characters (excluding those preceded by `\\') |
| 630 | the matching is case-sensitive. | 632 | and `search-upper-case' is non-nil, the matching is case-sensitive. |
| 631 | 633 | ||
| 632 | Second and third arg RSTART and REND specify the region to operate on. | 634 | Second and third arg RSTART and REND specify the region to operate on. |
| 633 | Lines partially contained in this region are deleted if and only if | 635 | Lines partially contained in this region are deleted if and only if |
| @@ -657,8 +659,10 @@ starting on the same line at which another match ended is ignored." | |||
| 657 | (setq rstart (point) | 659 | (setq rstart (point) |
| 658 | rend (point-max-marker))) | 660 | rend (point-max-marker))) |
| 659 | (goto-char rstart)) | 661 | (goto-char rstart)) |
| 660 | (let ((case-fold-search (and case-fold-search | 662 | (let ((case-fold-search |
| 661 | (isearch-no-upper-case-p regexp t)))) | 663 | (if (and case-fold-search search-upper-case) |
| 664 | (isearch-no-upper-case-p regexp t) | ||
| 665 | case-fold-search))) | ||
| 662 | (save-excursion | 666 | (save-excursion |
| 663 | (while (and (< (point) rend) | 667 | (while (and (< (point) rend) |
| 664 | (re-search-forward regexp rend t)) | 668 | (re-search-forward regexp rend t)) |
| @@ -676,8 +680,8 @@ When called from Lisp and INTERACTIVE is omitted or nil, just return | |||
| 676 | the number, do not print it; if INTERACTIVE is t, the function behaves | 680 | the number, do not print it; if INTERACTIVE is t, the function behaves |
| 677 | in all respects has if it had been called interactively. | 681 | in all respects has if it had been called interactively. |
| 678 | 682 | ||
| 679 | If REGEXP contains upper case characters (excluding those preceded by `\\'), | 683 | If REGEXP contains upper case characters (excluding those preceded by `\\') |
| 680 | the matching is case-sensitive. | 684 | and `search-upper-case' is non-nil, the matching is case-sensitive. |
| 681 | 685 | ||
| 682 | Second and third arg RSTART and REND specify the region to operate on. | 686 | Second and third arg RSTART and REND specify the region to operate on. |
| 683 | 687 | ||
| @@ -704,8 +708,10 @@ a previously found match." | |||
| 704 | (goto-char rstart)) | 708 | (goto-char rstart)) |
| 705 | (let ((count 0) | 709 | (let ((count 0) |
| 706 | opoint | 710 | opoint |
| 707 | (case-fold-search (and case-fold-search | 711 | (case-fold-search |
| 708 | (isearch-no-upper-case-p regexp t)))) | 712 | (if (and case-fold-search search-upper-case) |
| 713 | (isearch-no-upper-case-p regexp t) | ||
| 714 | case-fold-search))) | ||
| 709 | (while (and (< (point) rend) | 715 | (while (and (< (point) rend) |
| 710 | (progn (setq opoint (point)) | 716 | (progn (setq opoint (point)) |
| 711 | (re-search-forward regexp rend t))) | 717 | (re-search-forward regexp rend t))) |
| @@ -1030,8 +1036,8 @@ The lines are shown in a buffer named `*Occur*'. | |||
| 1030 | It serves as a menu to find any of the occurrences in this buffer. | 1036 | It serves as a menu to find any of the occurrences in this buffer. |
| 1031 | \\<occur-mode-map>\\[describe-mode] in that buffer will explain how. | 1037 | \\<occur-mode-map>\\[describe-mode] in that buffer will explain how. |
| 1032 | 1038 | ||
| 1033 | If REGEXP contains upper case characters (excluding those preceded by `\\'), | 1039 | If REGEXP contains upper case characters (excluding those preceded by `\\') |
| 1034 | the matching is case-sensitive." | 1040 | and `search-upper-case' is non-nil, the matching is case-sensitive." |
| 1035 | (interactive (occur-read-primary-args)) | 1041 | (interactive (occur-read-primary-args)) |
| 1036 | (occur-1 regexp nlines (list (current-buffer)))) | 1042 | (occur-1 regexp nlines (list (current-buffer)))) |
| 1037 | 1043 | ||
| @@ -1119,8 +1125,9 @@ See also `multi-occur'." | |||
| 1119 | (let ((count (occur-engine | 1125 | (let ((count (occur-engine |
| 1120 | regexp active-bufs occur-buf | 1126 | regexp active-bufs occur-buf |
| 1121 | (or nlines list-matching-lines-default-context-lines) | 1127 | (or nlines list-matching-lines-default-context-lines) |
| 1122 | (and case-fold-search | 1128 | (if (and case-fold-search search-upper-case) |
| 1123 | (isearch-no-upper-case-p regexp t)) | 1129 | (isearch-no-upper-case-p regexp t) |
| 1130 | case-fold-search) | ||
| 1124 | list-matching-lines-buffer-name-face | 1131 | list-matching-lines-buffer-name-face |
| 1125 | nil list-matching-lines-face | 1132 | nil list-matching-lines-face |
| 1126 | (not (eq occur-excluded-properties t))))) | 1133 | (not (eq occur-excluded-properties t))))) |
| @@ -1459,8 +1466,9 @@ make, or the user didn't cancel the call." | |||
| 1459 | (and query-flag minibuffer-auto-raise | 1466 | (and query-flag minibuffer-auto-raise |
| 1460 | (raise-frame (window-frame (minibuffer-window)))) | 1467 | (raise-frame (window-frame (minibuffer-window)))) |
| 1461 | (let* ((case-fold-search | 1468 | (let* ((case-fold-search |
| 1462 | (and case-fold-search | 1469 | (if (and case-fold-search search-upper-case) |
| 1463 | (isearch-no-upper-case-p from-string regexp-flag))) | 1470 | (isearch-no-upper-case-p from-string regexp-flag) |
| 1471 | case-fold-search)) | ||
| 1464 | (nocasify (not (and case-replace case-fold-search))) | 1472 | (nocasify (not (and case-replace case-fold-search))) |
| 1465 | (literal (or (not regexp-flag) (eq regexp-flag 'literal))) | 1473 | (literal (or (not regexp-flag) (eq regexp-flag 'literal))) |
| 1466 | (search-function (if regexp-flag 're-search-forward 'search-forward)) | 1474 | (search-function (if regexp-flag 're-search-forward 'search-forward)) |