aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2007-12-09 23:47:04 +0000
committerJuri Linkov2007-12-09 23:47:04 +0000
commit3be42fcdfbb97a7fb33a9c1394e86245e9867bc5 (patch)
tree03d28f7050b05549487132a734e649fb0d1e0acc
parent522bec736968730e9cf3e75b54a1c8ca7912c30a (diff)
downloademacs-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.el44
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.
552When called from Lisp (and usually interactively as well, see below) 552When called from Lisp (and usually interactively as well, see below)
553applies to all lines starting after point. 553applies to all lines starting after point.
554 554
555If REGEXP contains upper case characters (excluding those preceded by `\\'), 555If REGEXP contains upper case characters (excluding those preceded by `\\')
556the matching is case-sensitive. 556and `search-upper-case' is non-nil, the matching is case-sensitive.
557 557
558Second and third arg RSTART and REND specify the region to operate on. 558Second and third arg RSTART and REND specify the region to operate on.
559This command operates on (the accessible part of) all lines whose 559This 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.
626The line point is in is deleted if and only if it contains a 628The line point is in is deleted if and only if it contains a
627match for regexp starting after point. 629match for regexp starting after point.
628 630
629If REGEXP contains upper case characters (excluding those preceded by `\\'), 631If REGEXP contains upper case characters (excluding those preceded by `\\')
630the matching is case-sensitive. 632and `search-upper-case' is non-nil, the matching is case-sensitive.
631 633
632Second and third arg RSTART and REND specify the region to operate on. 634Second and third arg RSTART and REND specify the region to operate on.
633Lines partially contained in this region are deleted if and only if 635Lines 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
676the number, do not print it; if INTERACTIVE is t, the function behaves 680the number, do not print it; if INTERACTIVE is t, the function behaves
677in all respects has if it had been called interactively. 681in all respects has if it had been called interactively.
678 682
679If REGEXP contains upper case characters (excluding those preceded by `\\'), 683If REGEXP contains upper case characters (excluding those preceded by `\\')
680the matching is case-sensitive. 684and `search-upper-case' is non-nil, the matching is case-sensitive.
681 685
682Second and third arg RSTART and REND specify the region to operate on. 686Second 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*'.
1030It serves as a menu to find any of the occurrences in this buffer. 1036It 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
1033If REGEXP contains upper case characters (excluding those preceded by `\\'), 1039If REGEXP contains upper case characters (excluding those preceded by `\\')
1034the matching is case-sensitive." 1040and `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))