Re: [PATCH v2] emacs: Turn id:"<message-id>" elements into buttons for notmuch searches

Subject: Re: [PATCH v2] emacs: Turn id:"<message-id>" elements into buttons for notmuch searches

Date: Mon, 17 Oct 2011 15:11:47 +0200

To: Daniel Schoepe

Cc: notmuch@notmuchmail.org

From: Thomas Schwinge


Hi!

On Mon, 17 Oct 2011 14:13:05 +0200, Daniel Schoepe <daniel.schoepe@googlemail.com> wrote:
> On Mon, 17 Oct 2011 11:16:45 +0200, Thomas Schwinge <thomas@schwinge.name> wrote:
> > Is it permissible for message IDs to contain double quotes?  If not (and
> > I hope so), might id:\"[^\"]+\" be a better regexp?  (Untested.)  As it
> > appears to me, this would allow proper matching in text like this, too:
> > 
> >     Bla bla, see id:"some@thing".  Bla bla.
> 
> My patch already works for this example, and I don't think spaces are
> allowed in message IDs, so it shouldn't make a difference.

Ah, of course, right...  Yet, won't yours -- id:\"[^ ]+\" -- match too
much in this example:

    Bla, bla, see id:"some@thing"--"some famous quote" is bla.

How about this one?  id:\(\"?\)[^[:space:]"]+\1

Test:

  id:some@thing "something"
  id:"some@thing"--"something"
  id:"some@thing"--something
  id:some@thing "something else"
  id:"some@thing"--"something else"
  id:"some@thing"--something else
  id:some@thing
  id:"some@thing"


Grüße,
 Thomas
part-000.sig (application/pgp-signature)

Thread: