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: Nicolas Goaziou
Subject: Re: [O] How to use case sensitive org-search-view?
Date: Wed, 15 Nov 2017 12:55:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

address@hidden writes:

> Thanks for pointing this out.  But boy is it complicated:

It is not. It follows regular isearch in Emacs. Quoting Emacs manual:

       An upper-case letter anywhere in the search string makes the search
    case-sensitive.  Thus, searching for ‘Foo’ does not find ‘foo’ or ‘FOO’.
    This applies to regular expression search as well as to literal string
    search.  The effect ceases if you delete the upper-case letter from the
    search string.  The variable ‘search-upper-case’ controls this: if it is
    non-‘nil’ (the default), an upper-case character in the search string
    make the search case-sensitive; setting it to ‘nil’ disables this effect
    of upper-case characters.

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

Then it is an issues in Emacs, not in Org specifically. Indeed,
multi-occur's docstrings is

    Show all lines in buffers BUFS containing a match for REGEXP.
    This function acts on multiple buffers; otherwise, it is exactly like
    ‘occur’.

and occur's is

    If REGEXP contains upper case characters (excluding those preceded by ‘\’)
    and ‘search-upper-case’ is non-nil, the matching is case-sensitive.

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

This is why `org-occur-case-fold-search' is a defcustom. If you set it
to nil, your search obeys to your regexp.

> PS: in the org-occur docstring:

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

This is an Emacs idiom. You find it here and there in its manual and
some docstrings. See
<https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-10/msg00518.html>
for a related discussion in another package.

Regards,

-- 
Nicolas Goaziou



reply via email to

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