emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to use case sensitive org-search-view?


From: Alain . Cochard
Subject: Re: [O] How to use case sensitive org-search-view?
Date: Wed, 15 Nov 2017 11:49:28 +0100

Nicolas Goaziou writes on Tue 14 Nov 2017 21:35:

 > Matt Lundin <address@hidden> writes:
 > 
 > > address@hidden 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?

 > > Unfortunately, it looks like org-search-view is hard-coded to be
 > > case-insensitive. I think a very hackish workaround would be to advise
 > > 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 changed
 > > 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 <RET> 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 for
 > every search related function in Org: `org-case-fold-search'.
 > 
 > WDYT?

>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.






-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | address@hidden
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France    | Fax:   +33 (0)3 68 85 01 25     



reply via email to

[Prev in Thread] Current Thread [Next in Thread]