From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alain.Cochard@unistra.fr Subject: Re: How to use case sensitive org-search-view? Date: Wed, 15 Nov 2017 11:49:28 +0100 Message-ID: <23052.7096.615405.647000@frac.u-strasbg.fr> References: <22975.53875.671661.416361@frac.u-strasbg.fr> <874lrzl1gr.fsf@fastmail.fm> <87lgl963jf.fsf@nicolasgoaziou.fr> <22986.5564.583945.909910@frac.u-strasbg.fr> <877ewl4u8s.fsf@nicolasgoaziou.fr> <22986.19586.309718.302611@frac.u-strasbg.fr> <87h8vmopww.fsf@nicolasgoaziou.fr> <22989.25593.198323.807112@frac.u-strasbg.fr> <87k20imrzb.fsf@nicolasgoaziou.fr> <22997.60031.814843.407658@frac.u-strasbg.fr> <23045.57473.573321.290325@frac.u-strasbg.fr> <87efp1vsuq.fsf@fastmail.fm> <87shdgzjhx.fsf@nicolasgoaziou.fr> Reply-To: alain.cochard@unistra.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEvHO-0007s4-Fv for emacs-orgmode@gnu.org; Wed, 15 Nov 2017 05:50:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEvHJ-0005UE-H5 for emacs-orgmode@gnu.org; Wed, 15 Nov 2017 05:50:50 -0500 Received: from smr1.u-strasbg.fr ([130.79.222.217]:53576 helo=mailhost.u-strasbg.fr) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eEvHJ-0005Sp-5Y for emacs-orgmode@gnu.org; Wed, 15 Nov 2017 05:50:45 -0500 In-Reply-To: <87shdgzjhx.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org, Alain.Cochard@unistra.fr Nicolas Goaziou writes on Tue 14 Nov 2017 21:35: > Matt Lundin writes: >=20 > > Alain.Cochard@unistra.fr writes: > >> Suppose I have an org file with > >> > >> * FOO > >> * foo > >> > >> I would like to use org-search-view (C-c a s) so as to (say) list= > >> only the first entry. > >> [...] > >> Is there a way to perform what I want=3F > > Unfortunately, it looks like org-search-view is hard-coded to be > > case-insensitive. I think a very hackish workaround would be to ad= vise > > org-search-view to create and then remove an "around" advice that > > wraps re-search-forward in a "let" declaration setting > > case-fold-search to nil. But this would be a fairly horrific hack.= > > > > In the long run, I believe the Org Mode code would need to be chan= ged > > to make this customizable. > Note that there is `org-occur-case-fold-search'. Thanks for pointing this out. But boy is it complicated: I have: org-occur-case-fold-search is a variable defined in `org.el'. Its value is t Documentation: Non-nil means `org-occur' should be case-insensitive. If set to `smart' the search will be case-insensitive only if it doesn't specify any upper case character. and indeed, if I use M-x org-occur FOO in my FOO/foo buffer, both instances are found. But it does not seem to apply to multi-occur, which 'C-c a /' is said to use: both 'C-c a /' and 'M-x multi-occur' for 'FOO' only list 'FOO'... > We could implement something similar with, e.g., > `org-agenda-search-view-case-fold-search'. Or maybe use a variable f= or > every search related function in Org: `org-case-fold-search'. >=20 > WDYT=3F >From my (user) point of view, I would expect that what is supposed to be a regexp behaves like a regexp, and in a consistent way for all cases (with 'C-c a s', when filtering with org-agenda-filter-by-regexp, etc.). I would even expect a regexp search within an Org buffer to behave exactly like a regexp search within a plain emacs buffer, but I would understand if this not reasonable to ask for. Regards, a. PS: in the org-occur docstring: org-occur is an interactive compiled Lisp function in `org.el'. (org-occur REGEXP &optional KEEP-PREVIOUS CALLBACK) Make a compact tree which shows all matches of REGEXP. The tree will show the lines where the regexp matches, and any other context defined in `org-show-context-detail', which see. the last sentence above looks grammatically/syntactically funny to me. Maybe this is because of my insufficient level in English -- I just don't understand what "which see" is supposed to mean. If the English is indeed correct, maybe a reformulation would be in order, for the sake of non native people. --=20 EOST (=C9cole et Observatoire des Sciences de la Terre)=20 IPG (Institut de Physique du Globe) | alain.cochard@unistra.fr 5 rue Ren=E9 Descartes [bureau 106] | Phone: +33 (0)3 68 85 50 44=20 F-67084 Strasbourg Cedex, France | Fax: +33 (0)3 68 85 01 25 =20=