[PATCH 2/2] python: add convenience function to get named queries

2017-06-04 Thread l-m-h
--- bindings/python/notmuch/database.py | 7 +++ 1 file changed, 7 insertions(+) diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index 9d7737b2..1fd312dd 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@

[PATCH 1/2] python: add bindings for notmuch_database_get_config{, _list}

2017-06-04 Thread l-m-h
--- bindings/python/docs/source/database.rst | 4 ++ bindings/python/notmuch/database.py | 85 bindings/python/notmuch/globals.py | 5 ++ 3 files changed, 94 insertions(+) diff --git a/bindings/python/docs/source/database.rst

[Kiso Katsuyuki] Re: Modify kill and exit functions on emacs notmuch mode

2017-06-04 Thread Kiso Katsuyuki
> the selection priority of asterisk buffers like > "*notmuch-hello*" are lower than file buffers Sorry, this means a file buffer is selected after exit from a notmuch buffer, unless there is no file buffer in the buffer list. --- Begin Message --- > ... but as someone(tm) may know, everyone

Re: Semi-ready saved search

2017-06-04 Thread Tomas Nordin
David Bremner writes: > One approach would be to define a function like this > > (defun last-days-search(arg) > (interactive "p") > (notmuch-search (format "date:%dd.. and tag:inbox" arg))) > > Then you can pass a numeric argument in the usual emacs way, e.g. if > that

Re: Modify kill and exit functions on emacs notmuch mode

2017-06-04 Thread Kiso Katsuyuki
> ... but as someone(tm) may know, everyone have their own workflow > ( https://xkcd.com/1172/ ) in their notmuch usage -- someone may > e.g. start writing email based on arbitrary C code buffer, and > after email send, return to that buffer instead of going to some > other notmuch buffer. I

Re: Modify kill and exit functions on emacs notmuch mode

2017-06-04 Thread David Bremner
Tomi Ollila writes: > > ... but as someone(tm) may know, everyone have their own workflow > ( https://xkcd.com/1172/ ) in their notmuch usage -- someone may > e.g. start writing email based on arbitrary C code buffer, and > after email send, return to that buffer instead of

[patch v3 01/12] lib: isolate n_d_add_message and helper functions into own file

2017-06-04 Thread David Bremner
'database.cc' is becoming a monster, and it's hard to follow what the various static functions are used for. It turns out that about 1/3 of this file notmuch_database_add_message and helper functions not used by any other function. This commit isolates this code into it's own file. Some side

[patch v3 06/12] lib: index message files with duplicate message-ids

2017-06-04 Thread David Bremner
The corresponding xapian document just gets more terms added to it, but this doesn't seem to break anything. Values on the other hand get overwritten, which is a bit annoying, but arguably it is not worse to take the values (from, subject, date) from the last file indexed rather than the first.

[patch v3 04/12] lib: refactor notmuch_database_add_message header parsing

2017-06-04 Thread David Bremner
This function is large and hard to understand and modify. Start to break it down into meaningful pieces. --- lib/add-message.cc| 54 +++- lib/message-file.c| 86 +++ lib/notmuch-private.h | 11 +++ 3 files

[patch v3 12/12] add "notmuch reindex" subcommand

2017-06-04 Thread David Bremner
From: Daniel Kahn Gillmor This new subcommand takes a set of search terms, and re-indexes the list of matching messages. --- Makefile.local| 1 + doc/conf.py | 4 ++ doc/index.rst | 1 +

[patch v3 03/12] lib: factor out message-id parsing to separate file.

2017-06-04 Thread David Bremner
This is really pure C string parsing, and doesn't need to be mixed in with the Xapian/C++ layer. Although not strictly necessary, it also makes it a bit more natural to call _parse_message_id from multiple compilation units. --- lib/Makefile.local| 1 + lib/add-message.cc| 106

[patch v3 11/12] lib: add notmuch_message_reindex

2017-06-04 Thread David Bremner
From: Daniel Kahn Gillmor This new function asks the database to reindex a given message. The parameter `indexopts` is currently ignored, but is intended to provide an extensible API to support e.g. changing the encryption or filtering status (e.g. whether and how certain

[patch v3 02/12] lib/n_d_add_message: refactor test for new/ghost messages

2017-06-04 Thread David Bremner
The switch is easier to understand than the side effects in the if test. It also potentially allows us more flexibility in breaking up this function into smaller pieces, since passing private_status around is icky. --- lib/add-message.cc | 23 +-- 1 file changed, 13

[patch v3 07/12] lib: add notmuch_message_count_files

2017-06-04 Thread David Bremner
This operation is relatively inexpensive, as the needed metadata is already computed by our lazy metadata fetching. The goal is to support better UI for messages with multipile files. --- lib/message.cc| 8 lib/notmuch-private.h | 6 ++ lib/notmuch.h | 8

[patch v3 08/12] lib: add notmuch_thread_get_total_files

2017-06-04 Thread David Bremner
This is relatively inexpensive in terms of run time and implementation cost as we are already traversing the list of messages in a thread. --- lib/notmuch.h | 12 lib/thread.cc | 9 + 2 files changed, 21 insertions(+) diff --git a/lib/notmuch.h b/lib/notmuch.h index

[patch v3 05/12] test: add known broken tests for duplicate message id

2017-06-04 Thread David Bremner
There are many other problems that could be tested, but these ones we have some hope of fixing because it doesn't require UI changes, just indexing changes. --- test/T670-duplicate-mid.sh | 28 1 file changed, 28 insertions(+) create mode 100755

[patch v3 09/12] cli/search: print total number of files matched in summary output.

2017-06-04 Thread David Bremner
The structured output formats already have all of the filenames. This is an easy bit of UI change to make the multiple files visible. --- doc/man1/notmuch-search.rst | 17 - notmuch-search.c | 15 +-- test/T080-search.sh |

[patch v3 10/12] lib: add _notmuch_message_remove_indexed_terms

2017-06-04 Thread David Bremner
Testing will be provided via use in notmuch_message_reindex --- lib/message.cc| 54 +++ lib/notmuch-private.h | 2 ++ 2 files changed, 56 insertions(+) diff --git a/lib/message.cc b/lib/message.cc index f3d1e159..33c24354 100644 ---

v3 of index multiple files per msg-id, add reindex command

2017-06-04 Thread David Bremner
this obsoletes id:20170507124012.30188-1-da...@tethera.net As with the previous versions: , | WARNING: reindexing is an intrusive operation. I don't think this will | corrupt your database, but previous versions thrashed threading pretty | well. notmuch-dump is your friend. `

Re: Modify kill and exit functions on emacs notmuch mode

2017-06-04 Thread Tomi Ollila
On Sat, Jun 03 2017, katsuyuki wrote: > Hi, I modified kill and exit functions on emacs notmuch mode. > I want to hear your opinion about the change. Some years ago I had a problem notmuch choosing "strange" buffer when exiting e.g. mail buffer (and I sent a patch to "fix" that). Eventually the