]> git.notmuchmail.org Git - notmuch/log
notmuch
13 years agoIntegrate notmuch-fcc mechansim
Sebastian Spaeth [Mon, 26 Apr 2010 08:23:18 +0000 (10:23 +0200)]
Integrate notmuch-fcc mechansim

I have gone wild and added a defcustom "notmuch-fcc-dirs".
Depending on the value of that variable we will not do any
maildir fcc at all (nil, the default), or it is of the format
(("defaultsentbox")
 ("full name <email@address>" . "Work/sentbox")
 ("full name2 <email2@address2>" . "Work2/sentbox"))

The outbox name will be concatenated with the message mode
variable "message-directory" which is "~/Mail/" by default.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agonotmuch-maildir-fcc: elisp syntax fixes
Sebastian Spaeth [Mon, 26 Apr 2010 08:23:17 +0000 (10:23 +0200)]
notmuch-maildir-fcc: elisp syntax fixes

1)use insert-buffer-substring

Rather than the insert-buffer. Emacs complains that it is for interactive use
and not for use within elisp. So use insert-buffer-substring which does the
same thing when not handed any 'begin' 'end' parameters.

2)replace caddr with (car (cdr (cdr)))

The former requires 'cl to be loaded and during make install emacs complained
about not knowing it.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoIntegrate notmuch-maildir-fcc into notmuch
Sebastian Spaeth [Mon, 26 Apr 2010 08:23:16 +0000 (10:23 +0200)]
Integrate notmuch-maildir-fcc into notmuch

Require notmuch-maildir-fcc and also install it.
Rename all jkr/* functions to notmuch-maildir-fcc-*

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoAdd elisp file for FCC to maildir solution
Jesse Rosenthal [Mon, 26 Apr 2010 08:23:15 +0000 (10:23 +0200)]
Add elisp file for FCC to maildir solution

File grabbed from http://jkr.acm.jhu.edu/jkr-maildir.el
but not integrated yet.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoSimple attempt to display author names in a friendlier way
Dirk Hohndel [Sat, 24 Apr 2010 18:20:57 +0000 (11:20 -0700)]
Simple attempt to display author names in a friendlier way

This patch only addresses the typical Outlook/Exchange case
where we have "Last, First" <first.last@company.com> or
"Last, First MI" <first.mi.last@company.com>.

In the future we should be more fexible as to the formats
we recognize, but for now we address this one as it is the
Exchange default setting and therefore the most common one.

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoAdd tests for author name reordering in search results
Dirk Hohndel [Sat, 24 Apr 2010 18:20:56 +0000 (11:20 -0700)]
Add tests for author name reordering in search results

This should be required for all patches :-)

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoAdd NEWS section for author reordering
Dirk Hohndel [Sat, 24 Apr 2010 18:20:55 +0000 (11:20 -0700)]
Add NEWS section for author reordering

This should be required in all patches

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoReorder displayed names of thread authors
Dirk Hohndel [Sat, 24 Apr 2010 18:20:54 +0000 (11:20 -0700)]
Reorder displayed names of thread authors

When displaying threads as result of a search it makes sense to list those
authors first who match the search. The matching authors are separated from the
non-matching ones with a '|' instead of a ','

Imagine the default "+inbox" query. Those mails in the thread that
match the query are actually "new" (whatever that means). And some
people seem to think that it would be much better to see those author
names first. For example, imagine a long and drawn out thread that once
was started by me; you have long read the older part of the thread and
removed the inbox tag. Whenever a new email comes in on this thread,
prior to this patch the author column in the search display will first show
"Dirk Hohndel" - I think it should first show the actual author(s) of the new
mail(s).

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoAdd authors member to message
Dirk Hohndel [Sat, 24 Apr 2010 18:20:53 +0000 (11:20 -0700)]
Add authors member to message

message->authors contains the author's name (as we want to print it)
get / set methods are declared in notmuch-private.h

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoemacs: Tell the user how many addresses matched when completing
David Edmondson [Mon, 26 Apr 2010 16:25:21 +0000 (17:25 +0100)]
emacs: Tell the user how many addresses matched when completing

When completing an address, tell the user how many addresses in the
database matched the query.

Edited-by: Carl Worth <cworth@cworth.org>: Removed a stray numeric
literal that was causing a compiler warning.

13 years agoemacs: Remove duplicate declaration of `notmuch-folders'
David Edmondson [Mon, 26 Apr 2010 15:09:43 +0000 (16:09 +0100)]
emacs: Remove duplicate declaration of `notmuch-folders'

Reviewed-by: Carl Worth <cworth@cworth.org>
This variable was moved from notmuch.el to notmuch-lib.el some time
ago, but the declaration in notmuch.el was left around. Clean that up.

13 years agoemacs: `notmuch' should display the `notmuch-hello' interface
David Edmondson [Mon, 26 Apr 2010 15:07:04 +0000 (16:07 +0100)]
emacs: `notmuch' should display the `notmuch-hello' interface

Reviewed-by: Carl Worth <cworth@cworth.org>
The notmuch-hello functionality is now sufficiently useful that we
want to make it the default view of notmuch for new users. This also
effectively hides the "hello" name from the user, so we'll be free to
change that in the implementation if necessary.

This change also shuffles the requires between notmuch.el and
notmuch-hello.el. This fixes things so that our documented (require
'notmuch) is sufficient for getting the notmuch-hello functionality.

Finally, the shuffling caused the notmuch-search-oldest-first variable
from one file to the other. While doing that, give this variable the
defcustom treatment for easier customization.

13 years agoemacs: Fix `notmuch-show-rewind' in the presence of invisible text
David Edmondson [Mon, 26 Apr 2010 14:53:52 +0000 (15:53 +0100)]
emacs: Fix `notmuch-show-rewind' in the presence of invisible text

When determining whether or not to re-align the head of the current
message with the top of the window, use `count-screen-lines' rather
than `count-lines' to allow for invisible text in the preceding
message. When comparing that number of lines against
`next-screen-context-lines', realign if the number of lines of the
previous message visible is 'smaller than or equal to' rather than
just 'smaller than' to improve usability.

13 years agoemacs: More DWIM when editing messages
David Edmondson [Mon, 26 Apr 2010 14:01:25 +0000 (15:01 +0100)]
emacs: More DWIM when editing messages

For composing new messages and forwarding, leave the cursor on the
'To:' field. For replies, leave the cursor at the start of the
body. In all cases, mark the buffer as not modified so that the user
is not prompted if she decides to immediately kill the buffer.

13 years agoemacs: Add more functions to clean up text/plain parts
David Edmondson [Mon, 26 Apr 2010 13:45:30 +0000 (14:45 +0100)]
emacs: Add more functions to clean up text/plain parts

Add:
- notmuch-wash-wrap-long-lines: Wrap lines longer than the width of
  the current window whilst maintaining any citation prefix.
- notmuch-wash-tidy-citations: Tidy up citations by:
  - compress repeated otherwise blank citation lines,
  - remove otherwise blank citation lines at the head and tail of a
    citation,
- notmuch-wash-elide-blank-lines: Compress repeated blank lines and
  remove leading and trailing blank lines.

None of these is enabled by default - add them to
`notmuch-show-insert-text/plain-hook' to use.

Reviewed-by: Carl Worth <cworth@cworth.org>: I previously committed a
stale version of this patch.

13 years agoRevert "emacs: Add more functions to clean up text/plain parts"
Carl Worth [Mon, 26 Apr 2010 17:05:29 +0000 (10:05 -0700)]
Revert "emacs: Add more functions to clean up text/plain parts"

This reverts commit 97570954cb583cacac35b0235cbe449a07630ae3.

13 years agoemacs: Fix `notmuch-search-insert-field'
David Edmondson [Mon, 26 Apr 2010 12:16:07 +0000 (13:16 +0100)]
emacs: Fix `notmuch-search-insert-field'

Compare the formatted version of the authors with the formatted sample
string rather than the un-formatted authors with the formatted sample
string.

13 years agoemacs: Hide the "User-Agent:" when composing messages
David Edmondson [Mon, 26 Apr 2010 11:50:59 +0000 (12:50 +0100)]
emacs: Hide the "User-Agent:" when composing messages

Add a list of headers to those hidden by `message-mode' when
composing. By default the list includes only "User-Agent:".

13 years agoemacs: Automatically load "notmuch-address"
David Edmondson [Mon, 26 Apr 2010 10:48:33 +0000 (11:48 +0100)]
emacs: Automatically load "notmuch-address"

"notmuch-address.el" tries to be careful to insinuate itself into
message mode only if it will do something useful, so it's safe to load
it all of the time.

13 years agoemacs: Correct message/header/citation/signature hiding
David Edmondson [Mon, 26 Apr 2010 10:17:11 +0000 (11:17 +0100)]
emacs: Correct message/header/citation/signature hiding

Set `buffer-invisibility-spec' to `nil' (a list) if it is just `t'
before inserting any body parts, otherwise removing items from
`buffer-invisibility-spec' (which is what
`notmuch-show-headers-visible' and `notmuch-show-message-visible' do)
is a no-op and has no effect. This caused threads with only matching
messages to have those messages hidden initially because
`buffer-invisibility-spec' stayed `t'.

13 years agotest: Comment why we need to set TZ
Michal Sojka [Mon, 26 Apr 2010 10:12:13 +0000 (12:12 +0200)]
test: Comment why we need to set TZ

13 years agoemacs: Add a search to the 'recent searches' list once only
David Edmondson [Mon, 26 Apr 2010 09:25:30 +0000 (10:25 +0100)]
emacs: Add a search to the 'recent searches' list once only

Avoiding adding the same search string to the 'recent searches' list
more than once by testing whether the string was already used with
`member' rather than `memq'.

13 years agoemacs: Remove the accelerator keys from the hello buffer
David Edmondson [Mon, 26 Apr 2010 09:25:29 +0000 (10:25 +0100)]
emacs: Remove the accelerator keys from the hello buffer

Carl though that the recent search accelerator keys are not useful, so
remove them.

13 years agoemacs: Adapt the logo background colour to that of the frame
David Edmondson [Mon, 26 Apr 2010 09:25:28 +0000 (10:25 +0100)]
emacs: Adapt the logo background colour to that of the frame

The notmuch logo uses transparency. That can display poorly when
inserting the image into an emacs buffer (black logo on a black
background), so force the background colour of the image. We use a
face (`notmuch-hello-logo-background') to represent the colour so that
`defface' can be used to declare the different possible colours, which
depend on whether the frame has a light or dark background.

13 years agoconfigure: add ignored options for compatibility.
Cédric Cabessa [Sat, 24 Apr 2010 23:33:10 +0000 (01:33 +0200)]
configure: add ignored options for compatibility.

gentoo's ebuild script expects 2 more options for configure:
  --host (same format as --build)
  --datadir

13 years agoemacs: Sort headers when composing
David Edmondson [Mon, 26 Apr 2010 11:22:40 +0000 (12:22 +0100)]
emacs: Sort headers when composing

Always sort the headers in the message composition window.

13 years agoemacs: Suppress window creation when replying
David Edmondson [Mon, 26 Apr 2010 11:19:10 +0000 (12:19 +0100)]
emacs: Suppress window creation when replying

The buffer used to edit a reply should overlay the original
message. Encourage this by setting `same-window-regexps' locally.

13 years agoTODO: Add idea to make content available to isearch in search-results mode.
Carl Worth [Mon, 26 Apr 2010 14:14:22 +0000 (07:14 -0700)]
TODO: Add idea to make content available to isearch in search-results mode.

We can't fit all the authors and the various changed subjects in 80
columns, but it would be great is isearch could still find these, (and
automatically expand the hidden content as necessary).

13 years agoemacs: Add more functions to clean up text/plain parts
David Edmondson [Thu, 22 Apr 2010 12:26:06 +0000 (13:26 +0100)]
emacs: Add more functions to clean up text/plain parts

Add:
- notmuch-wash-wrap-long-lines: Wrap lines longer than the width of
  the current window whilst maintaining any citation prefix.
- notmuch-wash-tidy-citations: Tidy up citations by:
  - compress repeated otherwise blank citation lines,
  - remove otherwise blank citation lines at the head and tail of a
    citation and remove blank lines between attribution statements and
    the citation,
- notmuch-wash-compress-blanks: Compress repeated blank lines and
  remove leading and trailing blank lines.

Enable `notmuch-wash-tidy-citations' and
`notmuch-wash-compress-blanks' by default by adding them to
`notmuch-show-insert-text/plain-hook'. `notmuch-wash-wrap-long-lines'
is not enabled by default.

If `notmuch-wash-wrap-long-lines' is enabled, word wrapping of the
buffer leads to an unappealing display of text, so provide a function
to disable it and add it to the list of `notmuch-show-mode' hook
functions.

13 years agoemacs: Fix i-search to open up invisible citations as necessary
David Edmondson [Fri, 23 Apr 2010 17:39:33 +0000 (18:39 +0100)]
emacs: Fix i-search to open up invisible citations as necessary

Add an `isearch-open-invisible' property to the overlays used to hide
citations and signatures, together with an appropriate function to
leave the invisible text visible should that be required.

13 years agolib: Ensure notmuch_query_search_messages returns NULL on an exception.
Carl Worth [Sat, 24 Apr 2010 14:25:12 +0000 (07:25 -0700)]
lib: Ensure notmuch_query_search_messages returns NULL on an exception.

Previously, this function may have segfaulted immediately after
reporting the exception.

13 years agolib: Document that notmuch_query_count_messages may return 0 if an exception occurs
Carl Worth [Sat, 24 Apr 2010 14:24:01 +0000 (07:24 -0700)]
lib: Document that notmuch_query_count_messages may return 0 if an exception occurs

This isn't a behavioral change---just a calrification in the documentation.

13 years agolib: Audit all notmuch_database call for Xapian exception handling.
Carl Worth [Sat, 24 Apr 2010 14:22:34 +0000 (07:22 -0700)]
lib: Audit all notmuch_database call for Xapian exception handling.

Our current approach is for top-level entry poitns in the library
to have try/catch blocks that catch any Xapian exception and print
a message. Add a few missing blocks and fix up the documentation.

13 years agolib: Audit calls to notmuch_message_get_header to handle NULL return
Carl Worth [Sat, 24 Apr 2010 13:46:43 +0000 (06:46 -0700)]
lib: Audit calls to notmuch_message_get_header to handle NULL return

Sebastian Spaeth reported [*] a segfault within libnotmuch when
running notmuch operations while an asyncronous offlineimap job had
removed some files from the mail store. Avoid this by handling all
cases where notmuch_message_get_header could return NULL.

[*] See message id:87d3xqti3o.fsf@SSpaeth.de on notmuch@notmuchmail.org

13 years agolib: Simplify code to set subject from matched message.
Carl Worth [Sat, 24 Apr 2010 13:45:51 +0000 (06:45 -0700)]
lib: Simplify code to set subject from matched message.

Simply moving the code from _add_matched_message to a new
_set_subject_from_message function.

13 years agonotmuch reply: Handle notmuch_message_get_header returning NULL.
Carl Worth [Sat, 24 Apr 2010 13:33:32 +0000 (06:33 -0700)]
notmuch reply: Handle notmuch_message_get_header returning NULL.

This seems a rather unlikely case, (replying to a message that
disappears out from under us half way through the reply), but
notmuch_message_get_header is documented to return NULL in error
cases, so we might as well deal sanely with that (rather than just
crashing).

13 years agoemacs: Make notmuch-hello jumpt to search bar by default.
Carl Worth [Sat, 24 Apr 2010 13:15:09 +0000 (06:15 -0700)]
emacs: Make notmuch-hello jumpt to search bar by default.

This isn't ideal for me personally, since I usually want to inovke a
saved search rather than entering a new search textually. But it's at
least better than just putting point in the upper-left corner where it
doesn't do anything.

13 years agoemacs: Rename notmuch-show-headers to notmuch-message-headers
Carl Worth [Sat, 24 Apr 2010 13:11:57 +0000 (06:11 -0700)]
emacs: Rename notmuch-show-headers to notmuch-message-headers

And similarly for notmuch-show-headers-visible to
notmuch-message-headers-visible.

I've never liked notmuch-show as a namespace prefix, but it looks
especially bad when it appears as "Notmuch Show Headers Visible" in
the customize buffer. Give nicer names to these variables which are
exported for user manipulation.

13 years agoemacs: Don't display From header by default.
Carl Worth [Sat, 24 Apr 2010 13:06:12 +0000 (06:06 -0700)]
emacs: Don't display From header by default.

This header is redundant with the summary-line of each message which
contains the same information.

13 years agoemacs: Allow user to customize which headers are visible.
Carl Worth [Sat, 24 Apr 2010 13:04:59 +0000 (06:04 -0700)]
emacs: Allow user to customize which headers are visible.

Continuing our tradition of making more and more of the notmuch
functionality configurable fromt eh customize interface.

13 years agoemacs: Change message headers (To, CC, From, and Date) to be visible by default
Carl Worth [Sat, 24 Apr 2010 12:48:04 +0000 (05:48 -0700)]
emacs: Change message headers (To, CC, From, and Date) to be visible by default

Users can still toggle these to be hidden by default, and can still
toggle visibility of headers for a single message with the 'h'
command.

13 years agoemacs: Allow headers to be shown by default in show mode
David Edmondson [Fri, 23 Apr 2010 11:54:21 +0000 (12:54 +0100)]
emacs: Allow headers to be shown by default in show mode

Add `notmuch-show-headers-visible' which, when set `t', causes headers
to be shown by default.

13 years agoremoved unused variables
Dirk Hohndel [Fri, 23 Apr 2010 03:26:46 +0000 (20:26 -0700)]
removed unused variables

trivial compiler warning fix

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoemacs: Add notmuch-address.el for address completion using notmuch
David Edmondson [Thu, 22 Apr 2010 09:03:43 +0000 (10:03 +0100)]
emacs: Add notmuch-address.el for address completion using notmuch

A tool `notmuch-addresses' is required to produce addresses which
match a query string. An example of a suitable script can be found in
the git repository at
    http://jkr.acm.jhu.edu/git/notmuch_addresses.git
There are no doubt others.

13 years agoemacs: Rename notmuch-show-toggle-all to notmuch-show-open-or-close-all
Carl Worth [Sat, 24 Apr 2010 00:27:14 +0000 (17:27 -0700)]
emacs: Rename notmuch-show-toggle-all to notmuch-show-open-or-close-all

The function was named and documented incorrectly before, saying that
it would "change the visibility of all messages". Instead it only
opens the messages that are closed---it doesn't simultanesously close
the messages that are open. (Granted, nobody would *want* that
behavior I don't think, but the naming was confusing before.)

13 years agoemacs/notmuch-show.el: Add `notmuch-show-toggle-all' bound to M-RET
David Edmondson [Thu, 22 Apr 2010 08:24:03 +0000 (09:24 +0100)]
emacs/notmuch-show.el: Add `notmuch-show-toggle-all' bound to M-RET

`notmuch-show-toggle-all' changes the visibility all of the messages
in the current thread. By default it makes all of the messages
visible. With a prefix argument, it makes them all not visible.

13 years agofix expected test result to include Bcc lines
Dirk Hohndel [Wed, 21 Apr 2010 21:55:58 +0000 (14:55 -0700)]
fix expected test result to include Bcc lines

this test actually tests behavior that I consider as broken.
The Bcc should be to the same address as used in the From line,
otherwise we are creating a potential information leak as email
that is related to one email account (say, work) is copied to
a different account

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
These tests don't actually pass yet, since the feature being tested
has not been merged. But gettting these tests in first will let us
more easily test that the feature actually works, (and will help us
ensure we don't forget the feature before the next release).

13 years agoadd From guessing tests to test suite
Dirk Hohndel [Wed, 21 Apr 2010 21:55:57 +0000 (14:55 -0700)]
add From guessing tests to test suite

right now these are not trying to be overly fancy
simply one test per strategy that we apply to figure out the best
from address - including the fallback if there's nothing to go on

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoemacs: Use single-quote not double-quote when constructing search
Carl Worth [Fri, 23 Apr 2010 23:39:18 +0000 (16:39 -0700)]
emacs: Use single-quote not double-quote when constructing search

Commit 44982ab33295009137e3740e644e793a08629762 added some extra
quoting when constructing a search. A previous version of this patch
had used single-quotation marks (') while this version used
double-quotation marks (").

The intent of the extra quoting was to allow notmuch-command to be set
to a script invoking ssh.

What actually happens, however is that the extra quotation marks make
it all the way into the query string seen by Xapian. And the double
quotes trigger phrase searching, (which isn't desired here). The
side-effect of that is that the emacs code would fallback to an
unqalified query and display all threads with all messages open.

We fix that side-effect now by using single-quote characters, but
we'll want a better fix in the future to avoid Xapian seeing these
characters at all I think.

13 years agoemacs: Re-arrange message sending code
David Edmondson [Thu, 22 Apr 2010 09:03:32 +0000 (10:03 +0100)]
emacs: Re-arrange message sending code

Define a new `mail-user-agent' (`notmuch-user-agent') and use it by
default. Re-arrange various routines that send mail to use this
(compose, reply, forward). Insert a `User-Agent:' header by default.

This is the real commit for this functionality this time. The
previous attempt to merge this code:

commit 57926bc7b0f784cbacb620fda0ee5157e2e0ff27

was botched (by Carl Worth, not David) to include only the Makefile
change. So the build was broken until this commit that actually adds
the new file.

13 years agotest: Set fixed time zone
Michal Sojka [Fri, 23 Apr 2010 07:36:45 +0000 (09:36 +0200)]
test: Set fixed time zone

When the test suite is run in a different time zone that where Carl
lives, some tests may fail depending on the time when the test suite is
run. For example, just now I get:

     Search for all messages ("*"):... FAIL
    --- test-031.expected 2010-04-23 09:33:47.898634822 +0200
    +++ test-031.output 2010-04-23 09:33:47.898634822 +0200
    @@ -1,5 +1,5 @@
    -thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Test message #6 (inbox unread)
    -thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Test message #14 (inbox unread)
    +thread:XXX   2001-01-06 [1/1] Notmuch Test Suite; Test message #6 (inbox unread)
    +thread:XXX   2001-01-06 [1/1] Notmuch Test Suite; Test message #14 (inbox unread)
     thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unread)
     thread:XXX   2000-01-01 [1/1] searchbyfrom; search by from (inbox unread)
     thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread)

By setting a fixed time zone in the test script, these problems should
be eliminated.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
13 years agoemacs: Push the cursor to point-max on `n' or `N' at the end of a thread
David Edmondson [Thu, 22 Apr 2010 11:20:16 +0000 (12:20 +0100)]
emacs: Push the cursor to point-max on `n' or `N' at the end of a thread

Sebastian pointed out that the pre-JSON UI would move the cursor to
the end of the buffer if `n' or `N' is hit when on the last (unread)
message. Mimic that behaviour in the new UI.

13 years agoemacs: Re-arrange message sending code
David Edmondson [Thu, 22 Apr 2010 09:03:32 +0000 (10:03 +0100)]
emacs: Re-arrange message sending code

Define a new `mail-user-agent' (`notmuch-user-agent') and use it by
default. Re-arrange various routines that send mail to use this
(compose, reply, forward). Insert a `User-Agent:' header by default.

13 years agoemacs: Fix some compilation warnings.
Carl Worth [Fri, 23 Apr 2010 19:57:22 +0000 (12:57 -0700)]
emacs: Fix some compilation warnings.

Fix missing argumen in declaration of notmuch-search function and add
a definition of notmuch-search-continuation to avoid warning about
assignment to a free variable.

13 years agoemacs: Add notmuch-hello.el, a friendly frontend to notmuch
David Edmondson [Thu, 22 Apr 2010 08:27:33 +0000 (09:27 +0100)]
emacs: Add notmuch-hello.el, a friendly frontend to notmuch

This is based on the prototype that Carl Worth described in the TODO
file. It provides a search bar as well as support for recent searches,
saved searches, and a list of all tags in the database (as well as the
number of messages with each tag).

13 years agoemacs: Remove `notmuch-search-authors-width' and fix the use of `notmuch-search-resul...
David Edmondson [Fri, 23 Apr 2010 10:24:09 +0000 (11:24 +0100)]
emacs: Remove `notmuch-search-authors-width' and fix the use of `notmuch-search-result-format' accordingly

The width of the authors field in search output was previously
specified in two places:
 - `notmuch-search-authors-width': the limit beyond which the authors
   names are truncated,
 - `notmuch-search-result-format': the layout of the search results.

Changing the configuration of one of these may have required the user
to know about and adapt the other accordingly. This led to confusion.

Instead, remove `notmuch-search-authors-width' and perform truncation
based on the relevant field in `notmuch-search-result-format'.

Approved-By: Jameson Rollins <jrollins@finestructure.net>
13 years agoReintroduce patch to quote args in notmuch-show to facilitate remote use
Jesse Rosenthal [Wed, 21 Apr 2010 21:22:08 +0000 (17:22 -0400)]
Reintroduce patch to quote args in notmuch-show to facilitate remote use

This reintroduces the patch committed in 9193455fa1, which was
reverted during the upgrade to the JSON emacs UI.

13 years agonotmuch setup: Prompt for tags to set on new messages.
Carl Worth [Fri, 23 Apr 2010 17:30:40 +0000 (10:30 -0700)]
notmuch setup: Prompt for tags to set on new messages.

Our "notmuch setup" command is only really helpful if it guides the
user through all the possible options. So add this one.

13 years agoconfig: Rename messages.new_tags to just new.tags
Carl Worth [Fri, 23 Apr 2010 17:29:28 +0000 (10:29 -0700)]
config: Rename messages.new_tags to just new.tags

I think one configuration group for each top-level command makes a lot
of sense. And this makes the existing naming of set_new_tags and
get_new_tags also very reasonable.

13 years agoClarify the documentation for the new_tags configuration option.
Carl Worth [Fri, 23 Apr 2010 16:28:45 +0000 (09:28 -0700)]
Clarify the documentation for the new_tags configuration option.

Specifically mentioning that it's a list separated by ';' and use
"will" instead of "should".

13 years agonotmuch setup: Fix new configuration-file groups to get comments
Carl Worth [Fri, 23 Apr 2010 16:20:40 +0000 (09:20 -0700)]
notmuch setup: Fix new configuration-file groups to get comments

Our intent has always been that when new configuration-file settings
are created by notmuch, that they get created with comments telling
the user how to use them. But this was only working before when the
entire configuration file was created.

We fix this so that when a new group is added, (such as the recently-
added [messages] section) that it gets its documentation.

13 years agoSprinkle some const-correctness around new_tags.
Carl Worth [Fri, 23 Apr 2010 16:19:52 +0000 (09:19 -0700)]
Sprinkle some const-correctness around new_tags.

To eliminate a compiler warning.

13 years agonotmuch-config: make new message tags configurable
Ben Gamari [Fri, 12 Mar 2010 22:13:26 +0000 (17:13 -0500)]
notmuch-config: make new message tags configurable

Add a new_tags option in the [messages] section of the configuration
file to allow the user to specify which tags should be added to new
messages by notmuch new.

13 years agopython: Add UNSORTED as Query.SORT option
Sebastian Spaeth [Fri, 23 Apr 2010 11:37:08 +0000 (13:37 +0200)]
python: Add UNSORTED as Query.SORT option

Keep up to date with the libnotmuch.so API.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agopython: Delete unused files
Sebastian Spaeth [Fri, 23 Apr 2010 11:34:38 +0000 (13:34 +0200)]
python: Delete unused files

No more .hg files needed in the git repo.
No stock notmuch-test suite needed in a subdirectory.
We have the real one in this repository

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
14 years agotest: Put the json tests into their own section.
Carl Worth [Fri, 23 Apr 2010 00:17:11 +0000 (17:17 -0700)]
test: Put the json tests into their own section.

Not that the sections actually mean anything yet, but it makes for
clean output.

14 years agonotmuch search: Fix timezone of timestamp in --format=json output
Carl Worth [Fri, 23 Apr 2010 00:06:25 +0000 (17:06 -0700)]
notmuch search: Fix timezone of timestamp in --format=json output

This is one of those cases that I move love. Deleting code fixes
a bug, (test suite now passes again).

14 years agoFirst tests for JSON output and UTF-8 in mail body and subject
Gregor Hoffleit [Tue, 13 Apr 2010 16:37:57 +0000 (18:37 +0200)]
First tests for JSON output and UTF-8 in mail body and subject

The test suite doesn't yet cover --format=json output nor UTF-8 in
subject or body.

This patch starts with test cases for 'search --format=json' and
'show --format=json'.

Furthermore, it has test cases for a search for a UTF-8 string in a mail
body for a UTF-8 string in a mail subject.

Finally, it has a test case for --format=json with UTF-8 messages,
demonstrating the fix in 1267697893-sup-4538@sam.mediasupervision.de.

Reviewed-by: Carl Worth <cworth@cworth.org>
Updated tests to current implementation of the test suite.
These tests demonstrate a bug in the current implementation
of "notmuch show --format=json", (timestamp output is changed
depending on current timezone).

14 years agotest: Make existing "notmuch show" test more resilient
Carl Worth [Fri, 23 Apr 2010 00:08:08 +0000 (17:08 -0700)]
test: Make existing "notmuch show" test more resilient

If future updates to the test suite add more messages to the database
before this "notmuch show" test, then the message-ID numbers in the
expected output will all change. But we can at least compute the
numbers so that this test will continue to pass.

14 years agojson: Replace `date_unix' with `timestamp' in show output
David Edmondson [Fri, 16 Apr 2010 11:47:49 +0000 (12:47 +0100)]
json: Replace `date_unix' with `timestamp' in show output

Search output was already using `timestamp' for a very similar field,
so follow that.

14 years agoemacs: Add customize treatment and rename refresh-script to notmuch-poll-script
Carl Worth [Thu, 22 Apr 2010 21:46:15 +0000 (14:46 -0700)]
emacs: Add customize treatment and rename refresh-script to notmuch-poll-script

With defcustom the user can easily find this variable (and its
documentation) within "M-x customize-group" "notmuch" (though finding
*that* is still tricky).

The new name of notmuch-poll-script is also easier to remember, (for
me at least).

14 years agoemacs: Use consistent naming for the two new poll functions.
Carl Worth [Thu, 22 Apr 2010 21:24:37 +0000 (14:24 -0700)]
emacs: Use consistent naming for the two new poll functions.

Emacs scoping rules strongly encourage us to have fully-namespaced
function names. A prefix like "notmuch-search" is a pretty ugly
namespace name, but it's what we have for now.

14 years agoAdd 'G' keybinding to folder and search view that triggers external poll
Dirk Hohndel [Fri, 9 Apr 2010 19:53:26 +0000 (12:53 -0700)]
Add 'G' keybinding to folder and search view that triggers external poll

The new functions first check if an external poll script has been defined in
the variable 'notmuch-external-refresh-script and if yes, runs that script
before executing the existing refresh function (which is bound to '=')

This can be used to have 'G' mimic the mutt behavior of polling an external
mail server - or if the mail polling is already automatic, it can trigger
the call to notmuch new and any necessary automatic tagging of new email.

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
14 years agoRevert "thread: Simplify code for assigning the subject."
Carl Worth [Thu, 22 Apr 2010 21:00:44 +0000 (14:00 -0700)]
Revert "thread: Simplify code for assigning the subject."

This reverts commit 36e4459a328b8449b3e9d510be81a332a9b35aaa.

With the two previous reverts, this fixes the recent message-sorting
regression, so the test suite now passes again.

14 years agoRevert "thread: Fix sort of search when constructing threads."
Carl Worth [Thu, 22 Apr 2010 21:00:33 +0000 (14:00 -0700)]
Revert "thread: Fix sort of search when constructing threads."

This reverts commit f43990ce134d838cdb2cdd5d0752a602e81cfdd9.

14 years agoRevert "thread: Removed unsed sort argument from _thread_add_matched_message"
Carl Worth [Thu, 22 Apr 2010 21:00:17 +0000 (14:00 -0700)]
Revert "thread: Removed unsed sort argument from _thread_add_matched_message"

This reverts commit 7fb56f9dc5d8e66f717f5e48ecbfbc11c8190182.

14 years agotest: Add a test to demonstrate message-sorting regression.
Carl Worth [Thu, 22 Apr 2010 20:26:37 +0000 (13:26 -0700)]
test: Add a test to demonstrate message-sorting regression.

In the recent change to rename threads based on changing subject
lines, I broke message ordering within "notmuch show" output. But our
test suite didn't catch that regressions, because we didn't have any
tests of "notmuch show".

This adds one "notmuch show" test along with the thread-naming
tests. It's not a whole suite of "notmuch show" testing, but it does
catch this regression at least.

14 years agotest: When a test fails, show diff only (save complete output to a file)
Carl Worth [Thu, 22 Apr 2010 20:22:08 +0000 (13:22 -0700)]
test: When a test fails, show diff only (save complete output to a file)

We're starting to get test output that's fairly long, so it's much
kinder to just show a diff rather than displaying the complete
expected and actual output. To allow the user to investigate things
after the fact, we save the expected and actual output to files named
test-${test_number}.expected and test-${test_number}.output .

14 years agotest: Improve grammar in test-message subjects.
Carl Worth [Thu, 22 Apr 2010 20:21:15 +0000 (13:21 -0700)]
test: Improve grammar in test-message subjects.

Before codifying these in any expected test output, I'd like them to
at least resemble English.

14 years agoFix help message for "show"
Jameson Rollins [Wed, 21 Apr 2010 15:49:21 +0000 (11:49 -0400)]
Fix help message for "show"

Help message for "show" mistakenly refers to '--output' instead of
'--format'.

14 years agoMerge Sebastian Spaeth's python bindings into bindings/python
Carl Worth [Thu, 22 Apr 2010 00:29:48 +0000 (17:29 -0700)]
Merge Sebastian Spaeth's python bindings into bindings/python

Sebastian offered to maintain these bindings within the notmuch
repository and offered them in the following repository:

git://github.com/spaetz/python-notmuch.git

These are the bindings formerly known as "cnotmuch" and now known
simply as "notmuch" from within python.

The bindings are not yet integrated into the build system and
packaging of the primary ntomuch repository.

14 years agoMove everything down into a bindings/python directory.
Carl Worth [Thu, 22 Apr 2010 00:23:49 +0000 (17:23 -0700)]
Move everything down into a bindings/python directory.

In preparation for merging the python bindings into the notmuch
repository.

14 years agothread: Removed unsed sort argument from _thread_add_matched_message
Carl Worth [Thu, 22 Apr 2010 00:05:16 +0000 (17:05 -0700)]
thread: Removed unsed sort argument from _thread_add_matched_message

The reworked solution for naming a thread based on the subject of
oldest/newest matching message no longer needs this argument.

14 years agoemacs: Move definition of notmuch-folders to earlier in the file.
Carl Worth [Thu, 22 Apr 2010 00:04:36 +0000 (17:04 -0700)]
emacs: Move definition of notmuch-folders to earlier in the file.

To avoid a warning about a free variable from the emacs compiler.

14 years agoemacs: Try to name search buffers using info in notmuch-folders
Servilio Afre Puentes [Mon, 19 Apr 2010 03:55:50 +0000 (23:55 -0400)]
emacs: Try to name search buffers using info in notmuch-folders

As the user has already defined aliases for certain searches in
notmuch-folders, search buffer names that use these aliases will
be easier to identify.

14 years agonotmuch-tag: don't sort messages before applying tag changes
Sebastian Spaeth [Fri, 16 Apr 2010 06:38:48 +0000 (08:38 +0200)]
notmuch-tag: don't sort messages before applying tag changes

It's not neccessary to sort the results before we apply tags. Xapian
contributor Olly Betts says that savings might be bigger with a cold
file cache and (as unsorted implies really sorted by document id) a better
cache locality when applying tags to messages.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
14 years agoquery.cc: allow to return query results unsorted
Sebastian Spaeth [Fri, 16 Apr 2010 06:38:46 +0000 (08:38 +0200)]
query.cc: allow to return query results unsorted

Previously, we always sorted the returned results by some string value,
(newest-to-oldest by default), however in some cases (as when applying
tags to a search result) we are not interested in any special order.

This introduces a NOTMUCH_SORT_UNSORTED value that does just that. It is
not used at the moment anywhere in the code.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
14 years agonotmuch: Abort if specified configuration file is not found.
Carl Worth [Wed, 21 Apr 2010 22:54:03 +0000 (15:54 -0700)]
notmuch: Abort if specified configuration file is not found.

When there is no configuration file at all, (and none specified),
notmuch works correctly by assuming correct default values. But when
the user specifies a configuration file (with the NOTMUCH_CONFIG
environment variable) and that file doesn't exist, then notmuch should
aboirt and let the user know about the problem.

14 years agothread: Fix sort of search when constructing threads.
Carl Worth [Wed, 21 Apr 2010 22:52:28 +0000 (15:52 -0700)]
thread: Fix sort of search when constructing threads.

The thread-naming feature depends on the matched messages being passed
down in a precise order, (the order of the top-level search). We fix
the feature by passing that sort order down.

14 years agotest: Add tests for naming threads with changing subjects.
Carl Worth [Wed, 21 Apr 2010 22:50:33 +0000 (15:50 -0700)]
test: Add tests for naming threads with changing subjects.

We recently added a feature to name threads based on the messages that
actually matched the search, (as opposed to simply the oldest or
newest message in the thread whether it matched or not). So add tests
for that, and (surprise, surprise!) the feature does not entirely
work.

14 years agothread: Simplify code for assigning the subject.
Carl Worth [Wed, 21 Apr 2010 22:06:02 +0000 (15:06 -0700)]
thread: Simplify code for assigning the subject.

We know that matched messages are always added in order, so we can
always just grab the subject from the first message. This is the same
approach that was used previously in _thread_add_message. That is, the
recent feature of renaming a thread based on the subject of the
"first" matched message is as simple as moving the subject assignment
from _thread_add_message to _thread_add_matched_message.

14 years agoName thread based on matching msgs instead of first msg.
Jesse Rosenthal [Sat, 17 Apr 2010 17:59:22 +0000 (13:59 -0400)]
Name thread based on matching msgs instead of first msg.

At the moment all threads are named based on the name of the first message
in the thread. However, this can cause problems if people either start
new threads by replying-all (as unfortunately, many out there do) or
change the subject of their mails to reflect a shift in a thread on a
list.

This patch names threads based on (a) matches for the query, and (b) the
search order. If the search order is oldest-first (as in the default
inbox) it chooses the oldest matching message as the subject. If the
search order is newest-first it chooses the newest one.

Reply prefixes ("Re: ", "Aw: ", "Sv: ", "Vs: ") are ignored
(case-insensitively) so a Re: won't change the subject.

Note that this adds a "sort" argument to _notmuch_thread_create and
_thread_add_matched_message, so that when constructing the thread we can
be aware of the sort order.

Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
14 years agoconfigure: Print version of Xapian found during configure check.
Carl Worth [Wed, 21 Apr 2010 21:18:56 +0000 (14:18 -0700)]
configure: Print version of Xapian found during configure check.

This might be handy to know, (since there are important performance
considerations that depend on the Xapian version).

14 years agoconfigure: Generalize the GMime configure checks.
Carl Worth [Wed, 21 Apr 2010 21:14:36 +0000 (14:14 -0700)]
configure: Generalize the GMime configure checks.

This way when GMime 2.8 comes out we can simply add it to the list
rather than adding an additional block of conditional code for it.
Also GMime 2.6 is now preferred over GMime 2.4.

14 years agoconfigure: Add support for GMime 2.6
Adrien Bustany [Thu, 15 Apr 2010 23:41:55 +0000 (19:41 -0400)]
configure: Add support for GMime 2.6

Notmuch compiles just fine with GMime 2.6, so accept it in the configure
script.

14 years agoemacs: Fix notmuch-search-authors-width declaration.
Carl Worth [Wed, 21 Apr 2010 21:16:20 +0000 (14:16 -0700)]
emacs: Fix notmuch-search-authors-width declaration.

Our defcustom call was missing the 'notmuch group, which emacs was
nice enough to warn about during compilation.

14 years agoemacs: Support for customizing search result display
David Edmondson [Mon, 12 Apr 2010 07:51:30 +0000 (08:51 +0100)]
emacs: Support for customizing search result display

This patch helps in customizing search result display similar to
mutt's index_format. The customization is done by defining an alist as
below:

(setq notmuch-search-result-format '(("date" . "%s ")
     ("authors" . "%-40s ")
     ("subject" . "%s ")))

The supported keywords are date, count, authors, subject and tags.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: David Edmondson <dme@dme.org>
14 years agoemacs/notmuch-show.el: Part headers are real buttons that save the part
Carl Worth [Wed, 21 Apr 2010 20:19:19 +0000 (13:19 -0700)]
emacs/notmuch-show.el: Part headers are real buttons that save the part

Convert the part headers into buttons that save the part when
activated.

14 years agoemacs: Display all body parts using `notmuch part --part=<n>'
David Edmondson [Thu, 1 Apr 2010 17:33:46 +0000 (18:33 +0100)]
emacs: Display all body parts using `notmuch part --part=<n>'

Use the `notmuch part' command to access body parts not currently
included in the JSON output and display those body parts
appropriately.

14 years agoemacs: Use mailcap.el to guess the type of application/octet-stream parts
David Edmondson [Tue, 23 Mar 2010 11:54:05 +0000 (11:54 +0000)]
emacs: Use mailcap.el to guess the type of application/octet-stream parts

Use the mailcap functionality to guess a MIME type for attachments of
type application/octet-stream and, presuming successful, feed the
attachment back into the display code with the determine type.

This is mostly useless at the moment, as the JSON output from notmuch
does not include the content of application/octet-stream parts, so
they cannot be displayed even if the guess is a good one.