From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout.scc.kit.edu (scc-mailout.scc.kit.edu [129.13.185.202]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id pAT11PFW009500 for ; Mon, 28 Nov 2011 20:01:25 -0500 (EST) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by scc-mailout-02.scc.kit.edu with esmtp (Exim 4.72 #1) id 1RVC4Z-0005Kh-Q3; Tue, 29 Nov 2011 02:01:23 +0100 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RVC4Z-00081G-Ql for tech@mdocml.bsd.lv; Tue, 29 Nov 2011 02:01:23 +0100 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.72) (envelope-from ) id 1RVC4Z-0001JH-PZ for tech@mdocml.bsd.lv; Tue, 29 Nov 2011 02:01:23 +0100 Received: from schwarze by usta.de with local (Exim 4.72) (envelope-from ) id 1RVC4Z-0003Qv-H6 for tech@mdocml.bsd.lv; Tue, 29 Nov 2011 02:01:23 +0100 Date: Tue, 29 Nov 2011 02:01:23 +0100 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: Showing all possible apropls keys. Message-ID: <20111129010123.GC7216@iris.usta.de> References: <4ECA86C8.1030100@bsd.lv> <20111121223702.GA22285@iris.usta.de> <4ECB6446.4090201@bsd.lv> <20111126122125.GD13912@iris.usta.de> <4ED3F11A.6080201@bsd.lv> <20111128235940.GA7216@iris.usta.de> <4ED428AE.4000904@bsd.lv> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ED428AE.4000904@bsd.lv> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Kristaps, Kristaps Dzonsons wrote on Tue, Nov 29, 2011 at 01:34:54AM +0100: >>> parses terms as case-sensitive regular expressions >>> .Pq the Li \&~ operator >> While here, you could fix that statement. >> The default is exactly the opposite: >> Case-insensitive substrings. > I'm merging your other comments, but this gives me pause. The `-i' > flips on case insensitivity: following exprcomp() into exprterm(), > the "cs" (case-sensitive) field is 1 by default (or 0 if `-i' is > specified). Then in exprmark(), "cs" is acted upon with strstr() if > 1, strcasestr() if 0. This behaviour may have changed from the > original version, so let's nip it if that's so. Hum. Indeed, "apropos.m -- -i mAnDoC" gives me results, but "propos.m mAnDoC" doesn't. Strange, i thought it did. > However, the current behaviour seems consistent to me: if we want > "-i" to mean case-insensitive, it should mean that for the following > term, whether `~' or `=', with the opposite (sensitivity) being the > default. No? Yes, that would seem more consistent on first sight. > It seems confusing to have an `-i' but have `=' be insensitive. Well, in general, simplicity is key, and in apropos(1) in particular. Most of the time, you will type apropos something and without much doubt, you hope to find both the legacy something.pm Perl module and the object orient Foo::SomeThing. Nobody will remember to type apropos -- -i something and people will yell at us for not finding manuals any more and for changing established behaviour: apropos(1) has always been case-insensitive. So we can't change that for reasons of both tradition and simplicity. But we are free regarding regular expressions, and people are used to the fact that regular expressions are case sensitive by default. Besides, when you choose REs, you want power, and case sensitive ones are more powerful than case-insensitive ones, so again, case-sensitive should be the default. Having = always case insensitive and ~ case sensitive by default is asymmetric, but i think it's still better than having REs case-insensitive by default and inventing a *very* non-standard and thus even more confusion option for "case sensitive". And changing the default for plain old apropos(1) to case-sensitive looks completely impractical. Sure, that means we won't have case-sensitive substring matching at all. But that's no problem. It ididn't exist in the past either, it will be needed rarely and it can easily be expressed by regular expressions. So we just have to fix the code and change the documentation to read: = case-insensitive substring match ~ case-sensitive regular expressions -i make the following RE case-insensitive Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv