From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Calling occur from within isearch Date: Mon, 03 Dec 2007 02:37:55 +0200 Organization: JURTA Message-ID: <87r6i4k4at.fsf@jurta.org> References: <47448DB2.60402@gmail.com> <87hcjf2wot.fsf@jurta.org> <871wairv6n.fsf@jurta.org> <871waf7ikx.fsf@jurta.org> <87myt2e4yi.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196642570 12930 80.91.229.12 (3 Dec 2007 00:42:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Dec 2007 00:42:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 03 01:42:58 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IyzOY-0004vF-Pn for ged-emacs-devel@m.gmane.org; Mon, 03 Dec 2007 01:42:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyzOI-0003vP-E7 for ged-emacs-devel@m.gmane.org; Sun, 02 Dec 2007 19:42:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IyzN6-0002gh-II for emacs-devel@gnu.org; Sun, 02 Dec 2007 19:41:16 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IyzN4-0002fj-Vw for emacs-devel@gnu.org; Sun, 02 Dec 2007 19:41:15 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyzN4-0002fa-ON for emacs-devel@gnu.org; Sun, 02 Dec 2007 19:41:14 -0500 Original-Received: from relay02.kiev.sovam.com ([62.64.120.197]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IyzMy-0007zU-Oa; Sun, 02 Dec 2007 19:41:09 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1IyzMu-0004fY-IM; Mon, 03 Dec 2007 02:41:07 +0200 In-Reply-To: <87myt2e4yi.fsf@jurta.org> (Juri Linkov's message of "Sun, 25 Nov 2007 17:27:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-Scanner-Signature: 923424fb7c1f6269ed8306da1747a39a X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 1838 [Dec 01 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 19 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.8-5.1 (or MacOS X 10.2-10.3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84520 Archived-At: >> 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/