Richard Russon [Wed, 16 Mar 2016 23:10:48 +0000 (23:10 +0000)]
merge: ifdef - conditional config options
* feature: ifdef
* test for commands
* tidy code
* add docs
* add ident to PATCHES
* split out version info
* add 'ifndef' command
* add 'finish' function
* document new commands
Richard Russon [Wed, 16 Mar 2016 22:49:44 +0000 (22:49 +0000)]
merge: notmuch - email search engine
* add basic files and build-sys stuff
* add some vfolder functions
* add 'virtual-mailboxes' parser
* add notmuch::// uri
* consolidate msg sync code
* add context magic
* add basic .muttrc variables
* add basic functions
* don't modify virtual folders' paths
* add notmuch calls to mx_* API
* add support to browser
* change-vfolder, print folder info, etc.
* add modify-label
* update README.notmuch
* fix CONTEXT->data->db usage
* update README
* header: add HEADER->free_cb() to free driver specific data
* add <modify-labels-then-hide>
* print vfolder description on status bar
* properly update context numbers
* add virtual spoolfile
* small refactoring
* implement nm_check_database()
* support default db uri
* add debug messages
* update README
* improve virtual_mailboxes command, update docs
* improve nm_unread_tag setting
* fix compilation error at get_nm_message()
* add ML to README
* add support for virtual folders, add sidebar-toggle command
* docs: add note about sidebar to notmuch docs
* fix segfault when exiting with 'x' key
* build-sys: fix compilation without --enable-notmuch
* Grammar and typo fixes.
* add note about notmuch version requirement
* fix a bug with processing mailboxes when they are all virtual.
* cleanup private notmuch structs initialization
* explicitly require notmuch context
* use context data if possible rather than directly context
* search in new/cur subfolders if DB is not up-to-date
* remove extra slashes
* fix sync
* fix msg remove code
* don't use uninitialized HEADER in nm_check_database()
* add nm_open_timeout
* fix prefixes in README
* fix new->cur maildir move
* make filename changes more robust
* add NOTMUCH in show_version()
* don't rename in DB before mx commit
* allow to read whole-threads
* fix nm_check_database to count new messages correctly
* use the new notmuch api if available
* use notmuch_status_t for DB open
* use the Maildir if NotmuchDefaultUri is unset
* sync flags for all duplicate messages
* format: support optional modifier for g (notmuch labels)
* print read progress of a query
* mutt_nm_db_limit option defines a default limit
* add note about nm_db_limit to README
* add nm_query_type config file option
* add notmuch_{query,message}_destroy to DB checker
* docs: add link to notmuch mutttips
* count messages for mutt progress bar
* add %g examples
* Fix auto_tag=yes for modify-labels* and quasi-delete
* Add 'label' pattern modifier '~Y'
* Plug a leaked notmuch DB handle in get_count()
* Add nm_get_all_tags()
* Add TAB completion of tag: names in <vfolder-from-query>
* Add TAB completion of tag names in <modify-labels>*
* Fix trivial documentation typoes
* reuse connection in complete_all_nm_tags()
* hide signed and encrypted tags by default
* add $record support
* sidebar: extend sidebar sort methods, add sort_sidebar=
* add support for text transforms of tag names
* fix corrupt viewing of messages
* port the old index-color mutt patch to mutt-kz
* added some documentation
* clean up tags related code, improve %G
* add nm_exclude_tags
* fix buffer overflow, improve tag_list usage
* always use notmuch message ID
* add entire-thread command, cleanup progress bar code
* improve entire-thread
* add CH_VIRTUAL to allow to specify when use virtual headers
* update DB on save-command
* extend <change-vfolder> to accept folder name/uri
* <change-vfolder> default to the next unread folder
* don't close opened message after <modify-label>
* search by vfolder name in browser
* docs: update README.notmuch
* docs: add UPDATING.kz
* make %N optional for notmuch browser format
* apply NotmuchExcludeTags to count queries
* fix getting count of new messages for non-trivial query
* get <entire-thread> work from pager context
* use exclude tags for entrie-thread too
* call notmuch_query_count_messages() more carefully
* fix DB transaction balancing
* update the header colors after modifying tags
* fix nm_query_type=messages + query type=threads
* docs: add to UPDATING.kz
* enlarge query buffer
* docs: add to UPDATING.kz
* bypass data limit when expanding threads
* mutt, Update 'unread' tag for all files mapped to msg
Don Zickus [Fri, 11 Oct 2013 18:34:57 +0000 (11:34 -0700)]
mutt, Update 'unread' tag for all files mapped to msg
I ran into an issue where I would read an email in my inbox that was
sent to me and cc'd a mailing list and it would not remove the 'unread'
tag after syncing the mailbox.
Apparently, when nm_synci'ing the message, the local inbox copy would be
recognized as seen but the duplicate copy in the mailing list folder
would still be in the 'new' directory, so the 'unread' flag would not
be cleared.
The way the 'duplicate' messags where handled in 'rename_filename', it
appears after the add/remove the local copy of 'msg' was not updated
with the new paths. I fixed this by destorying the message and then
re-reading it from the notmuch database.
However, the tags were still off. I had to further call
'update_header_flags' to re-read the tags from the database (using
the updated paths) to clear the 'unread' tag.
Both of these changes seem to work as expected now.
Signed-off-by: Don Zickus <dzickus@redhat.com>
--
I am not too familar with this code, so my changes may not be
correct. I do know they seem to work after a couple of days of
testing.
fix getting count of new messages for non-trivial query
Currtly, we ask for count of new messages by appending tag:unread (or
whatever NotmuchUnreadTag has) to db query. It works if your query is
very simple: no 'OR', 'NOT', etc.
If you will ask new messages for query like
"to:foo@example.com or to:bar@example.net"
mutt will query db for count of
"to:foo@example.com or to:bar@example.net tag:unread"
and notmuch will understand it as
"to:foo@example.com or (to:bar@example.net tag:unread)"
which, obviously, is not what you wanted.
Optimizations like
if (strstr(db_query, NotmuchUnreadTag))
*new = all ? *all : count_query(db, db_query);
doesn't work for the same reason.
Let's fix all this by construct query with proper parenthesis:
"(to:foo@example.com or to:bar@example.net) tag:unread"
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Karel Zak [Mon, 14 Oct 2013 18:34:57 +0000 (11:34 -0700)]
add CH_VIRTUAL to allow to specify when use virtual headers
For example don't add "Tags:" header to the message when copy the
message to another folder. The virtual headers make sense only when
we display the message to user.
Karel Zak [Mon, 7 Oct 2013 18:34:57 +0000 (11:34 -0700)]
always use notmuch message ID
It's better to use notmuch message Id than rely on Id from parsed
message, because notmuch ensures that Id exists and it generates
a fake Id for broken messages without the Id.
Reported-by: Michael Zeltner <m@niij.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 22 Oct 2013 18:34:57 +0000 (11:34 -0700)]
add nm_exclude_tags
Based on patch from: Raghavendra D Prabhu <rprabhu@wnohang.net>
This makes use of notmuch_query_add_tag_exclude in notmuch API, to
exclude messages tagged with tags from nm_exclude_tags from query
results by default unless specified explicitly.
Signed-off-by: Raghavendra D Prabhu <rprabhu@wnohang.net> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 17 Sep 2012 07:31:54 +0000 (09:31 +0200)]
fix corrupt viewing of messages
The mutt records offset of email body when parse email header.
Unfortunately when we check notmuch DB changes when we don't ask for
email path in the same way. So it's possible that for emails that are
stored in multiple folders (you sent the same email with the same ID
to multiple mailing lists) we get a different path, then notmuch mutt
code updates the path, but no the offset... result is corrupted body.
David Sterba [Sat, 8 Sep 2012 07:31:54 +0000 (09:31 +0200)]
hide signed and encrypted tags by default
Mutt shows signed/encrypted status in another way and occupies only 1
char in index line. Hide the tags by default and leave more space for
other tags.
Tim Stoakes [Sat, 22 Sep 2012 07:31:54 +0000 (09:31 +0200)]
Plug a leaked notmuch DB handle in get_count()
nm_nonctx_get_count() was leaking its notmuch database handle if NOTMUCH_API_3
was in use. Looks like it missed the same treatment that the other call sites
got to do this.
Tim Stoakes [Sun, 16 Sep 2012 07:31:54 +0000 (09:31 +0200)]
Fix auto_tag=yes for modify-labels* and quasi-delete
When 'auto_tag' was 'yes', <modify-labels>* and <quasi-delete> still only
applied to the currently-selected message. Now they apply to all tagged
messages, as they should.
Luke Macken [Tue, 10 Apr 2012 15:25:31 +0000 (11:25 -0400)]
fix a bug with processing mailboxes when they are all virtual.
This bug occurs when there are only virtual mailboxes defined. Prior to this
change, the sidebar descriptions of the virtual mailboxes would be displayed as
the notmuch query itself, as opposed to the user-defined description.
David Sterba [Mon, 2 Apr 2012 21:28:18 +0000 (23:28 +0200)]
build-sys: fix compilation without --enable-notmuch
We can still leave mutt-kz compilable entirely without notmuch, just for the
case there are users out there not interested in notmuch enhancements, but I
seriously doubt that :)
Here's the patch which compiles fine without --enable-notmuch
Karel Zak [Wed, 14 Mar 2012 14:19:43 +0000 (15:19 +0100)]
add support for virtual folders, add sidebar-toggle command
* add support for virtual folders
* add sidebar-toggle function to toggle between virtual and normal
folders in sudebar
* virtual folders are used by default if 'virtual_spoolfile' is 'yes'
mutt_notmuch.c: In function ‘get_nm_message’:
mutt_notmuch.c:643:2: error: too few arguments to function ‘notmuch_database_find_message’
/usr/include/notmuch.h:371:1: note: declared here
make[2]: *** [mutt_notmuch.o] Error 1
The mutt-ks is made for notmuch version 0.8, but in version 0.9 the API
changed, in particular with this commit: