search summary and exclusions

2012-05-29 Thread Jameson Graef Rollins
On Tue, May 29 2012, Peter Wang  wrote:
> --output=summary is the default.  --format=json only changes the
> surface syntax.

I'm sorry.  For some reason this whole time I was thinking --format=text
when you were saying --output=summary.  My bad.

> Understood; it's a two-phase process, and I wasn't making the
> distinction.  If it is the expected and useful behaviour, so be it.
>
> Maybe there is room for another keyword under --exclude?

Maybe.  As always, patches welcome!

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20120529/fcbc56c3/attachment.pgp>


search summary and exclusions

2012-05-29 Thread Peter Wang
On Mon, 28 May 2012 10:03:35 -0700, Jameson Graef Rollins  wrote:
> On Mon, May 28 2012, Peter Wang  wrote:
> > Exclusions don't work the way I expected with the search command and
> > --output=summary.  I would like messages with excluded tags to be
> > treated as if they don't exist at all, but currently:
> >
> >   * excluded messages are counted towards the "total"
> >   * excluded tags are included in the "tags" set
> >
> > Are these deliberate?  Especially the second point seems to conflict
> > with search --output=tags, which doesn't show excluded tags.
> 
> Hi, Peter.  Can you explain more what you mean?  I'm not sure what your
> two bullets have to do with --output=summary.  Messages are counted with
> the count subcommand, and tags are shown with search --output=tags,
> neither of which have anything to do with --output=summary, and both of
> which accept the exclude flag:
> 
> notmuch count --exclude=true '*'
> notmuch search --output=tags --exclude=true '*'
> 
> Maybe you can give a clearer explanation of what your issue is.
> Examples help.

Sure.  I keep draft messages in the mail store, and tag them with
'draft', and later 'deleted'.  I would like the exclusions to treat
draft and deleted messages as if they didn't exist in the store.

% ./notmuch search --format=json --exclude=true -- thread:9598 
tag:unread
[{"thread": "9598",
"timestamp": 1338231998,
"date_relative": "Today 05:06",
"matched": 1,
"total": 15,
"authors": "Mark Walters| Peter Wang",
"subject": "[PATCH v6 3/6] cli: make --entire-thread=false work for 
format=json.",
"tags": ["deleted", "draft", "replied", "sent", "unread"]}]

Here is a thread I participated in.  From this, my MUA displays "1/15",
suggesting that there is 1 unread message out of a total of 15.  But
upon opening the thread, there are only 11 messages visible: 4 were
drafts (possibly deleted) which have been excluded.  To the user, it
looks like some messages went missing.

Therefore I would like search --output=summary --exclude=true
to report the total number of non-excluded messages.  It doesn't need to
be via the "total" field; a new field would be fine.

Peter


search summary and exclusions

2012-05-29 Thread Mark Walters

Hi
On Tue, 29 May 2012, Peter Wang  wrote:
> On Mon, 28 May 2012 10:03:35 -0700, Jameson Graef Rollins  finestructure.net> wrote:
>> On Mon, May 28 2012, Peter Wang  wrote:
>> > Exclusions don't work the way I expected with the search command and
>> > --output=summary.  I would like messages with excluded tags to be
>> > treated as if they don't exist at all, but currently:
>> >
>> >   * excluded messages are counted towards the "total"
>> >   * excluded tags are included in the "tags" set
>> >
>> > Are these deliberate?  Especially the second point seems to conflict
>> > with search --output=tags, which doesn't show excluded tags.
>> 
>> Hi, Peter.  Can you explain more what you mean?  I'm not sure what your
>> two bullets have to do with --output=summary.  Messages are counted with
>> the count subcommand, and tags are shown with search --output=tags,
>> neither of which have anything to do with --output=summary, and both of
>> which accept the exclude flag:
>> 
>> notmuch count --exclude=true '*'
>> notmuch search --output=tags --exclude=true '*'
>> 
>> Maybe you can give a clearer explanation of what your issue is.
>> Examples help.
>
> Sure.  I keep draft messages in the mail store, and tag them with
> 'draft', and later 'deleted'.  I would like the exclusions to treat
> draft and deleted messages as if they didn't exist in the store.
>
> % ./notmuch search --format=json --exclude=true -- thread:9598 
> tag:unread
> [{"thread": "9598",
> "timestamp": 1338231998,
> "date_relative": "Today 05:06",
> "matched": 1,
> "total": 15,
> "authors": "Mark Walters| Peter Wang",
> "subject": "[PATCH v6 3/6] cli: make --entire-thread=false work for 
> format=json.",
> "tags": ["deleted", "draft", "replied", "sent", "unread"]}]
>
> Here is a thread I participated in.  From this, my MUA displays "1/15",
> suggesting that there is 1 unread message out of a total of 15.  But
> upon opening the thread, there are only 11 messages visible: 4 were
> drafts (possibly deleted) which have been excluded.  To the user, it
> looks like some messages went missing.
>
> Therefore I would like search --output=summary --exclude=true
> to report the total number of non-excluded messages.  It doesn't need to
> be via the "total" field; a new field would be fine.

It is easy to add this to the JSON format but adding it to the text
format would probably break things, and I would prefer not to have the
formats diverge.

Does anyone have any suggestions? Would people happy with a change in the
text summary output?

Best wishes

Mark


notmuch release 0.13.1 now available

2012-05-29 Thread David Bremner
Where to obtain notmuch 0.13.1
===
  http://notmuchmail.org/releases/notmuch-0.13.1.tar.gz

Which can be verified with:

  http://notmuchmail.org/releases/notmuch-0.13.1.tar.gz.sha1
  48c22d6901148cf732e09e11db6ae4fde61f8386  notmuch-0.13.1.tar.gz

  http://notmuchmail.org/releases/notmuch-0.13.1.tar.gz.sha1.asc
  (signed by David Bremner)

What's new in notmuch 0.13.1
=

Bug-fix release
---

Fix inserting of UTF-8 characters from *text/plain* parts in reply

  While notmuch gained ability to insert content from other than *text/plain*
  parts of email whenever *text/plain* parts are not available (notably
  HTML-only emails), replying to mails that do have *text/plain* the
  non-ASCII characters were incorrectly decoded. This is now fixed.

`notmuch_database_get_directory` and
`notmuch_database_find_message_by_filename` now work on read-only
databases

  Previously, these functions attempted to create directory documents
  that didn't exist and would return an error or abort when given a
  read-only database.  Now they no longer create directory documents
  and simply return a `NULL` object if the directory does not exist,
  as documented.

Fix compilation of ruby bindings.

  Revert to dynamic linking, since the statically linked bindings did
  not work well.

What is notmuch
===
Notmuch is a system for indexing, searching, reading, and tagging
large collections of email messages in maildir or mh format. It uses
the Xapian library to provide fast, full-text search with a convenient
search syntax.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20120529/9862000b/attachment.pgp>


search summary and exclusions

2012-05-29 Thread Jameson Graef Rollins
On Mon, May 28 2012, Peter Wang  wrote:
> % ./notmuch search --format=json --exclude=true -- thread:9598 
> tag:unread
> [{"thread": "9598",
> "timestamp": 1338231998,
> "date_relative": "Today 05:06",
> "matched": 1,
> "total": 15,
> "authors": "Mark Walters| Peter Wang",
> "subject": "[PATCH v6 3/6] cli: make --entire-thread=false work for 
> format=json.",
> "tags": ["deleted", "draft", "replied", "sent", "unread"]}]
>
> Here is a thread I participated in.  From this, my MUA displays "1/15",
> suggesting that there is 1 unread message out of a total of 15.  But
> upon opening the thread, there are only 11 messages visible: 4 were
> drafts (possibly deleted) which have been excluded.  To the user, it
> looks like some messages went missing.
>
> Therefore I would like search --output=summary --exclude=true
> to report the total number of non-excluded messages.  It doesn't need to
> be via the "total" field; a new field would be fine.

What you have pasted above is --output=json, not --output=summary.  The
formats are quite different.  What are you asking for a change in?

But regardless, I don't think I would like to see the changes you
suggest.  I would like for the thread total to list the total number of
messages in the thread, regardless whether they're excluded or not.
Same for the tags.  I think I want to continue to see if excluded
messages are in a returned thread.  The desire to hide the excluded
messages in the output is why they're marked as hidden/not visible.

Think about the excludes as acting on the search itself, and less on the
output.  We exclude messages from search, but if they show up in a
returned thread we at least acknowledge that they're there.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20120529/1ade8dbb/attachment-0001.pgp>


search summary and exclusions

2012-05-29 Thread Peter Wang
Hi,

Exclusions don't work the way I expected with the search command and
--output=summary.  I would like messages with excluded tags to be
treated as if they don't exist at all, but currently:

  * excluded messages are counted towards the "total"
  * excluded tags are included in the "tags" set

Are these deliberate?  Especially the second point seems to conflict
with search --output=tags, which doesn't show excluded tags.

Peter


[PATCH v6 3/6] cli: make --entire-thread=false work for format=json.

2012-05-29 Thread Peter Wang
On Sun, 27 May 2012 09:22:23 +0100, Mark Walters  
wrote:
> @@ -1036,7 +1047,9 @@ notmuch_show_command (void *ctx, unused (int argc), 
> unused (char *argv[]))
>  switch (format_sel) {
>  case NOTMUCH_FORMAT_JSON:
>   format = _json;
> - params.entire_thread = TRUE;
> + /* JSON defaults to entire-thread TRUE */
> + if (entire_thread == ENTIRE_THREAD_DEFAULT)
> + entire_thread = ENTIRE_THREAD_TRUE;
>   break;

Minor point, but you can defer this until later and keep the logic in
one place.

>  case NOTMUCH_FORMAT_TEXT:
>   format = _text;
> @@ -1058,6 +1071,15 @@ notmuch_show_command (void *ctx, unused (int argc), 
> unused (char *argv[]))
>   params.raw = TRUE;
>   break;
>  }
> +/* Default is entire-thread = FALSE except for format=json which
> + * is dealt with above. */
> +if (entire_thread == ENTIRE_THREAD_DEFAULT)
> + entire_thread = ENTIRE_THREAD_FALSE;
> +
> +if (entire_thread == ENTIRE_THREAD_TRUE)
> + params.entire_thread = TRUE;
> +else
> + params.entire_thread = FALSE;

/* Default is entire-thread = FALSE except for format=json. */
if (entire_thread == ENTIRE_THREAD_DEFAULT) {
if (format == _json)
entire_thread = ENTIRE_THREAD_TRUE;
else
entire_thread = ENTIRE_THREAD_FALSE;
}

Peter


[PATCH v6 1/6] cli: command line parsing: allow default for keyword options

2012-05-29 Thread Peter Wang
On Sun, 27 May 2012 09:22:21 +0100, Mark Walters  
wrote:
> This changes the parsing for "keyword" options so that if the option
> is specified with no argument the argument is parsed as if it were
> passed an empty string. This make it easier to add options to existing
> boolean arguments (the existing --option can default to TRUE).
> ---
>  command-line-arguments.c |   17 +
>  1 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/command-line-arguments.c b/command-line-arguments.c
> index 76b185f..2fb8a1b 100644
> --- a/command-line-arguments.c
> +++ b/command-line-arguments.c
> @@ -11,10 +11,15 @@
>  */
>  
>  static notmuch_bool_t
> -_process_keyword_arg (const notmuch_opt_desc_t *arg_desc, const char 
> *arg_str) {
> +_process_keyword_arg (const notmuch_opt_desc_t *arg_desc, char next, const 
> char *arg_str) {
>  
>  const notmuch_keyword_t *keywords = arg_desc->keywords;
>  
> +if (next == 0) {
> + /* No keyword given */
> + arg_str="";
> +}
> +

Whitespace.

>  while (keywords->name) {
>   if (strcmp (arg_str, keywords->name) == 0) {
>   if (arg_desc->output_var) {
> @@ -24,7 +29,10 @@ _process_keyword_arg (const notmuch_opt_desc_t *arg_desc, 
> const char *arg_str) {
>   }
>   keywords++;
>  }
> -fprintf (stderr, "unknown keyword: %s\n", arg_str);
> +if (next!=0)

Whitespace.

> + fprintf (stderr, "unknown keyword: %s\n", arg_str);
> +else
> + fprintf (stderr, "option %s needs a keyword\n", arg_desc->name);

I think "keyword argument" is clearer.

Peter


Re: search summary and exclusions

2012-05-29 Thread Mark Walters

Hi
On Tue, 29 May 2012, Peter Wang noval...@gmail.com wrote:
 On Mon, 28 May 2012 10:03:35 -0700, Jameson Graef Rollins 
 jroll...@finestructure.net wrote:
 On Mon, May 28 2012, Peter Wang noval...@gmail.com wrote:
  Exclusions don't work the way I expected with the search command and
  --output=summary.  I would like messages with excluded tags to be
  treated as if they don't exist at all, but currently:
 
* excluded messages are counted towards the total
* excluded tags are included in the tags set
 
  Are these deliberate?  Especially the second point seems to conflict
  with search --output=tags, which doesn't show excluded tags.
 
 Hi, Peter.  Can you explain more what you mean?  I'm not sure what your
 two bullets have to do with --output=summary.  Messages are counted with
 the count subcommand, and tags are shown with search --output=tags,
 neither of which have anything to do with --output=summary, and both of
 which accept the exclude flag:
 
 notmuch count --exclude=true '*'
 notmuch search --output=tags --exclude=true '*'
 
 Maybe you can give a clearer explanation of what your issue is.
 Examples help.

 Sure.  I keep draft messages in the mail store, and tag them with
 'draft', and later 'deleted'.  I would like the exclusions to treat
 draft and deleted messages as if they didn't exist in the store.

 % ./notmuch search --format=json --exclude=true -- thread:9598 
 tag:unread
 [{thread: 9598,
 timestamp: 1338231998,
 date_relative: Today 05:06,
 matched: 1,
 total: 15,
 authors: Mark Walters| Peter Wang,
 subject: [PATCH v6 3/6] cli: make --entire-thread=false work for 
 format=json.,
 tags: [deleted, draft, replied, sent, unread]}]

 Here is a thread I participated in.  From this, my MUA displays 1/15,
 suggesting that there is 1 unread message out of a total of 15.  But
 upon opening the thread, there are only 11 messages visible: 4 were
 drafts (possibly deleted) which have been excluded.  To the user, it
 looks like some messages went missing.

 Therefore I would like search --output=summary --exclude=true
 to report the total number of non-excluded messages.  It doesn't need to
 be via the total field; a new field would be fine.

It is easy to add this to the JSON format but adding it to the text
format would probably break things, and I would prefer not to have the
formats diverge.

Does anyone have any suggestions? Would people happy with a change in the
text summary output?

Best wishes

Mark
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


notmuch release 0.13.1 now available

2012-05-29 Thread David Bremner
Where to obtain notmuch 0.13.1
===
  http://notmuchmail.org/releases/notmuch-0.13.1.tar.gz

Which can be verified with:

  http://notmuchmail.org/releases/notmuch-0.13.1.tar.gz.sha1
  48c22d6901148cf732e09e11db6ae4fde61f8386  notmuch-0.13.1.tar.gz

  http://notmuchmail.org/releases/notmuch-0.13.1.tar.gz.sha1.asc
  (signed by David Bremner)

What's new in notmuch 0.13.1
=

Bug-fix release
---

Fix inserting of UTF-8 characters from *text/plain* parts in reply

  While notmuch gained ability to insert content from other than *text/plain*
  parts of email whenever *text/plain* parts are not available (notably
  HTML-only emails), replying to mails that do have *text/plain* the
  non-ASCII characters were incorrectly decoded. This is now fixed.

`notmuch_database_get_directory` and
`notmuch_database_find_message_by_filename` now work on read-only
databases

  Previously, these functions attempted to create directory documents
  that didn't exist and would return an error or abort when given a
  read-only database.  Now they no longer create directory documents
  and simply return a `NULL` object if the directory does not exist,
  as documented.

Fix compilation of ruby bindings.

  Revert to dynamic linking, since the statically linked bindings did
  not work well.

What is notmuch
===
Notmuch is a system for indexing, searching, reading, and tagging
large collections of email messages in maildir or mh format. It uses
the Xapian library to provide fast, full-text search with a convenient
search syntax.


pgpoku0l58eQB.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: search summary and exclusions

2012-05-29 Thread Jameson Graef Rollins
On Mon, May 28 2012, Peter Wang noval...@gmail.com wrote:
 % ./notmuch search --format=json --exclude=true -- thread:9598 
 tag:unread
 [{thread: 9598,
 timestamp: 1338231998,
 date_relative: Today 05:06,
 matched: 1,
 total: 15,
 authors: Mark Walters| Peter Wang,
 subject: [PATCH v6 3/6] cli: make --entire-thread=false work for 
 format=json.,
 tags: [deleted, draft, replied, sent, unread]}]

 Here is a thread I participated in.  From this, my MUA displays 1/15,
 suggesting that there is 1 unread message out of a total of 15.  But
 upon opening the thread, there are only 11 messages visible: 4 were
 drafts (possibly deleted) which have been excluded.  To the user, it
 looks like some messages went missing.

 Therefore I would like search --output=summary --exclude=true
 to report the total number of non-excluded messages.  It doesn't need to
 be via the total field; a new field would be fine.

What you have pasted above is --output=json, not --output=summary.  The
formats are quite different.  What are you asking for a change in?

But regardless, I don't think I would like to see the changes you
suggest.  I would like for the thread total to list the total number of
messages in the thread, regardless whether they're excluded or not.
Same for the tags.  I think I want to continue to see if excluded
messages are in a returned thread.  The desire to hide the excluded
messages in the output is why they're marked as hidden/not visible.

Think about the excludes as acting on the search itself, and less on the
output.  We exclude messages from search, but if they show up in a
returned thread we at least acknowledge that they're there.

jamie.


pgphGM7ZK5dln.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Ubuntu messaging menu integration

2012-05-29 Thread Ben Gamari
Hey all,

I recently dusted off a little hack I've been sitting on for quite a
while integrating notmuch into Ubuntu's messaging menu[1]. The code is now
on Github[2] in case someone finds it useful. Pull requests are of course
welcome.

Cheers,

- Ben


[1] https://wiki.ubuntu.com/MessagingMenu
[2] https://github.com/bgamari/notmuch-indicator
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: search summary and exclusions

2012-05-29 Thread Peter Wang
On Tue, 29 May 2012 08:00:00 -0700, Jameson Graef Rollins 
jroll...@finestructure.net wrote:
 On Mon, May 28 2012, Peter Wang noval...@gmail.com wrote:
  % ./notmuch search --format=json --exclude=true -- thread:9598 
  tag:unread
  [{thread: 9598,
  timestamp: 1338231998,
  date_relative: Today 05:06,
  matched: 1,
  total: 15,
  authors: Mark Walters| Peter Wang,
  subject: [PATCH v6 3/6] cli: make --entire-thread=false work for 
  format=json.,
  tags: [deleted, draft, replied, sent, unread]}]
 
  Here is a thread I participated in.  From this, my MUA displays 1/15,
  suggesting that there is 1 unread message out of a total of 15.  But
  upon opening the thread, there are only 11 messages visible: 4 were
  drafts (possibly deleted) which have been excluded.  To the user, it
  looks like some messages went missing.
 
  Therefore I would like search --output=summary --exclude=true
  to report the total number of non-excluded messages.  It doesn't need to
  be via the total field; a new field would be fine.
 
 What you have pasted above is --output=json, not --output=summary.  The
 formats are quite different.  What are you asking for a change in?

--output=summary is the default.  --format=json only changes the
surface syntax.

% ./notmuch search --output=summary --exclude=true -- thread:9598 
tag:unread
thread:9598  Yest. 05:06 [1/15] Mark Walters| Peter Wang; [PATCH v6 
3/6] cli: make --entire-thread=false work for format=json. (deleted draft 
replied sent unread)

 But regardless, I don't think I would like to see the changes you
 suggest.  I would like for the thread total to list the total number of
 messages in the thread, regardless whether they're excluded or not.
 Same for the tags.  I think I want to continue to see if excluded
 messages are in a returned thread.  The desire to hide the excluded
 messages in the output is why they're marked as hidden/not visible.
 
 Think about the excludes as acting on the search itself, and less on the
 output.  We exclude messages from search, but if they show up in a
 returned thread we at least acknowledge that they're there.

Understood; it's a two-phase process, and I wasn't making the
distinction.  If it is the expected and useful behaviour, so be it.

Maybe there is room for another keyword under --exclude?

Peter
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: search summary and exclusions

2012-05-29 Thread Jameson Graef Rollins
On Tue, May 29 2012, Peter Wang noval...@gmail.com wrote:
 --output=summary is the default.  --format=json only changes the
 surface syntax.

I'm sorry.  For some reason this whole time I was thinking --format=text
when you were saying --output=summary.  My bad.

 Understood; it's a two-phase process, and I wasn't making the
 distinction.  If it is the expected and useful behaviour, so be it.

 Maybe there is room for another keyword under --exclude?

Maybe.  As always, patches welcome!

jamie.


pgpoVgSwJmvCy.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch