unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Carl Worth <cworth@cworth.org>
To: Jed Brown <jed@59A2.org>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH 1/2] New function notmuch-search-operate-all: operate on all messages in the current query.
Date: Fri, 27 Nov 2009 21:48:33 -0800	[thread overview]
Message-ID: <877htbtd1q.fsf@yoom.home.cworth.org> (raw)
In-Reply-To: <87skc0domr.fsf@59A2.org>

[-- Attachment #1: Type: text/plain, Size: 1904 bytes --]

On Fri, 27 Nov 2009 15:32:44 +0100, Jed Brown <jed@59A2.org> wrote:
> On Fri, 27 Nov 2009 06:02:45 -0800, Carl Worth <cworth@cworth.org> wrote:
> > Since this operates via a single call to "notmuch tag" you might mention
> > here that all tag removals occur before any tag additions.
> 
> I was unaware of this point, if I do
> 
>   notmuch tag -inbox +star tag:inbox some-expression
> 
> I will have starred nothing?

Oh no, it's not that.

It does one search and then does a single pass over all the messages
returned. So the above will star things.

The clarification about removing and adding really only matters if you
have the same tag appearing as both -foo and +foo in the same command
line, (which doesn't seem that useful, but there you have it).

I don't recall now why I made the special effort to handle tag removal
before tag addition rather than just applying tag changes in order. But
since that's what the current "notmuch tag" code does, I thought I
should point it out.

> > > +	(unless (string-match-p "^[\+\-][_\+\-\\w]+$" (car words))
> > > +	  (error "Action must be of the form `+thistag -that_tag'"))
> > 
> > The error message has inconsistent "thistag" and "that_tag".
> 
> That was somewhat intentional to illustrate that non-alphanumeric
> characters could be used in tags.  Should the alphabet for tags be based
> on a whitelist or blacklist?  It would be rather hard to validate a tag
> operation when there is no assumption/restriction on the alphabet.

Yeah, that's something we need to document. The current interface does
use space-separated tag lists without any escaping. But the command line
doesn't yet impose any restriction on tag names, and I did accidentally
add a tag once of just " " (oops!).

We should nail this down so that interface authors can know how to
validate things consistently. Any suggestions?

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2009-11-28  5:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-22 20:12 [PATCH] New function notmuch-search-operate-all: operate on all messages in the current query Jed Brown
2009-11-23  4:14 ` Carl Worth
2009-11-23 13:07   ` Jed Brown
2009-11-26 21:00     ` Carl Worth
2009-11-26 21:36       ` [PATCH 1/2] " Jed Brown
2009-11-26 21:36         ` [PATCH 2/2] notmuch-search-add/remove-tag: restrict to messages in " Jed Brown
2009-11-27 14:02         ` [PATCH 1/2] New function notmuch-search-operate-all: operate on all messages in the " Carl Worth
2009-11-27 14:32           ` Jed Brown
2009-11-28  5:48             ` Carl Worth [this message]
2009-11-28 19:51           ` [PATCH] More portable and easier to read regex in notmuch-search-operate-all Jed Brown
2009-11-28 19:58             ` Keith Packard
2009-11-28 20:01               ` Carl Worth

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://notmuchmail.org/

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

  git send-email \
    --in-reply-to=877htbtd1q.fsf@yoom.home.cworth.org \
    --to=cworth@cworth.org \
    --cc=jed@59A2.org \
    --cc=notmuch@notmuchmail.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://yhetil.org/notmuch.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).