[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Calling occur from within isearch
From: |
Juri Linkov |
Subject: |
Re: Calling occur from within isearch |
Date: |
Mon, 03 Dec 2007 02:37:55 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) |
>> Since occur uses `isearch-no-upper-case-p' it seems reasonable for it
>> to respect the value of `search-upper-case' as well.
>>
>> That seems to make sense, but what does `isearch-occur' have
>> to do with it?
>
> `isearch-occur' calls `occur', and occur needs to find exactly the
> same occurrences as found by isearch. Otherwise, it would be very
> confusing to see the mismatch between the occurrences found by isearch
> and occur.
I think `keep-lines', `flush-lines', `how-many' and `perform-replace'
should respect the value of `search-upper-case' as well for exactly
the same reasons:
Index: lisp/replace.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/replace.el,v
retrieving revision 1.263
diff -c -r1.263 replace.el
*** lisp/replace.el 22 Nov 2007 03:01:36 -0000 1.263
--- lisp/replace.el 3 Dec 2007 00:37:19 -0000
***************
*** 597,604 ****
(save-excursion
(or (bolp) (forward-line 1))
(let ((start (point))
! (case-fold-search (and case-fold-search
! (isearch-no-upper-case-p regexp t))))
(while (< (point) rend)
;; Start is first char not preserved by previous match.
(if (not (re-search-forward regexp rend 'move))
--- 597,606 ----
(save-excursion
(or (bolp) (forward-line 1))
(let ((start (point))
! (case-fold-search
! (if (and (eq case-fold-search t) search-upper-case)
! (isearch-no-upper-case-p regexp t)
! case-fold-search)))
(while (< (point) rend)
;; Start is first char not preserved by previous match.
(if (not (re-search-forward regexp rend 'move))
***************
*** 657,664 ****
(setq rstart (point)
rend (point-max-marker)))
(goto-char rstart))
! (let ((case-fold-search (and case-fold-search
! (isearch-no-upper-case-p regexp t))))
(save-excursion
(while (and (< (point) rend)
(re-search-forward regexp rend t))
--- 659,668 ----
(setq rstart (point)
rend (point-max-marker)))
(goto-char rstart))
! (let ((case-fold-search
! (if (and (eq case-fold-search t) search-upper-case)
! (isearch-no-upper-case-p regexp t)
! case-fold-search)))
(save-excursion
(while (and (< (point) rend)
(re-search-forward regexp rend t))
***************
*** 704,711 ****
(goto-char rstart))
(let ((count 0)
opoint
! (case-fold-search (and case-fold-search
! (isearch-no-upper-case-p regexp t))))
(while (and (< (point) rend)
(progn (setq opoint (point))
(re-search-forward regexp rend t)))
--- 708,717 ----
(goto-char rstart))
(let ((count 0)
opoint
! (case-fold-search
! (if (and (eq case-fold-search t) search-upper-case)
! (isearch-no-upper-case-p regexp t)
! case-fold-search)))
(while (and (< (point) rend)
(progn (setq opoint (point))
(re-search-forward regexp rend t)))
***************
*** 1119,1126 ****
(let ((count (occur-engine
regexp active-bufs occur-buf
(or nlines list-matching-lines-default-context-lines)
! (and case-fold-search
! (isearch-no-upper-case-p regexp t))
list-matching-lines-buffer-name-face
nil list-matching-lines-face
(not (eq occur-excluded-properties t)))))
--- 1131,1139 ----
(let ((count (occur-engine
regexp active-bufs occur-buf
(or nlines list-matching-lines-default-context-lines)
! (if (and (eq case-fold-search t) search-upper-case)
! (isearch-no-upper-case-p regexp t)
! case-fold-search)
list-matching-lines-buffer-name-face
nil list-matching-lines-face
(not (eq occur-excluded-properties t)))))
***************
*** 1459,1466 ****
(and query-flag minibuffer-auto-raise
(raise-frame (window-frame (minibuffer-window))))
(let* ((case-fold-search
! (and case-fold-search
! (isearch-no-upper-case-p from-string regexp-flag)))
(nocasify (not (and case-replace case-fold-search)))
(literal (or (not regexp-flag) (eq regexp-flag 'literal)))
(search-function (if regexp-flag 're-search-forward 'search-forward))
--- 1472,1480 ----
(and query-flag minibuffer-auto-raise
(raise-frame (window-frame (minibuffer-window))))
(let* ((case-fold-search
! (if (and (eq case-fold-search t) search-upper-case)
! (isearch-no-upper-case-p from-string regexp-flag)
! case-fold-search))
(nocasify (not (and case-replace case-fold-search)))
(literal (or (not regexp-flag) (eq regexp-flag 'literal)))
(search-function (if regexp-flag 're-search-forward 'search-forward))
--
Juri Linkov
http://www.jurta.org/emacs/