From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel Subject: Re: Calling occur from within isearch Date: Wed, 05 Dec 2007 00:59:12 +0100 Message-ID: References: <47448DB2.60402@gmail.com> <87hcjf2wot.fsf@jurta.org> <871wairv6n.fsf@jurta.org> <871waf7ikx.fsf@jurta.org> <878x4bgv86.fsf@jurta.org> <87zlwq3wtw.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1196812798 28494 80.91.229.12 (4 Dec 2007 23:59:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Dec 2007 23:59:58 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 05 01:00:06 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 1IzhgL-0003Xs-J6 for ged-emacs-devel@m.gmane.org; Wed, 05 Dec 2007 01:00:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Izhg5-0001OQ-4Q for ged-emacs-devel@m.gmane.org; Tue, 04 Dec 2007 18:59:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Izhg0-0001Ln-Un for emacs-devel@gnu.org; Tue, 04 Dec 2007 18:59:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Izhg0-0001Jt-5f for emacs-devel@gnu.org; Tue, 04 Dec 2007 18:59:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Izhfz-0001Jd-Tu for emacs-devel@gnu.org; Tue, 04 Dec 2007 18:59:43 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Izhfz-00029Z-BT for emacs-devel@gnu.org; Tue, 04 Dec 2007 18:59:43 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Izhfg-0007Gs-Qj for emacs-devel@gnu.org; Tue, 04 Dec 2007 23:59:24 +0000 Original-Received: from remote1.student.chalmers.se ([129.16.29.79]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Dec 2007 23:59:24 +0000 Original-Received: from bojohan+news by remote1.student.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Dec 2007 23:59:24 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 52 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: remote1.student.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:nn1m47DkztKtKThIvl4QNyijVrw= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:84687 Archived-At: Juri Linkov writes: >>> saying that the distinction between `yes' and `t' is valid for some >>> searching interactive commands. >> >> I can't see how this distinction is at all useful for the user. >> `search-uppercase' already provides a (the) way to decide whether "mixed >> case in the search string [should be] ignored": >> >> (if (and case-fold-search search-upper-case) >> (isearch-no-upper-case-p regexp t) >> case-fold-search) > > I can't comment why isearch functions use `(eq case-fold-search t)', > but I think other interactive search-related commands like occur > should use the same condition, whatever it is. Note that the preceding line is (let ((case-fold-search isearch-case-fold-search)) and that there are two other places in isearch that use (and (eq isearch-case-fold-search t) search-upper-case) Isearch needs the third value `yes' to handle the M-c feature (see isearch-toggle-case-fold) C-s ABC M-c => search is now case-insensitive, despite uppercase input This is the only situation where `yes' is used; case-fold-search never has this value outside isearch. Other search functions have no use for this. >> In the case of occur from within isearch, the current value of >> isearch-case-fold-search will make searching find the right matches--if >> occur does *not* look at the case of the input again >> >> (let ((case-fold-search isearch-case-fold-search) >> (search-upper-case nil)) >> (occur regexp nlines)) > > What code in occur for this case do you have in mind? isearch-occur should do this. Isearch has already decided if the search should be case-sensitive or not, so occur should not consider input case. -- Johan Bockgård