emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Lundin <mdl@imapmail.org>
To: Matt Lundin <mdl@imapmail.org>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Boolean word/regexp search problem
Date: Fri, 27 Nov 2009 12:37:56 -0500	[thread overview]
Message-ID: <m2hbsfuavf.fsf@fastmail.fm> (raw)
In-Reply-To: <m2ljhrubrf.fsf@fastmail.fm> (Matt Lundin's message of "Fri, 27 Nov 2009 12:18:44 -0500")

Matt Lundin <mdl@imapmail.org> writes:

> The word/regexp agenda search to work with more than one word or regexp
> unless the first word or regexp is also preceded by a "+" or "-".
>
> Take the following example.
>
> * Org-mode
>
> Org mode is a major mode for Emacs written by Carsten Dominik.
>
> Let's say I search for Emacs with "C-a s [RET] Emacs". So far, so good:
> this item appears in the results. But let's say I want to narrow down
> the search. When I press "[" to add a search term, I see the following
> prompt in the minibuffer:
>
> [+-]Word/{Regexp} ...: Emacs +
>
> If I complete the prompt as given ("Emacs +Carsten"), there are no
> results.
>
> The search only succeeds if I add a "+" in front of Emacs as well, i.e.,
> "+Emacs +Carsten". 
>
> The same behavior occurs with exclusion ("-") and with the regexp
> search (i.e., brackets).
>
> Two questions:
>
> 1) Do boolean word/regexp searches require a "+" or "-" symbol before
> the first word/regexp? If so, this is a bit confusing, since tag and
> property searches do not require an initial symbol. (E.g.,
> "emacs+orgmode" works as a tag search.)
>
> 2) If boolean word/regexp do require an initial "+" or "-", could the
> prompt after pressing "[" or "]" or "{" or "}" in the search results
> buffer be amended to add a plus in front of the first search term?
>
> Here is the relevant portion of the manual:
>
> ,----[10.5 Commands in the agenda buffer]
> | `[ ] { }'
> | 
> |     in search view
> |           add new search words (`[' and `]') or new regular expressions
> |           (`{' and `}') to the query string.  The opening bracket/brace
> |           will add a positive search term prefixed by `+', indicating
> |           that this search term must occur/match in the entry.  The
> |           closing bracket/brace will add a negative search term which
> |           must not occur/match in the entry for it to be selected.
> `----

O.K., I just found the variable org-agenda-search-view-search-words-only:

,----
| Non-nil means, the search string is interpreted as individual words
| The search then looks for each word separately in each entry and
| selects entries that have matches for all words.
| When nil, matching as loose words will only take place if the first
| word is preceded by + or -.  If that is not the case, the search
| string will just be matched as a substring in the entry, but with
| each space character allowing for any whitespace, including newlines.
`----

Please disregard question one above, at least insofar as it applies to
word searches (I'm still trying to work out the regexps). But re:
question two, would it be worthwhile to add a "+" to the beginning of
the search org-agenda-manipulate-query is invoked in a search agenda
buffer?

Thanks,
Matt

  reply	other threads:[~2009-11-27 17:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-27 17:18 Boolean word/regexp search problem Matt Lundin
2009-11-27 17:37 ` Matthew Lundin [this message]
2009-11-27 19:54   ` Matt Lundin
2010-01-05 11:17     ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2hbsfuavf.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).