]> git.notmuchmail.org Git - notmuch/log
notmuch
13 years agodebian: Instruct git-buildpackage that it's OK to build from this branch 0.3.1
Carl Worth [Wed, 28 Apr 2010 00:04:52 +0000 (17:04 -0700)]
debian: Instruct git-buildpackage that it's OK to build from this branch

I wish I had something with better support for a native Debian package
here. I shouldn't ever have to configure any branch---I just want it
to build a package from the current branch. Instead it makes me tell
it (twice!) what the current branch actually is.

13 years agodebian/changelog: Copy in content from the NEWS file.
Carl Worth [Wed, 28 Apr 2010 00:02:17 +0000 (17:02 -0700)]
debian/changelog: Copy in content from the NEWS file.

Someday we'll automate this step.

13 years agoIncrement version to 0.3.1
Carl Worth [Wed, 28 Apr 2010 00:00:34 +0000 (17:00 -0700)]
Increment version to 0.3.1

For our 0.3.1 bug-fix release.

13 years agoNEWS: Reword the latest bug description slightly.
Carl Worth [Tue, 27 Apr 2010 23:56:24 +0000 (16:56 -0700)]
NEWS: Reword the latest bug description slightly.

"Still needs to be handled correctly" could be misread to suggest that
the bug has not actually been fixed yet. So clarify what is actually
meant here, (that the bug is unlikely but we're still motivated to fix
it).

13 years agoUpdate NEWS to reflect the SEGV bugfix
Dirk Hohndel [Tue, 27 Apr 2010 23:29:23 +0000 (16:29 -0700)]
Update NEWS to reflect the SEGV bugfix

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoFix SEGV in _thread_cleanup_author if author ends with ', '
Dirk Hohndel [Tue, 27 Apr 2010 23:29:22 +0000 (16:29 -0700)]
Fix SEGV in _thread_cleanup_author if author ends with ', '

Admittedly, an author name ending in ',' guarantees this is spam, and
indeed this was triggered by a spam email, but that doesn't mean we
shouldn't handle this case correctly.
We now check that there is actually a component of the name (presumably
the first name) after the comma in the author name.

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoNEWS: Add notes for the 0.3.1 release
Carl Worth [Tue, 27 Apr 2010 18:12:25 +0000 (11:12 -0700)]
NEWS: Add notes for the 0.3.1 release

This is going to be a bug-fix only release to fix the handful of issue
noticed immediately after 0.3 was pushed out.

13 years agoWrap the compat header in extern "C" { } when compiling C++ sources
Tomas Carnecky [Tue, 27 Apr 2010 17:27:17 +0000 (19:27 +0200)]
Wrap the compat header in extern "C" { } when compiling C++ sources

This fixes a build error on OpenSolaris where the final liking of
notmuch fails because the linker can't find strcasestr() referenced
from thread.cc.
(cherry picked from commit aab54b4ce752b16725399d1543602ef3f7736c91)

13 years agoemacs: Remove conditional from notmuch-fcc-initialization.
Jesse Rosenthal [Tue, 27 Apr 2010 16:33:57 +0000 (12:33 -0400)]
emacs: Remove conditional from notmuch-fcc-initialization.

The fcc code would only initialize if notmuch-fcc-dirs was set. This was
a problem if you reset the variable, or added the variable later during
initialization. Now we always add the fcc hook, but it doesn't do
anything unless notmuch-fcc-dirs are set.
(cherry picked from commit 80a90787163690d2d87571327ba504a470798c60)

13 years agoemacs: Fix `notmuch-hello-insert-tags' to correctly draw the tags.
David Edmondson [Tue, 27 Apr 2010 10:04:37 +0000 (11:04 +0100)]
emacs: Fix `notmuch-hello-insert-tags' to correctly draw the tags.

The fix in 1e1871154341cdd3413fe3f32e3aae477826d815 broke end-of-row
wrapping when drawing the table of tags/saved searches. Fix that and
improve the readability of the matrix reflection code to hasten future
debugging.
(cherry picked from commit 08561d8ae133704fcf15edbdd47f15474dc030d5)

13 years agoemacs: If 'all tags' is not shown, don't use it when calculating widths.
David Edmondson [Tue, 27 Apr 2010 10:04:36 +0000 (11:04 +0100)]
emacs: If 'all tags' is not shown, don't use it when calculating widths.

If the 'all tags' section of the hello buffer will not be shown, don't
consider those tags when determining the number of saved searches that
can be displayed on a single line.
(cherry picked from commit 18d41192d2cf0c71045c2f6420eb2311553f58b4)

13 years agoRename already used counter var i
Aneesh Kumar K.V [Tue, 27 Apr 2010 12:57:25 +0000 (14:57 +0200)]
Rename already used counter var i

i is already used in a for loop at this point, so using i here again
broke notmuch-reply (it would just hang). Use j instead of i here.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
(cherry picked from commit 107f58d517e733c53e9d669457db34622337931d)

13 years agotest: Exercise magic-from guessing with a single configured address
Carl Worth [Tue, 27 Apr 2010 17:13:04 +0000 (10:13 -0700)]
test: Exercise magic-from guessing with a single configured address

Immediately after releasing 0.3 we learned that the magic-from-guessing
code could hang in an infinite loop in some cases. The bug occurred
only when the user had configured only a primary email addresss and no
other email addresses.

The test suite wasn't previously covering this case, so address this
shortcoming.
(cherry picked from commit e0f561049809f2b29068d59b38fce3213131bbd6)

13 years agodebian/changelog: Fix email address to avoid lintian complaint. 0.3
Carl Worth [Tue, 27 Apr 2010 09:10:17 +0000 (02:10 -0700)]
debian/changelog: Fix email address to avoid lintian complaint.

Otherwise lintian thinks this is an NMU. I definitely need to figure
out how to get the emacs mode for debian/changelog to write the
correct address into this file in the first place.

13 years agodebian/changelog: Add notes for the 0.3 release
Carl Worth [Tue, 27 Apr 2010 09:07:45 +0000 (02:07 -0700)]
debian/changelog: Add notes for the 0.3 release

Again, just taking the one-line entries from the NEWS entry for 0.3.

13 years agoIncrement package version to 0.3.
Carl Worth [Tue, 27 Apr 2010 09:03:26 +0000 (02:03 -0700)]
Increment package version to 0.3.

For the 0.3 release, of course.

13 years agolib: Increment library version to 1.1.0
Carl Worth [Tue, 27 Apr 2010 09:02:14 +0000 (02:02 -0700)]
lib: Increment library version to 1.1.0

For the addition of the new NOTMUCH_SORT_UNSORTED value.

13 years agoemacs: Fix column alignment in `notmuch-hello-insert-tags'
David Edmondson [Tue, 27 Apr 2010 07:00:44 +0000 (08:00 +0100)]
emacs: Fix column alignment in `notmuch-hello-insert-tags'

Re-working the saved search/tag insertion to buttonize only the name
of the saved search/tag plus one space broke the calculation of how
much filler is required to complete the column, resulting in lines
wider than the window.

13 years agolib: Re-implement moving of thread authors.
Carl Worth [Tue, 27 Apr 2010 08:48:03 +0000 (01:48 -0700)]
lib: Re-implement moving of thread authors.

Just before releasing 0.3 we received reports of crashes that were
bisected to the commit adding thread-author moving. Sure enough,
valgrind pointed to buffer overruns in _thread_move_matched_author.

Rather than trying to make sense of all the by strncpy, strchr, +1,
and +2 of that code, I reimplemented thread-author ordering with a
pair of hash tables and an array.

Valgrind is at least happy now on the test cases it was complaining
about previously.

13 years agoNEWS: Fix spelling errors.
Carl Worth [Tue, 27 Apr 2010 07:55:06 +0000 (00:55 -0700)]
NEWS: Fix spelling errors.

I ran the spell-checker prior to the last commit, but apparently I
hadn't actually saved the buffer.

13 years agoNEWS: Add notes for the 0.3 release.
Carl Worth [Tue, 27 Apr 2010 07:47:14 +0000 (00:47 -0700)]
NEWS: Add notes for the 0.3 release.

Summarizing all the major new features and fixes found in the git log
since 0.2. A rather nice list, really.

13 years agoemacs: Use message-signature-separator rather than hard-coded string.
Carl Worth [Tue, 27 Apr 2010 06:12:58 +0000 (23:12 -0700)]
emacs: Use message-signature-separator rather than hard-coded string.

It's possible that the user has instructed message-mode to use some
other separator. If so, then that's what we should look for when
looking for the signature.

Thanks to David Edmondson <dme@dme.org> for pointing this out.

13 years agoemacs: Delete some trailing whitespace.
Carl Worth [Tue, 27 Apr 2010 06:09:08 +0000 (23:09 -0700)]
emacs: Delete some trailing whitespace.

That managed to sneak in with some recent improvements to the Fcc code.

13 years agoemacs: Ensure that message-directory for Fcc has a trailing slash
Jesse Rosenthal [Tue, 27 Apr 2010 03:08:34 +0000 (23:08 -0400)]
emacs: Ensure that message-directory for Fcc has a trailing slash

Use `file-name-as-directory' to ensure that message-directory has a
trailing slash so it can be combined with the notmuch-fcc-dirs
correctly.

13 years agoemacs: add prompt to create maildir for fcc if it does not exist.
Jesse Rosenthal [Tue, 27 Apr 2010 01:33:13 +0000 (21:33 -0400)]
emacs: add prompt to create maildir for fcc if it does not exist.

If the user specifies a maildir that does not exist, prompt the user to
see whether a maildir should be created. This will fail, with the
relevant explanation, if the location is not writable, or if a file
already exists in that location. If the location is a dir, but not a
maildir, this will add /tmp/cur/new to it.

13 years agoemacs: fcc should fail at the right time if it doesn't point to a maildir
Jesse Rosenthal [Tue, 27 Apr 2010 00:29:27 +0000 (20:29 -0400)]
emacs: fcc should fail at the right time if it doesn't point to a maildir

Throw an error after the maildir is generated but before the message
is sent. This change allows the user to edit the maildir if it fails,
so that it will point to a correct place.

Note that this changes the previous behavior which always overwrote
the existing Fcc line. Now, an Fcc line is only auto-generated if
there isn't one already there.

The ideal change would be to prompt to create a maildir. This should
enable a place for doing that in a future patch.

13 years agoemacs: Tweak search-buffer naming to search list in reverse order
Carl Worth [Tue, 27 Apr 2010 06:00:20 +0000 (23:00 -0700)]
emacs: Tweak search-buffer naming to search list in reverse order

The complete-string matching of commit
f2ebe3ac446afda9ced6507dc391865464ccdcaa
defeats the substitution of partial search
strings when the user manually types a
long search string that just happens to
partially match a saved search.

For example, typing "tag:inbox and not tag:foo"
should result in "[inbox] and not tag:foo" but
this has been broken since that commit.

As a compromise between this feature and what the
commit was trying to achieve, we now reverse the
saved-searches list before looking for a match.
This happens to work for me, but won't necessarily
work in general.

What we really want is the longest match, but rassoc-if
just gives us the first match. All of this is just about
creating slightly nice search-buffer names. So if anyone
really cares about making the names *even* nicer, then
they could improve this further.

13 years agoemacs: Rename search buffers with "saved-search" not "folder"
Carl Worth [Tue, 27 Apr 2010 05:58:46 +0000 (22:58 -0700)]
emacs: Rename search buffers with "saved-search" not "folder"

Since we recently renamed everything from notmuch-folders to
notmuch-saved-searches, fix up the generated names in the search
buffers to match.

13 years agoemacs: Match entire saved-search when computing search-view buffer name
Carl Worth [Tue, 27 Apr 2010 05:49:45 +0000 (22:49 -0700)]
emacs: Match entire saved-search when computing search-view buffer name

I happen to have a lot of saved searches that are variants of the
tag:inbox search, (such as "tag:inbox and tag:notmuch"). The logic for
these was always matching inbox first, resulting in "[ inbox ] and
tag:notmuch" rather than "notmuch" as desired.

Anchor the regular expression on both ends to make it look harder for
the better match.

13 years agoemacs: Rip out all of the notmuch-folder code.
Carl Worth [Tue, 27 Apr 2010 05:42:07 +0000 (22:42 -0700)]
emacs: Rip out all of the notmuch-folder code.

We are asserting that the new notmuch-hello implementation, (available
by just calling `notmuch') is just as easy to use as the old
notmuch-folder. So let's remove what's now a largely redundant
implementation.

To make this transition easier, we are still supporting the
notmuch-folders variable name, and we still provide `notmuch-folder'
as an alias which can be invoked to get the new notmuch-hello
functionality.

13 years agoemacs: Fix notmuch-hello to use its own function for counting search results.
Carl Worth [Tue, 27 Apr 2010 05:40:31 +0000 (22:40 -0700)]
emacs: Fix notmuch-hello to use its own function for counting search results.

Previously, this was calling into a notmuch-folder-count
function. Only, everything related to notmuch-folder is about to go
away, so lets have notmuch-hello define its own function
(notmuch-saved-search-count) for this purpose.

13 years agoemacs: Add a notmuch-saved-searches function.
Carl Worth [Tue, 27 Apr 2010 05:37:11 +0000 (22:37 -0700)]
emacs: Add a notmuch-saved-searches function.

We use this function to abstract away the common 3-step process for
looking for a value for the saved-searches variable:

1. Look at the notmuch-saved-searches variable itself
2. Look at the notmuch-folders vaiable
3. Use a default value

We were already using this logic (open-coded) in notmuch-hello, but
notmuch.el was accessing notmuch-folders directly for the clever name
selection of search buffers.

13 years agoemacs: Move declare-function from notmuch-lib.el to notmuch-hello.el.
Carl Worth [Tue, 27 Apr 2010 05:33:09 +0000 (22:33 -0700)]
emacs: Move declare-function from notmuch-lib.el to notmuch-hello.el.

Apparently the declare-function macro doesn't work in a required file
as I might like it too. Put it where it needs to go to avoid the
warning.

13 years agonotmuch-hello: Add a 'G' keybinding.
Carl Worth [Tue, 27 Apr 2010 05:05:47 +0000 (22:05 -0700)]
notmuch-hello: Add a 'G' keybinding.

Just like the G keybinding we've had in notmuch-folder-mode and
notmuch-search-mode, (to call `notmuch-poll' to 'G'et new mail).

13 years agonotmuch-hello: Make this work with a notmuch-folders variable set in ~/.emacs
Carl Worth [Tue, 27 Apr 2010 04:55:51 +0000 (21:55 -0700)]
notmuch-hello: Make this work with a notmuch-folders variable set in ~/.emacs

I'm planning to rip out the notmuch-folder-mode completely. So as a
token kindness to existing users of notmuch-folders, I'm at least
making notmuch-hello support the notmuch-folders variable name as an
alternate for the new name of notmuch-saved-searches.

13 years agoemacs: Remove "hello" from all variables exported through customize.
Carl Worth [Tue, 27 Apr 2010 04:45:19 +0000 (21:45 -0700)]
emacs: Remove "hello" from all variables exported through customize.

We've recently changed things so that the notmuch-hello screen is the
default view one gets by executing `notmuch'. So hide the "hello" name
from everything exposed in the customize interface, (leaving "hello"
as just an internal name within the implementation).

13 years agonotmuch-hello: Fix a sign error when computing number of padding spaces.
Carl Worth [Tue, 27 Apr 2010 03:51:31 +0000 (20:51 -0700)]
notmuch-hello: Fix a sign error when computing number of padding spaces.

After the previous commit, toggling the visibility of tags could
result in notmuch-hello aborting with:

Wrong type argument: wholenump, -1

At least, the error only occurred for me when making tags visible. But
that may be because my longest tag name is longer than my longest
saved-search name.

13 years agonotmuch-hello: Fix ability to isearch to a saved-search and press RET
Carl Worth [Tue, 27 Apr 2010 03:15:45 +0000 (20:15 -0700)]
notmuch-hello: Fix ability to isearch to a saved-search and press RET

After isearching for an entire saved-search name, the point will be
immediately after that name in the buffer. Before commit
c9ba61bebef7733c4bf12adf94222e57621fdcf6 the space right after the
name was part of the widget so the user could press RET right after
the isearch to activate the saved search.

The above commit broke that functionality. Restore it by including a
single space after each name as part of the widget.

13 years agoemacs: notmuch-hello: Make viewing of all tags conditional.
Carl Worth [Tue, 27 Apr 2010 03:06:50 +0000 (20:06 -0700)]
emacs: notmuch-hello: Make viewing of all tags conditional.

And off by default. There's a notmuch-hello-show-tags option in
customize to toggle the default setting, as well as buttons to
persistently toggle the visibility for the current session.

I have enough tags in my database that it's quite a bit faster for
notmuch-hello to come up without showing the tags.

13 years agonotmuch-hello: Preserve current position when invoking notmuch-hello
Carl Worth [Tue, 27 Apr 2010 02:43:21 +0000 (19:43 -0700)]
notmuch-hello: Preserve current position when invoking notmuch-hello

Previously, we preserved the current position only when returning to
the notmuch-hello buffer or when refreshing it. Fix to also preserve
the position when directly invoking notmuch-hello, (such as from a
global keybinding).

13 years agoemacs: notmuch-hello: Move to first saved search item.
Carl Worth [Tue, 27 Apr 2010 01:40:04 +0000 (18:40 -0700)]
emacs: notmuch-hello: Move to first saved search item.

This give us a useful active widget by default, ("inbox"), and
otherwise gives the first saved search in the user's customized
list. Not having point on the search bar means that the various
keybindings are all available.

13 years agoemacs: Fix 's' keybinding to go to search bar in notmuch-hello.
Carl Worth [Tue, 27 Apr 2010 01:52:49 +0000 (18:52 -0700)]
emacs: Fix 's' keybinding to go to search bar in notmuch-hello.

This command was previously written under the fragile assumption that
the search bar was always the third widget. That's no longer true with
the saved searches now appearing before the search bar, so we save the
position of the search bar and go directly to it now.

13 years agoemacs: Move saved searches before search bar in notmuch-hello.
Carl Worth [Tue, 27 Apr 2010 01:22:24 +0000 (18:22 -0700)]
emacs: Move saved searches before search bar in notmuch-hello.

Once users start using saved searches regularly, it's expected that
these will become the primary access points to mail. So give them a
priority position in the buffer.

13 years agoemacs: Remove the notmuch-hellow-jump-to-search variable.
Carl Worth [Tue, 27 Apr 2010 01:17:06 +0000 (18:17 -0700)]
emacs: Remove the notmuch-hellow-jump-to-search variable.

Instead, make notmuch-hello unconditionally jump to the first widget
in the buffer. By default this will be the search bar anyway.

13 years agoemacs: Take advantage of position-remembering when returning to notmuch-hello
Carl Worth [Tue, 27 Apr 2010 01:00:37 +0000 (18:00 -0700)]
emacs: Take advantage of position-remembering when returning to notmuch-hello

When we go into a search, and then later quit and return to the
notmuch-hello buffer, we want the point to remain in the same position
it was in when we left. So we have to call the position-remembering
notmuch-hello-update rather than notmuch-hello from the continuation.

13 years agoemacs: Make update of notmuch-hello leave point on the same widget.
Carl Worth [Tue, 27 Apr 2010 00:59:01 +0000 (17:59 -0700)]
emacs: Make update of notmuch-hello leave point on the same widget.

Before refreshing, we check which widget we are currently on, (or look
for the next widget), and then we watch for that same widget to go by
when constructing the buffer contents. Finally, we jump to the
position we saw when the widget went by.

13 years agoemacs: notmuch-hello: Don't include extra spaces in widget values.
Carl Worth [Tue, 27 Apr 2010 00:55:55 +0000 (17:55 -0700)]
emacs: notmuch-hello: Don't include extra spaces in widget values.

Previously, trailing spaces after each saved-search name were included
as part of the widget. This is going to be problematic for a future
change that will extract the widget's value and compare it to the
configured names of saved searches.

Instead, just include the name itself in the widget, and then insert
the spaces for separation afterwards.

13 years agoemacs: Disable automatic jump to search bar for notmuch-hello.
Carl Worth [Tue, 27 Apr 2010 00:51:27 +0000 (17:51 -0700)]
emacs: Disable automatic jump to search bar for notmuch-hello.

We're about to get support for maintaining point on the current
saved-search, so we don't want this jump-to-search defeating that.

13 years agoPut signatures at the very end of the message
Dirk Hohndel [Mon, 26 Apr 2010 17:41:49 +0000 (10:41 -0700)]
Put signatures at the very end of the message

The existing code inserts the signature before inserting the message
body (which it puts at the very end of the buffer - therefore AFTER
the signature). This little snippet makes us search backwards and
insert the message body before a signature, if it exists.

This also fixes a small indentation issue in David's code.

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoAdd NEWS updates for my last batch of patches
Dirk Hohndel [Fri, 23 Apr 2010 17:42:31 +0000 (10:42 -0700)]
Add NEWS updates for my last batch of patches

in the future I'll include those with my patches. Hope it's ok to do
this as one single patch for this series.

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoTODO: Add some ideas for notmuch-hello cleanups.
Carl Worth [Mon, 26 Apr 2010 22:14:59 +0000 (15:14 -0700)]
TODO: Add some ideas for notmuch-hello cleanups.

I discussed these on the list while wrapping up the 0.3 release. They
may not make it in for that, but I don't want to forget them at least.

13 years agoemacs: Fix to generate error if fcc directory is not a maildir
Carl Worth [Mon, 26 Apr 2010 21:56:46 +0000 (14:56 -0700)]
emacs: Fix to generate error if fcc directory is not a maildir

Previously this was just a message that was almost impossible for the
user to see. Now, the user gets to see the error message, and is
presented with a buffer that actually contains the Fcc header of
interest.

13 years agoRearchitect From: header guessing code for replies
Dirk Hohndel [Mon, 26 Apr 2010 19:58:35 +0000 (12:58 -0700)]
Rearchitect From: header guessing code for replies

We want to be able to correctly guess the best From: header to use when
replying to emails. This is what we are looking at now:
 1 is one of the users' mail addresses in the To: or Cc: header
 2 check for an Envelope-to: header
 3 check for an X-Original-To: header
 4 check for a (for <email@add.res>) clause in Received: headers
 5 check for the domain part of known email addresses in the
      'by' part of Received headers
 6 fall back to the primary email address

This patch changes the algorithm for steps 2-5 of this process. Prior to
this patch we had a first attempt to implement only step 5 - but this
broke in many email setups where mail delivery to the local machine added
additional Received: lines.
Steps 2-4 are new, step 5 now analyzes the concatenated Received: header
(this was in the previous patch) to do this analysis.

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
13 years agoMake Received: header special in notmuch_message_file_get_header
Dirk Hohndel [Mon, 26 Apr 2010 19:58:34 +0000 (12:58 -0700)]
Make Received: header special in notmuch_message_file_get_header

With this patch the Received: header becomes special in the way
we treat headers - this is the only header for which we concatenate
all the instances we find (instead of just returning the first one).

This will be used in the From guessing code for replies as we need to
be able to walk ALL of the Received: headers in a message to have a
good chance to guess which mailbox this email was delivered to.

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
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.