Commit graph

3214 commits

Author SHA1 Message Date
Jason Woofenden
6c6c8a9c85 vim: fix (hack) cig/cit parsing within multipart/*
The vim front-end isn't written to handle nested parts.

This patch doesn't change that, it just changes the code to pretend that
multipart/* sections end immediately. This makes the parsing code think that
all sections are top-level, and are thus parsed well enough.

The lovely result of this is that citation folds and signature folds now work
in text/plain parts that are within multipart/* sections. Also, all mime
section starts are now shown correctly (before some were not parsed and showed
the ugly ^L and an ID and so on from notmuch.)

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Jason Woofenden
3de487d405 vim: fix on-screen instructions for show-signature
Also change a passed parameter to be consistent with the current binding. This
parameter appears to be unused.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Jason Woofenden
f5c20b8b08 vim: fix from list reformatting in search view
This patch rewrites the reformatting of the from list so it shows full
capitalized names when available (without truncating them as the old code did)
and removes the pipe characters that appear between some names.

The old code appears to assume from list (the list of senders in the thread)
coming from notmuch would be e-mail addresses, but in this version it is mostly
full names. Also in this version, the names are sometimes separated by pipe
instead of comma.

For consistency with old versions, names are still truncated at the first
period. Perhaps they shouldn't be though.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Jason Woofenden
2b79776eed vim: fix space key: now archives (did opposite)
In vim, in the message view, space is supposed to remove the "unread" and
"inbox" tags, but was sometimes adding them instead.

This patch assures that they are always removed by this binding.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Uwe Kleine-König
bab653ce39 vim: use the full path for sendmail
... as /usr/sbin isn't usually in user's PATH.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:57:38 +03:00
Uwe Kleine-König
bcb17491b5 vim: skip trailing slash for g:notmuch_compose_temp_file_dir
With the trailing slash I get

	Error detected while processing function <SNR>10_NM_new_mail..<SNR>10_NM_cmd_compose..<SNR>10_NM_newComposeBuffer..<SNR>10_NM_newFileBuffer:
	line    3:
	E739: Cannot create directory: /home/ukleinek/.notmuch/compose/

when hitting 'm' to compose a new mail. strace shows:

	stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314a10) = -1 ENOENT (No such file or directory)
	stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314e30) = -1 ENOENT (No such file or directory)
	stat("/home/ukleinek/.notmuch/compose", 0x7fffee315270) = -1 ENOENT (No such file or directory)
	stat("/home/ukleinek/.notmuch", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
	mkdir("/home/ukleinek/.notmuch/compose", 0755) = 0
	mkdir("/home/ukleinek/.notmuch/compose/", 0755) = -1 EEXIST (File exists)

so it seems vim's mkdir() isn't able to handle a trailing slash.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:49:12 +03:00
Uwe Kleine-König
9d0e2ebc07 vim: fix documentation that mailx isn't used anymore
Since
	e7899b0 (vim: use sendmail directly)
notmuch-vim uses sendmail directly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-07-16 21:49:09 +03:00
Sebastian Spaeth
687366b920 python: represent message tags as unicode instances
Rather than returning simply strings and having to guess their encoding,
return explicit unicode() strings for the tags. Xapian stores UTF8, so
we know that they come as UTF8 encoded string.

Note: I tried to directly use the c_wchar_p type of the ctypes library
which translates directly into an unicode type, but that did not work
out so well, so we take c_char_p and .decode() them manually.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-07-11 15:02:12 +02:00
Sebastian Spaeth
504b6242d1 python: Encode query string as a utf-8 byte array
If we pass in an unicode instance as query string, we would probably get
weird behavior (and indeed do so, see mail
id:"20110707113700.GA16347@megatron"). If a unicode instance is passed
in, make sure we encode it properly to an utf-8 encoded byte string.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-07-11 11:46:54 +02:00
David Bremner
22472d9def Merge commit '0.6' 2011-07-10 16:50:09 -03:00
David Bremner
8b310a157c debian: update changelog for strict libnotmuch dependency 2011-07-10 09:35:00 -03:00
Uwe Kleine-König
f01b8d1331 debian: strictly depend on the same version of libnotmuch
It took quite some time to debug why folder: searches didn't work for me
though I had notmuch 0.6~rc1 installed. amdragon in #notmuch found out
that I still had libnotmuch1 0.5+nmu3 installed.

To prevent the same problem in the future let notmuch depend on the same
version of libnotmuch1.

Reviewed-By: David Bremner <david@tethera.net>

  The underlying issue is that the libnotmuch interface is not
  entirely captured by the set of exported symbols. In particular the
  query syntax can change without being visible to the linker at all.
2011-07-10 09:32:40 -03:00
Sebastian Spaeth
3545a2960d python: Fix Database().needs_upgrade()
A stupid typo was preventing this from ever working and it was not
detected until now. Patrick noted the typo and proposed the fix in mail
id:"20110704203926.GA20238@brick.lan".

Patch-by: Patrick Totzke <patricktotzke@googlemail.com>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2011-07-08 22:47:06 +02:00
David Bremner
7e3cb13a05 debian: start new changelog stanza for post 0.6 bugfix release
The version numbering scheme of n.n.n is chosen so as not to confuse
tools that rely on the presence of a dash to detect non-native
packages.
2011-07-07 22:41:59 -03:00
David Bremner
2e7956e884 debian: install README.Debian files for notmuch-vim and notmuch-emacs.
The notmuch-vim README.Debian in particular is quite important since
it discussions the need to install the package with vim-addons
2011-07-07 22:36:04 -03:00
Robin Green
52e4dedf9a Use POSIX sed invocation
Fixes broken build on DragonFly BSD

Signed-off-by: Robin Green <greenrd@greenrd.org>
2011-07-03 08:32:51 -03:00
David Bremner
d15faa1dbe version: bump to 0.6
The release machinery in the build system depends on this file
being correct.
(cherry picked from commit 6bd02fb4db)
2011-07-01 17:14:58 -03:00
David Bremner
b4a0d5575d NEWS: Update for release 0.6
Fix some typos, add some notes on python bindings, "improve" the folder searching
description, expand the discussion of crypto changes.

This includes the changes from
id:"1309541202-4938-1-git-send-email-dmitry.kurochkin@gmail.com"

Thanks to Sebastian, Austin, and Uwe, Dmitry for the editing help.
(cherry picked from commit 74d00bb0e8)
2011-07-01 17:14:44 -03:00
David Bremner
0511875fd0 debian: add changelog stanza for release 0.6, install upstream docs referred to.
This perhaps breaks the "one thing at a time rule", but seems better
than leaving the changelog pointing to nothing.
(cherry picked from commit 8c5129bb51)
2011-07-01 17:14:34 -03:00
David Bremner
6bd02fb4db version: bump to 0.6
The release machinery in the build system depends on this file
being correct.
2011-07-01 15:28:16 -03:00
David Bremner
74d00bb0e8 NEWS: Update for release 0.6
Fix some typos, add some notes on python bindings, "improve" the folder searching
description, expand the discussion of crypto changes.

This includes the changes from
id:"1309541202-4938-1-git-send-email-dmitry.kurochkin@gmail.com"

Thanks to Sebastian, Austin, and Uwe, Dmitry for the editing help.
2011-07-01 15:26:24 -03:00
David Bremner
8c5129bb51 debian: add changelog stanza for release 0.6, install upstream docs referred to.
This perhaps breaks the "one thing at a time rule", but seems better
than leaving the changelog pointing to nothing.
2011-07-01 11:48:01 -03:00
David Bremner
65bf14d59e debian: move vim directory creation to notmuch-vim binary package
This step was missed during the package split of notmuch to notmuch,
notmuch-emacs, and notmuch-vim.

It seems mostly harmless in this case, but it is silly for non-vim
users to have those directories.
(cherry picked from commit 4b5875d81e)
2011-07-01 09:58:08 -03:00
Carl Worth
9485ab5084 NEWS: Add notes for (imminent) notmuch 0.6 release
By skimming through "git log 0.5..origin/release" late at
night. Hopefully everything here is accurate.
(cherry picked from commit d173069ad9)
2011-07-01 09:57:12 -03:00
Carl Worth
8f9c403131 emacs: Fix to unconditionally display subject changes in collapsed thread view
The feature to show subject changes in the collapsed thread view was
originally added (8ab433607) with an option
(notmuch-show-always-show-subject) to display the subject
for all messages, even when there was no change.

The subsequent commit (4f04d273) changed the sense of the test (or to
and) and the name of the controlling variable
(notmuch-show-elide-same-subject).

But this commit is broken in a few ways:

  1. The original definition of notmuch-show-always-show-subject was
     left around

     But the variable isn't actually used in the code at all, so it
     just adds clutter and confusion to the customization interface.

  2. The name and description of the controlling variable doesn't
     match the implementation

     The name suggests that setting the variable to t will cause
     repeated subjects to be elided, (suggesting that when it is nil
     all subjects will be shown).

     However, when the variable is nil, no subjects are shown. So a
     correct name for the variable in this sense would be
     notmuch-show-subject-changes.

Showing subject changes is a useful feature, and should be on by
default. (We don't want to bury generally useful features behind
customizations that users have to find).

Rather than fixing the name of the variable and changing its default
value, here we remove the condition entirely, such that the feature is
enabled unconditionally.

So both the currently-used variable and the stale definition of the
formerly-used are removed.

Also, the one relevant test-suite result is updated, (showing the
intial subject of a collapsed thread, and no subject display for later
messages that do not change the subject).
(cherry picked from commit 580de27177)
2011-07-01 09:56:34 -03:00
David Bremner
4b5875d81e debian: move vim directory creation to notmuch-vim binary package
This step was missed during the package split of notmuch to notmuch,
notmuch-emacs, and notmuch-vim.

It seems mostly harmless in this case, but it is silly for non-vim
users to have those directories.
2011-07-01 08:08:32 -03:00
Carl Worth
d173069ad9 NEWS: Add notes for (imminent) notmuch 0.6 release
By skimming through "git log 0.5..origin/release" late at
night. Hopefully everything here is accurate.
2011-07-01 03:14:03 -07:00
Carl Worth
580de27177 emacs: Fix to unconditionally display subject changes in collapsed thread view
The feature to show subject changes in the collapsed thread view was
originally added (8ab433607) with an option
(notmuch-show-always-show-subject) to display the subject
for all messages, even when there was no change.

The subsequent commit (4f04d273) changed the sense of the test (or to
and) and the name of the controlling variable
(notmuch-show-elide-same-subject).

But this commit is broken in a few ways:

  1. The original definition of notmuch-show-always-show-subject was
     left around

     But the variable isn't actually used in the code at all, so it
     just adds clutter and confusion to the customization interface.

  2. The name and description of the controlling variable doesn't
     match the implementation

     The name suggests that setting the variable to t will cause
     repeated subjects to be elided, (suggesting that when it is nil
     all subjects will be shown).

     However, when the variable is nil, no subjects are shown. So a
     correct name for the variable in this sense would be
     notmuch-show-subject-changes.

Showing subject changes is a useful feature, and should be on by
default. (We don't want to bury generally useful features behind
customizations that users have to find).

Rather than fixing the name of the variable and changing its default
value, here we remove the condition entirely, such that the feature is
enabled unconditionally.

So both the currently-used variable and the stale definition of the
formerly-used are removed.

Also, the one relevant test-suite result is updated, (showing the
intial subject of a collapsed thread, and no subject display for later
messages that do not change the subject).
2011-07-01 02:00:25 -07:00
David Bremner
5d53226005 debian: changelog stanza for first "official" release candidate
The last upload to experimental was really a release candidate too.
Switch versioning to ~rc1 as counting commits is confusing when
building from the release branch.
(cherry picked from commit 117852a5f1)
2011-06-30 10:09:00 -03:00
David Bremner
117852a5f1 debian: changelog stanza for first "official" release candidate
The last upload to experimental was really a release candidate too.
Switch versioning to ~rc1 as counting commits is confusing when
building from the release branch.
2011-06-30 10:08:28 -03:00
David Bremner
3f777b2ac2 debian: don't install zsh completion files into /usr/share/zsh
as of version 4.3.12, perhaps earlier, the Debian zsh package now
ships /usr/share/zsh/functions/Completion/Unix/_notmuch, so we
shouldn't install that ourselves anymore.

My understanding is that letting zsh ship the completion scripts is
the standard thing to do.

The script is still shipped in /usr/share/doc/notmuch/examples
(cherry picked from commit 0a0f5f1bbe)
2011-06-30 09:33:34 -03:00
David Bremner
0a0f5f1bbe debian: don't install zsh completion files into /usr/share/zsh
as of version 4.3.12, perhaps earlier, the Debian zsh package now
ships /usr/share/zsh/functions/Completion/Unix/_notmuch, so we
shouldn't install that ourselves anymore.

My understanding is that letting zsh ship the completion scripts is
the standard thing to do.

The script is still shipped in /usr/share/doc/notmuch/examples
2011-06-30 09:25:35 -03:00
Sebastian Spaeth
76399e5f73 python: Do not implicitely call maildir_flags_to_tags etc
In order to remain consistent with the underlying C API, we do not
automatically synchronize notmuch tags and maildir flags anymore.

The underlying functions Message.maildir_flags_to_tags and
Message.tags_to_maildir_flags still exist and are available to the user.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
(cherry picked from commit e59eaa5ddd)
2011-06-30 07:26:16 -03:00
Carl Worth
dd544f5dc6 debian/changelog: Add note that notmuch-vim description is in (bug #631974)
This note will automatically cause the bug entry to be closed as fixed when
the next package (including this change) is uploaded.
(cherry picked from commit 04b9ffa56f)
2011-06-29 22:02:58 -03:00
Mark Anderson
d77c7cefe4 Fix folder: coherence issue
Add removal of all ZXFOLDER terms to removal of all XFOLDER terms for
each message filename removal.

The existing filename-list reindexing will put all the needed terms
back in.  Test search-folder-coherence now passes.

Signed-off-by:Mark Anderson <ma.skies@gmail.com>
(cherry picked from commit 8a856e5c38)
2011-06-29 21:58:53 -03:00
Carl Worth
671ffbb766 test: Use increment_mtime rather than sleep
The sleep was to force the directory's mtime to advance between the
previous notmuch new and the subsequent rm;notmuch new.

The current convention is to use the existing increment_mtime function
for this purpose, (which avoids the test suite being slowed down by
calls to sleep).

Thanks to Austin Clements for noticing this undesired sleep.
(cherry picked from commit 55a78d5dbd)
2011-06-29 21:58:39 -03:00
Mark Anderson
c04e6f84d3 test:Folder tags shouldn't match after removal of file in given folder
Test for bug.  Current stemming support for notmuch adds extra terms
to the DB which aren't removed when the file renames are detected.

When folder tags are added to a message, Xapian terms for both XFOLDER
and ZXFOLDER are generated.  When one of the filenames are
renamed/removed, only the XFOLDER tags are removed, leaving it possible
for a match on a folder: tag that was previously but is no longer a
match in the maildir.
(cherry picked from commit 86e0baeb6d)
2011-06-29 21:58:19 -03:00
Mark Anderson
fa0c0d0e66 search --output=files: Output all filenames for each matching message
Messages in the database can have multiple files associated with a
single message-id, but until now only one filename for each message
has been reported by "notmuch search --output=files"

Signed-off-by: Mark Anderson <ma.skies@gmail.com>
(cherry picked from commit d752509abf)
2011-06-29 21:56:57 -03:00
Austin Clements
bb2b33fbb8 new: Improved workaround for mistaken new directories
Currently, notmuch new assumes any directory with a database mtime of
0 is new, but we don't set the mtime until after processing messages
and subdirectories in that directory.  Hence, anything that prevents
the mtime update (such as an interruption or the wall-clock logic
introduced in 8c39e8d6) will cause the next notmuch new to think the
directory is still new.

We work around this by setting the new directory's database mtime to
-1 before scanning anything in the new directory.  This also obviates
the need for the workaround used in 8c39e8d6.
2011-06-29 16:10:41 -07:00
Jameson Graef Rollins
a31ad0bd01 test: document test_expect_equal_file
This test was not properly documented when it was originally added (my
bad).
2011-06-29 15:36:43 -07:00
David Bremner
f4dae4e5a1 lib/Makefile.local: remove leftover debugging output.
The removed "echo $(libnotmuch_modules)" was strictly for debugging.

Thanks to Austin Clements for the hint.
2011-06-29 15:35:47 -07:00
Austin Clements
47afbdfb79 test: Nix increment_mtime.
With the fix for the mtime race, this workaround is no longer
necessary.
2011-06-29 15:26:45 -07:00
Austin Clements
8c39e8d6fb new: Don't update DB mtime if FS mtime equals wall-clock time.
This fixes a race where multiple message deliveries in the same second
with an intervening notmuch new could result in messages being ignored
by notmuch (at least, until a later delivery forced a rescan).
Because mtimes only have second granularity, later deliveries in the
same second won't change the directory mtime, and hence won't trigger
notmuch new to rescan the directory.  This situation can only occur
when notmuch new is being run at the same second as the directory's
modification time, so simply don't update the saved mtime in this
case.

This very race happens all over the test suite, and is currently
compensated for with increment_mtime (and, occasionally, luck).  With
this change, increment_mtime becomes unnecessary.
2011-06-29 15:26:04 -07:00
Pieter Praet
ec1b568929 test: revert non-intentional changes introduced in eb4cf465
eb4cf465 introduces changes which weren't part of the submitted
patch (id:"87liwlip2j.fsf@gmail.com"), presumably made during
resolving merge conflicts.

The first one causes the title of a test to be printed a second time,
in place of the correct title:

  PASS   Message with .. in Message-Id:
  PASS   Message with .. in Message-Id:

instead of:

  PASS   Message with .. in Message-Id:
  PASS   Sending a message via (fake) SMTP

The second one is simply the insertion of a line break, so no harm there.

This commit reverts both changes, as they were clearly accidental.

Signed-off-by: Pieter Praet <pieter@praet.org>
2011-06-29 14:20:57 -07:00
Mark Anderson
8a856e5c38 Fix folder: coherence issue
Add removal of all ZXFOLDER terms to removal of all XFOLDER terms for
each message filename removal.

The existing filename-list reindexing will put all the needed terms
back in.  Test search-folder-coherence now passes.

Signed-off-by:Mark Anderson <ma.skies@gmail.com>
2011-06-29 14:13:16 -07:00
Carl Worth
55a78d5dbd test: Use increment_mtime rather than sleep
The sleep was to force the directory's mtime to advance between the
previous notmuch new and the subsequent rm;notmuch new.

The current convention is to use the existing increment_mtime function
for this purpose, (which avoids the test suite being slowed down by
calls to sleep).

Thanks to Austin Clements for noticing this undesired sleep.
2011-06-29 14:11:38 -07:00
Mark Anderson
86e0baeb6d test:Folder tags shouldn't match after removal of file in given folder
Test for bug.  Current stemming support for notmuch adds extra terms
to the DB which aren't removed when the file renames are detected.

When folder tags are added to a message, Xapian terms for both XFOLDER
and ZXFOLDER are generated.  When one of the filenames are
renamed/removed, only the XFOLDER tags are removed, leaving it possible
for a match on a folder: tag that was previously but is no longer a
match in the maildir.
2011-06-29 14:10:05 -07:00
Carl Worth
04b9ffa56f debian/changelog: Add note that notmuch-vim description is in (bug #631974)
This note will automatically cause the bug entry to be closed as fixed when
the next package (including this change) is uploaded.
2011-06-29 14:08:04 -07:00
Carl Worth
399277d17a TODO: Add note to fix race condition with directory mtime.
I recently discussed fixing this with Austin, but want to record it
here just in case we don't remember to fix it right away.
2011-06-29 14:07:06 -07:00
Dmitry Kurochkin
f74c4bc2f3 test: fix tests after notmuch show output changes related to filenames
Adding the filename propery alongside ID and Content-type.

This makes the test suite pass again after the recent change.
2011-06-28 20:06:20 -07:00