Austin Clements [Fri, 3 Aug 2012 01:14:50 +0000 (21:14 -0400)]
show: Associate an sprinter with each format
This associates an sprinter constructor with each show format and uses
this to construct the appropriate sprinter. Currently nothing is done
with this sprinter, but the following patches will weave it through
the layers of notmuch show.
Austin Clements [Fri, 3 Aug 2012 01:14:49 +0000 (21:14 -0400)]
sprinter: Add a string_len method
This method allows callers to output strings with specific lengths.
It's useful both for strings with embedded NULs (which JSON can
represent, though parser support is apparently spotty), and
non-terminated strings.
Austin Clements [Fri, 3 Aug 2012 01:14:48 +0000 (21:14 -0400)]
test: Remove unnecessary JSON canonicalization
Format canonicalization of JSON output is no longer necessary, so
remove it. Value canonicalization (e.g., normalizing thread IDs) is
still necessary, so all of the sanitization functions remain.
Austin Clements [Fri, 3 Aug 2012 01:14:47 +0000 (21:14 -0400)]
test: Uniformly canonicalize actual and expected JSON
Previously, we used a variety of ad-hoc canonicalizations for JSON
output in the test suite, but were ultimately very sensitive to JSON
irrelevancies such as whitespace. This introduces a new test
comparison function, test_expect_equal_json, that first pretty-prints
*both* the actual and expected JSON and the compares the result.
The current implementation of this simply uses Python's json.tool to
perform pretty-printing (with a fallback to the identity function if
parsing fails). However, since the interface it introduces is
semantically high-level, we could swap in other mechanisms in the
future, such as another pretty-printer or something that does not
re-order object keys (if we decide that we care about that).
In general, this patch does not remove the existing ad-hoc
canonicalization because it does no harm. We do have to remove the
newline-after-comma rule from notmuch_json_show_sanitize and
filter_show_json because it results in invalid JSON that cannot be
pretty-printed.
Most of this patch simply replaces test_expect_equal and
test_expect_equal_file with test_expect_equal_json. It changes the
expected JSON in a few places where sanitizers had placed newlines
after commas inside strings.
David Bremner [Fri, 3 Aug 2012 00:37:18 +0000 (21:37 -0300)]
debian: close notmuch-mutt bug in changelog
Apparently Stefano and I forgot to finish that discussion about how to
patch the changelog.
Mark Walters [Sat, 28 Jul 2012 11:56:34 +0000 (12:56 +0100)]
emacs: show: exclude bug fix
The pipe message function (when used with a prefix) uses a search of
the form "id:<id1> or id:<id2>" etc. Since the user says precisely
which messages are wanted by opening them it should not use excludes.
Stefano Zacchiroli [Wed, 1 Aug 2012 08:09:42 +0000 (10:09 +0200)]
debian packaging: new depends for duplicate removals in mutt contrib
both new hard dependency for File::Which and soft dependency on fdupes
Kevin McCarthy [Wed, 1 Aug 2012 08:09:41 +0000 (10:09 +0200)]
Add duplicate message removal for notmuch-mutt.
Add a --remove-dups flag which removes duplicate files from search and
thread results. Uses fdupes if installed. Otherwise it runs a size and
Digest::SHA scan on each file to detect duplicates.
Signed-off-by: Stefano Zacchiroli <zack@upsilon.cc>
Mark Walters [Thu, 2 Aug 2012 07:19:37 +0000 (08:19 +0100)]
emacs: fix a bug introduced by the recent search cleanups.
In commit
5d0883e the function notmuch-search-next-thread was changed.
In particular it only goes to the next message if there is a next
message. This breaks notmuch-show-archive-thread-then-next. Fix this
by going to the "next" message whenever we are on a current message.
David Bremner [Thu, 2 Aug 2012 12:36:24 +0000 (09:36 -0300)]
debian: update changelog for cleaning changes
David Bremner [Thu, 2 Aug 2012 12:30:31 +0000 (09:30 -0300)]
build system: remove configure output in Make distclean.
Create a variable DISTCLEAN which contains a list of things to
clean in the distclean target (in addition to running the clean
target).
The deleted comment seems to be false these days, since we do
create files during configuration.
Use "rm -rf" here as well in case we want to add directories to
DISTCLEAN.
David Bremner [Thu, 2 Aug 2012 12:27:26 +0000 (09:27 -0300)]
build system: remove directories created by tests in "make clean"
These extra directories cause problems for building on Debian
twice in a row.
In order to remove directories, we need to us "rm -rf" instead of
"rm -f". So now we should be extra careful what we add to the
variable CLEAN.
Tomi Ollila [Thu, 3 May 2012 18:59:58 +0000 (21:59 +0300)]
configure: check whether shell is capable of parameter substring processing
'configure' script uses parameter substring extensively. It is Posix shell
feature. Original Bourne shell does not have such features. Some systems
still ships such shells as /bin/sh (for compatibility reasons -- shell
scripts written on those platforms are expected to work on 1990's systems).
Just testing whether parameter substring processing works will make the
shell exit due to syntax error if it is not compatible. Therefore the test
is executed in a subshell -- subshell exits with nonzero value when the
operation in question fails.
As 'if ! ...' does not work in Bourne shell, Short-circuiting construct
'||' is used to print information message and exit when expected.
Mark Walters [Tue, 24 Jul 2012 18:57:57 +0000 (19:57 +0100)]
man: show: update man page for entire-thread and json.
Previously in notmuch show --format=json implied --entire-thread. This
is still the default but it is now possible to disable this. Update
the manpage to reflect this.
Mark Walters [Tue, 24 Jul 2012 18:23:30 +0000 (19:23 +0100)]
schemata: update for --body=true|false option
Previously body: was a compulsory field in a message. The new
--body=false option causes notmuch show to omit this field so update
schemata to reflect this.
Mark Walters [Tue, 24 Jul 2012 18:23:29 +0000 (19:23 +0100)]
man: update man page for the new --body=true|false option
Mark Walters [Tue, 24 Jul 2012 18:23:28 +0000 (19:23 +0100)]
test: add tests for the new --body=true|false option
Mark Walters [Tue, 24 Jul 2012 18:23:27 +0000 (19:23 +0100)]
cli: add --body=true|false option to notmuch-show.c
This option allows the caller to suppress the output of the bodies of
the messages. Currently this is only implemented for format=json.
This is used by notmuch-pick.el (although not needed) because it gives
a speed-up of at least a factor of a two (and in some cases a speed up
of more than a factor of 8); moreover it reduces the memory usage in
emacs hugely.
craven@gmx.net [Mon, 23 Jul 2012 10:39:46 +0000 (12:39 +0200)]
Use the structured formatters in notmuch-search.c.
This patch switches from the current ad-hoc printer to the structured
formatters in sprinter.h, sprinter-text.c and sprinter-json.c.
The JSON tests are changed slightly in order to make them PASS for the
new structured output formatter.
The text tests pass without adaptation.
craven@gmx.net [Mon, 23 Jul 2012 10:39:45 +0000 (12:39 +0200)]
Add structured output formatter for JSON and plain text (but don't use them yet).
Using the new structured printer support in sprinter.h, implement
sprinter_json_create, which returns a new JSON structured output
formatter. The formatter prints output similar to the existing JSON, but
with differences in whitespace (mostly newlines, --output=summary prints
the entire message summary on one line, not split across multiple lines).
Also implement a "structured" formatter for plain text that prints
prefixed strings, to be used with notmuch-search.c plain text output.
craven@gmx.net [Mon, 23 Jul 2012 10:39:44 +0000 (12:39 +0200)]
Add support for structured output formatters.
This patch adds a new struct type sprinter_t, which is used for
structured formatting, e.g. JSON or S-Expressions. The structure printer
is heavily based on code from Austin Clements
(id:87d34hsdx8.fsf@awakening.csail.mit.edu).
It includes the following functions:
/* Start a new map/dictionary structure. This should be followed by
* a sequence of alternating calls to map_key and one of the
* value-printing functions until the map is ended by end.
*/
void (*begin_map) (struct sprinter *);
/* Start a new list/array structure.
*/
void (*begin_list) (struct sprinter *);
/* End the last opened list or map structure.
*/
void (*end) (struct sprinter *);
/* Print one string/integer/boolean/null element (possibly inside a
* list or map, followed or preceded by separators).
* For string, the char * must be UTF-8 encoded.
*/
void (*string) (struct sprinter *, const char *);
void (*integer) (struct sprinter *, int);
void (*boolean) (struct sprinter *, notmuch_bool_t);
void (*null) (struct sprinter *);
/* Print the key of a map's key/value pair. The char * must be UTF-8
* encoded.
*/
void (*map_key) (struct sprinter *, const char *);
/* Insert a separator (usually extra whitespace) for improved
* readability without affecting the abstract syntax of the
* structure being printed.
* For JSON, this could simply be a line break.
*/
void (*separator) (struct sprinter *);
/* Set the current string prefix. This only affects the text
* printer, which will print this string, followed by a colon,
* before any string. For other printers, this does nothing.
*/
void (*set_prefix) (struct sprinter *, const char *);
To support the plain text format properly, the following additional
function must also be implemented:
/* Set the current string prefix. This only affects the text
* printer, which will print this string, followed by a colon,
* before any string. For other printers, this does nothing.
*/
void (*set_prefix) (struct sprinter *, const char *);
The structure also contains a flag that should be set to FALSE in all
custom printers and to TRUE in the plain text formatter.
/* True if this is the special-cased plain text printer.
*/
notmuch_bool_t is_text_printer;
The printer can (and should) use internal state to insert delimiters
and syntax at the correct places.
Example:
format->begin_map(format);
format->map_key(format, "foo");
format->begin_list(format);
format->integer(format, 1);
format->integer(format, 2);
format->integer(format, 3);
format->end(format);
format->map_key(format, "bar");
format->begin_map(format);
format->map_key(format, "baaz");
format->string(format, "hello world");
format->end(format);
format->end(format);
would output JSON as follows:
{"foo": [1, 2, 3], "bar": { "baaz": "hello world"}}
Austin Clements [Sat, 21 Jul 2012 17:37:12 +0000 (13:37 -0400)]
News for search cleanups
Austin Clements [Sat, 21 Jul 2012 17:37:11 +0000 (13:37 -0400)]
emacs: Fix navigation of multi-line search result formats
At this point, the only remaining functions that don't support
multi-line search result formats are the thread navigation functions.
This patch fixes that by rewriting them in terms of
notmuch-search-result-{beginning,end}.
This changes the behavior of notmuch-search-previous-thread slightly
so that if point isn't at the beginning of a result, it first moves
point to the beginning of the result.
Austin Clements [Sat, 21 Jul 2012 17:37:10 +0000 (13:37 -0400)]
emacs: Allow custom tags formatting
Previously we ignored any notmuch-search-result-format customizations
for tag formatting because we needed to be able to parse back in the
result line and update the tags in place. We no longer do either of
these things, so we can allow customization of this format.
(Coincidentally, previously we still allowed too much customization of
the tags format, since moving it earlier on the line or removing it
from the line would interfere with the tagging mechanism. There is
now no problem with doing such things.)
Austin Clements [Sat, 21 Jul 2012 17:37:09 +0000 (13:37 -0400)]
emacs: Replace other search text properties with result property
Since the result object contains everything that the other text
properties recorded, we can remove the other text properties and
simply look in the plist of the appropriate result object.
Austin Clements [Sat, 21 Jul 2012 17:37:08 +0000 (13:37 -0400)]
emacs: Use result text properties for search result iteration
This simplifies the traversal of regions of results and eliminates the
need for save-excursions (which tend to get in the way of maintaining
point when we make changes to the buffer). It also fixes some strange
corner cases in the old line-based code where results that bordered
the region but were not included in it could be affected by region
commands. Coincidentally, this also essentially enables multi-line
search result formats; the only remaining non-multi-line-capable
functions are notmuch-search-{next,previous}-thread, which are only
used for interactive navigation.
Austin Clements [Sat, 21 Jul 2012 17:37:07 +0000 (13:37 -0400)]
emacs: Update tags by rewriting the search result line in place
Now that we keep the full thread result object, we can refresh a
result after any changes by simply deleting and reconstructing the
result line from scratch.
A convenient side-effect of this wholesale replacement is that search
now re-applies notmuch-search-line-faces when tags change.
Austin Clements [Sat, 21 Jul 2012 17:37:06 +0000 (13:37 -0400)]
emacs: Use text properties instead of overlays for tag coloring
Previously, tag-based search result highlighting was done by creating
an overlay over each search result. However, overlays have annoying
front- and rear-advancement semantics that make it difficult to
manipulate text at their boundaries, which the next patch will do.
They also have performance problems (creating an overlay is linear in
the number of overlays between point and the new overlay, making
highlighting a search buffer quadratic in the number of results).
Text properties have neither problem. However, text properties make
it more difficult to apply multiple faces since, unlike with overlays,
a given character can only have a single 'face text property. Hence,
we introduce a utility function that combines faces into any existing
'face text properties.
Using this utility function, it's straightforward to apply all of the
appropriate tag faces in notmuch-search-color-line.
Austin Clements [Sat, 21 Jul 2012 17:37:05 +0000 (13:37 -0400)]
emacs: Record thread search result object in a text property
This also provides utility functions for working with this text
property that get its value, find its start, and find its end.
Ingo Lohmar [Sun, 3 Jun 2012 18:23:57 +0000 (21:23 +0300)]
emacs: Fix notmuch-message-mark-replied.
notmuch-message-mark-replied used "apply" to change message tags
according to notmuch-message-replied-tags after sending a reply. This
works if the latter is a single-element list. But with the recently
changed format of tag changes, it breaks for multiple-element lists.
Use "funcall" to properly pass the list of tag changes as a single
argument.
David Bremner [Thu, 12 Jul 2012 23:49:09 +0000 (17:49 -0600)]
debian: finalize changelog
It turns out the "debian-snapshot" target needs a valid changelog.
Austin Clements [Mon, 9 Jul 2012 21:42:42 +0000 (17:42 -0400)]
News for JSON-based search
Austin Clements [Mon, 9 Jul 2012 21:42:41 +0000 (17:42 -0400)]
emacs: Switch from text to JSON format for search results
The JSON format eliminates the complex escaping issues that have
plagued the text search format. This uses the incremental JSON parser
so that, like the text parser, it can output search results
incrementally.
This slows down the parser by about ~4X, but puts us in a good
position to optimize either by improving the JSON parser (evidence
suggests this can reduce the overhead to ~40% over the text format) or
by switching to S-expressions (evidence suggests this will more than
double performance over the text parser). [1]
This also fixes the incremental search parsing test.
This has one minor side-effect on search result formatting.
Previously, the date field was always padded to a fixed width of 12
characters because of how the text parser's regexp was written. The
JSON format doesn't do this. We could pad it out in Emacs before
formatting it, but, since all of the other fields are variable width,
we instead fix notmuch-search-result-format to take the variable-width
field and pad it out. For users who have customized this variable,
we'll mention in the NEWS how to fix this slight format change.
[1] id:"
20110720205007.GB21316@mit.edu"
Austin Clements [Mon, 9 Jul 2012 21:42:40 +0000 (17:42 -0400)]
emacs: Implement an incremental JSON parser
This parser is designed to read streaming JSON whose structure is
known to the caller. Like a typical JSON parsing interface, it
provides a function to read a complete JSON value from the input.
However, it extends this with an additional function that
requires the next value in the input to be a compound value and
descends into it, allowing its elements to be read one at a time
or further descended into. Both functions can return 'retry to
indicate that not enough input is available.
The parser supports efficient partial parsing, so there's no need to
frame the input for correctness or performance.
The bulk of the parsing is still done by Emacs' json.el, so any
improvements or optimizations to that will benefit the incremental
parser as well.
Currently only descending into JSON lists is supported because that's
all we need, but support for descending into JSON objects can be added
in the future.
Austin Clements [Mon, 9 Jul 2012 21:42:39 +0000 (17:42 -0400)]
test: New test for incremental search output parsing
This advises the search process filter to make it process one
character at a time in order to test the pessimal case for incremental
search output parsing.
The text parser fails this test because it gets tricked into thinking
a parenthetical remark in a subject is the tag list.
Austin Clements [Mon, 9 Jul 2012 21:42:38 +0000 (17:42 -0400)]
emacs: Pass plist to `notmuch-search-show-result'
Rather than passing lots of arguments and then further passing those
to `notmuch-search-insert-field', pass a plist containing all of the
search result information. This plist is compatible with the JSON
format search results.
Austin Clements [Mon, 9 Jul 2012 21:42:37 +0000 (17:42 -0400)]
emacs: Move search-target logic to `notmuch-search-show-result'
This is a simpler place to do this, since we can avoid any point
motion and hence any save-excursions in
`notmuch-search-process-filter', which in turn lets us put all of the
search-target logic outside of any save-excursions.
`notmuch-search-show-{result,error}' are now responsible for their own
point motion.
`notmuch-search-process-filter' could use some reindentation after
this, but we're about to rewrite it entirely, so we won't bother.
Austin Clements [Mon, 9 Jul 2012 21:42:36 +0000 (17:42 -0400)]
emacs: Helper for reporting search parsing errors
This removes the last bit of direct output from the parsing function.
With the parser now responsible solely for parsing, we can swap it out
for another parser.
Austin Clements [Mon, 9 Jul 2012 21:42:35 +0000 (17:42 -0400)]
emacs: Separate search line parsing and display
Previously, much of the display of search lines was done in the same
function that parsed the CLI's output. Now the parsing function only
parses, and notmuch-search-show-result fully inserts the search result
in the search buffer.
Austin Clements [Mon, 9 Jul 2012 21:42:34 +0000 (17:42 -0400)]
emacs: Clean up notmuch-search-show-result
This simplifies the code and makes it no longer cubic in the number of
result fields.
Tomi Ollila [Wed, 11 Jul 2012 09:10:05 +0000 (12:10 +0300)]
contib/nmbug/nmbug-status: leftover whitespaces, indentation & quoting
The initial nmbug-status was pretty consistent in it's whitespacing
but a few lines had some leftover slips. Those are now "corrected".
Also, most of the code used ' as quoting char. As in Python one can
use ' and " interchangeably some code used " instead of '. However
the usage of those were inconsistent. Now all quotes that python
parses are ':s (only quoted content uses ":s).
No functional changes.
Tomi Ollila [Wed, 11 Jul 2012 09:10:04 +0000 (12:10 +0300)]
contrib/nmbug/ nmbug-status: restored out['subject']... block level
In reformatting the line 111 accidentally indented to one indentation
level too much (happens easily when interactively indenting python
code using emacs). The line now has 4 spacess less indentation, thus
restoring it to the block level it belongs.
David Bremner [Sat, 7 Jul 2012 19:29:38 +0000 (13:29 -0600)]
contrib/nmbug: add nmbug-status script
This is (almost) the same script as has been used for
http://nmbug.tethera.net/status for a while now. The only change is
that the configuration is not hardcoded anymore. By default the config
is fetched from a special branch in the nmbug repo that contains only
config info. The idea is that push access to this branch can be
restricted a bit more than the tags, since it will change the
appearence of the web pages.
David Bremner [Sat, 7 Jul 2012 18:56:06 +0000 (12:56 -0600)]
contrib/nmbug: make nmbug a subdirectory
I want to ship the status tool here as well, along with a sample
config file.
Austin Clements [Tue, 3 Jul 2012 05:47:38 +0000 (01:47 -0400)]
Add missing "tags" field to search schema
This field is output by search, but it didn't make it into the
documentation.
Tomi Ollila [Sun, 24 Jun 2012 21:53:27 +0000 (00:53 +0300)]
manpages: consistent "format" for NAME section
The NAME section in manpages generally doesn't start with capital
letter (unless the word is 'proper noun') and doesn't end with
period. Notmuch manual pages now matches that "format".
Peter Wang [Sun, 24 Jun 2012 03:27:48 +0000 (13:27 +1000)]
test: add basic show, search --format=text tests
There didn't seem to be these basic tests for --format=text,
as there are for --format=json. These are just the tests from
the `json' script, with adjusted expected outputs.
Stefano Zacchiroli [Tue, 3 Jul 2012 21:30:48 +0000 (15:30 -0600)]
debian: document tag action invocation fix in changelog
Stefano Zacchiroli [Tue, 3 Jul 2012 21:30:47 +0000 (15:30 -0600)]
notmuch-mutt: fix helper invocation for the tag action
As it was before, "-inbox" was interpreted as a getopt option, rather
than as a tag manipulation request. Making the action unusable.
Closes: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=678012
Mark Walters [Sat, 30 Jun 2012 11:14:15 +0000 (12:14 +0100)]
Minor correction to devel/schemata
In id:"87sjdm12d1.fsf@awakening.csail.mit.edu" Austin pointed out that
devel/schemata needs a slight correction with the new
--entire-thread=false option. This is that correction.
Daniel Schoepe [Fri, 17 Feb 2012 18:34:44 +0000 (19:34 +0100)]
emacs: Add configurable wrapping width for notmuch-wash-wrap-long-lines
This introduces a variable to control after how many characters a line
is wrapped by notmuch-wash-wrap-long-lines (still wrapping at the
window width if it is lower).
Mark Walters [Sat, 16 Jun 2012 10:21:47 +0000 (11:21 +0100)]
cli: notmuch-show.c fix whitespace error
Fix an existing whitespace error since it is right next to
the changes of this series.
Mark Walters [Sat, 16 Jun 2012 10:21:46 +0000 (11:21 +0100)]
emacs: make elide messages use notmuch-show for omitting messages.
Previously the elide messages code got the entire-thread from
notmuch-show.c and then threw away all non-matching messages. This
version calls notmuch-show.c without the --entire-thread flag so
it never receives the non-matching messages in the first place.
This makes it substantially faster.
Mark Walters [Sat, 16 Jun 2012 10:21:45 +0000 (11:21 +0100)]
Update devel/schemata for --entire-thread=false
Also remove the Json --entire-thread item from devel/TODO.
Mark Walters [Sat, 16 Jun 2012 10:21:44 +0000 (11:21 +0100)]
cli: make --entire-thread=false work for format=json.
The --entire-thread option in notmuch-show.c defaults to true when
format=json. Previously there was no way to turn this off. This patch
makes it respect --entire-thread=false.
To do this the patch moves the --entire-thread option to be a keyword
option using the new command line parsing to allow the existing
--entire-thread to keep working.
Mark Walters [Sat, 16 Jun 2012 10:21:43 +0000 (11:21 +0100)]
cli: Let json output "null" messages for non --entire-thread
All formats except Json can output empty messages for non
entire-thread, but in Json format we output "null" to keep the other
elements (e.g. the replies to the omitted message) in the correct
place.
Mark Walters [Sat, 16 Jun 2012 10:21:42 +0000 (11:21 +0100)]
cli: command line parsing: allow default for keyword options
This changes the parsing for "keyword" options so that if the option
is specified with no argument the argument is parsed as if it were
passed an empty string. This make it easier to add options to existing
boolean arguments (the existing --option can default to TRUE).
Tomi Ollila [Sun, 24 Jun 2012 18:48:34 +0000 (21:48 +0300)]
ruby: extern linkage portability improvement
Some C compilers are stricter when it comes to (tentative) definition
of a variable -- in those compilers introducing variable without 'extern'
keyword always allocates new 'storage' to the variable and linking all
these modules fails due to duplicate symbols.
This is reimplementation of Charlie Allom's patch:
id:"
1336481467-66356-1-git-send-email-charlie@mediasp.com",
written originally by Ali Polatel. This version has
more accurate commit message.
Mark Walters [Mon, 7 May 2012 07:02:09 +0000 (00:02 -0700)]
emacs: add pipe attachment command
Allow the user to pipe the attachment somewhere. Bound to '|' on the
attachment button.
Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
Jesse Rosenthal [Thu, 14 Jun 2012 17:16:03 +0000 (13:16 -0400)]
emacs: derive correct timestamp in FCC unique name
Previously, the timestamp at the beginning of the FCC unique maildir
name was derived incorrectly, thanks to an integer overflow. This
changes the derivation of timestamp to use a float, and so will get
the number correct at least until 2038. (It is still formatted with
"%d" so it will show up as an integer.) Should we need to change it in
the next 26 years to take the unix millenium into account, it will be
invisible to users.
This change is mostly a question of consistency, since the unique name
is arbitrary anyway. But since most people use timestamps, and that was
the original intention here as well, we might as well.
Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
Austin Clements [Sat, 9 Jun 2012 19:14:18 +0000 (15:14 -0400)]
News for updated maildir sync semantics
Austin Clements [Sat, 9 Jun 2012 19:14:17 +0000 (15:14 -0400)]
lib: Treat messages in new/ as maildir messages with no flags set
Previously, notmuch new only synchronized maildir flags to tags for
files with a maildir "info" part. Since messages in new/ don't have
an info part, notmuch would ignore them for flag-to-tag
synchronization.
This patch makes notmuch consider messages in new/ to be legitimate
maildir messages that simply have no maildir flags set. The most
visible effect of this is that such messages now automatically get the
unread tag.
Austin Clements [Sat, 9 Jun 2012 19:14:16 +0000 (15:14 -0400)]
lib: Only synchronize maildir flags for messages in maildirs
Previously, we synchronized flags to tags for any message that looked
like it had maildir flags in its file name, regardless of whether it
was in a maildir-like directory structure. This was asymmetric with
tag-to-flag synchronization, which only applied to messages in
directories named new/ and cur/ (introduced by
95dd5fe5).
This change makes our interpretation stricter and addresses this
asymmetry by only synchronizing flags to tags for messages in
directories named new/ or cur/. It also prepares us to treat messages
in new/ as maildir messages, even though they lack maildir flags.
Austin Clements [Sat, 9 Jun 2012 19:14:15 +0000 (15:14 -0400)]
lib: Move _filename_is_in_maildir
This way notmuch_message_maildir_flags_to_tags can call it. It makes
more sense for this to be just above all of the maildir
synchronization code rather than mixed in the middle.
Austin Clements [Sat, 9 Jun 2012 19:14:14 +0000 (15:14 -0400)]
test: Add broken test for tag synchronization on files delivered to new/
Currently, notmuch new only synchronizes maildir flags to tags for
files that have an "info" part. However, in maildir, new mail doesn't
gain the info part until it moves from new/ to cur/. Hence, even
though mail in new/ doesn't have an info part, it is still a maildir
message and thus has maildir flags (though none of them set).
The most visible effect of not synchronizing maildir flags for
messages in new/ is that newly delivered messages don't get the unread
tag (unless it is assigned by some other mechanism, like new.tags).
This patch does *not* modify the test for messages in cur/ that do not
have an "info" part. Unlike a message in new/, a message in cur/
without an info part is no longer a maildir message, and thus
shouldn't be subject to maildir flag synchronization.
Jameson Graef Rollins [Sat, 26 May 2012 18:45:46 +0000 (11:45 -0700)]
cli: use new notmuch_crypto_get_context in mime-node.c
This has the affect of lazily creating the crypto contexts only when
needed. This removes code duplication from notmuch-show and
notmuch-reply, and should speed up these functions considerably if the
crypto flags are provided but the messages don't have any
cryptographic parts.
Jameson Graef Rollins [Sat, 26 May 2012 18:45:45 +0000 (11:45 -0700)]
cli: new crypto verify flag to handle verification
Use this flag rather than depend on the existence of an initialized
gpgctx, to determine whether we should verify a multipart/signed. We
will be moving to create the ctx lazily, so we don't want to depend on
it being previously initialized if it's not needed.
Jameson Graef Rollins [Sat, 26 May 2012 18:45:44 +0000 (11:45 -0700)]
cli: modify mime_node_context to use the new crypto struct
This simplifies some more interfaces.
Jameson Graef Rollins [Sat, 26 May 2012 18:45:43 +0000 (11:45 -0700)]
cli: modify mime_node_open to take new crypto struct as argument
This simplifies the interface considerably.
Jameson Graef Rollins [Sat, 26 May 2012 18:45:42 +0000 (11:45 -0700)]
cli: modify show and reply to use new crypto struct
notmuch_show_params_t is modified to use the new notmuch_crypto_t, and
notmuch-show and notmuch-reply are modified accordingly.
Jameson Graef Rollins [Sat, 26 May 2012 18:45:41 +0000 (11:45 -0700)]
cli: new crypto structure to store crypto contexts and parameters, and functions to support it
This new structure, notmuch_crypto_t, keeps all relevant crypto
contexts and parameters together, and will make it easier to pass the
stuff around and clean it up. The name of the crypto context inside
this new struct will change, to reflect that it is actually a GPG
context, which is a sub type of Crypto context. There are other types
of Crypto contexts (Pkcs7 in particular, which we hope to support) so
we want to be clear.
The new crypto.c contains functions to return the proper context from
the struct for a given protocol (and initialize it if needed), and to
cleanup a struct by releasing the crypto contexts.
Jameson Graef Rollins [Sat, 26 May 2012 18:45:40 +0000 (11:45 -0700)]
cli: use new typedef to deal with gmime 2.4/2.6 context incompatibility
gmime 2.4 defines GMimeCipherContext, while 2.6 defines
GMimeCryptoContext. typedef them both to notmuch_crypto_context_t to
cover this discrepancy and remove a bunch of #ifdefs.
Jani Nikula [Tue, 5 Jun 2012 15:42:51 +0000 (18:42 +0300)]
emacs: only strip "re:" in the beginning of subject
Fix notmuch-show-strip-re by matching "re:" only in the beginning of
the input string.
Jani Nikula [Tue, 5 Jun 2012 15:42:50 +0000 (18:42 +0300)]
test: add test for emacs notmuch-show-strip-re function
The function is used for stripping "re:" from subjects to generate
"bare subjects". Include broken test for having "re:" in the middle of
the subject.
Tomi Ollila [Sun, 1 Apr 2012 18:28:42 +0000 (21:28 +0300)]
nmbug: check whether every forked process exit with (non)zero value
If any of the forked process exits with nonzero value, terminate
current operation -- nonzero exit value indicates failure and
then there is no point continuing.
Tomi Ollila [Tue, 7 Feb 2012 16:34:17 +0000 (18:34 +0200)]
uncrustify.cfg: comments and more types
Changes to devel/uncrustify.cfg:
* Updated header comment to state this is config file for *notmuch*.
* Added comment about the reason of 'type' keyword used.
* Added some more custom types woth 'type' keyword.
* Have (every) multiline comment lines start with '*'.
Austin Clements [Thu, 29 Mar 2012 04:33:42 +0000 (00:33 -0400)]
emacs: Suppress warnings about using cl at runtime
It was decided in the thread starting at [0] that it is okay for
notmuch to use 'cl runtime functions. However, by default, these
produce byte compiler warnings. This suppresses those using
file-local variables.
[0] id:"m262g864dz.fsf@wal122.wireless-pennnet.upenn.edu"
Jameson Graef Rollins [Sat, 2 Jun 2012 18:16:01 +0000 (11:16 -0700)]
config: add quoting to fix IFS bug
Without proper quoting the DEFAULT_IFS was getting set incorrectly,
which was causing problems with the storage of some variables later in
the script. Quoting fixes the problem.
David Bremner [Sun, 3 Jun 2012 14:38:08 +0000 (11:38 -0300)]
Merge tag '0.13.2'
notmuch 0.13.2 release
David Bremner [Sat, 2 Jun 2012 21:17:42 +0000 (18:17 -0300)]
debian: changelog stanza for 0.13.2-1
David Bremner [Sat, 2 Jun 2012 21:15:06 +0000 (18:15 -0300)]
NEWS: update for 0.13.2
David Bremner [Sat, 2 Jun 2012 21:10:55 +0000 (18:10 -0300)]
version: update to 0.13.2
Austin Clements [Fri, 1 Jun 2012 14:16:49 +0000 (10:16 -0400)]
notmuch-deliver: Update to new notmuch_database_open API
Commit
5fddc07 changed this API, but missed this use of it.
Stefano Zacchiroli [Tue, 29 May 2012 20:44:27 +0000 (22:44 +0200)]
notmuch-mutt: lookup notmuch-search-terms(7) when asked for help
When asked for interactive help, lookup notmuch-search-terms(7)
instead of notmuch(1). Syntax of notmuch queries used to be described
in the latter, but has recently been moved to the former.
Closes: #675073 (in the Debian BTS)
David Bremner [Tue, 29 May 2012 12:07:31 +0000 (09:07 -0300)]
Merge branch 'release'
David Bremner [Mon, 28 May 2012 23:40:45 +0000 (20:40 -0300)]
NEWS: add item about ruby bindings.
Corrections or clarifications welcome.
Felipe Contreras [Fri, 25 May 2012 13:08:17 +0000 (15:08 +0200)]
Revert "ruby: Add workarounds to use in-tree build not the installed one"
This reverts commit
82b73ffd7380b85d259eeb91100dd6ac2d14223a.
Only leave the copyright changes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
(cherry picked from commit
35cb1c95cc8afa964900d29c813349ad8e24e7a8)
Jameson Graef Rollins [Wed, 23 May 2012 18:38:47 +0000 (11:38 -0700)]
configure: add help note about gmime version
Jameson Graef Rollins [Wed, 23 May 2012 18:41:20 +0000 (11:41 -0700)]
cli: fix documentation about --decrypt for show
Forgot to mention that it implies --verify.
Dmitry Kurochkin [Fri, 25 May 2012 13:02:55 +0000 (17:02 +0400)]
test: remove "Testing" from test description in emacs-hello and emacs-show
"Testing" is printed by test/test-lib.sh, so having "Testing" in test
description results in duplicate "Testing" in console output.
David Bremner [Sat, 26 May 2012 00:25:29 +0000 (21:25 -0300)]
debian: changelog stanza for 0.13.1
David Bremner [Sat, 26 May 2012 00:17:54 +0000 (21:17 -0300)]
version: bump to 0.13.1
David Bremner [Sat, 26 May 2012 00:13:19 +0000 (21:13 -0300)]
fix release date for 0.13.1
Austin Clements [Fri, 25 May 2012 01:17:26 +0000 (21:17 -0400)]
NEWS for directory function fixes
Felipe Contreras [Fri, 25 May 2012 13:08:17 +0000 (15:08 +0200)]
Revert "ruby: Add workarounds to use in-tree build not the installed one"
This reverts commit
82b73ffd7380b85d259eeb91100dd6ac2d14223a.
Only leave the copyright changes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Jani Nikula [Thu, 24 May 2012 05:15:50 +0000 (08:15 +0300)]
test: add tests for notmuch reply From guessing
Add tests for picking up user's From address from fallback headers
Envelope-To, X-Original-To, and Delivered-To.
Signed-off-by: Jani Nikula <jani@nikula.org>
Jani Nikula [Thu, 24 May 2012 05:15:49 +0000 (08:15 +0300)]
cli: also use Delivered-To header to figure out the reply from address
Add another fallback header Delivered-To for guessing the user's from
address for notmuch reply before using the Received
headers. Apparently some MTAs use Delivered-To instead of
X-Original-To (which already exists as a fallback).
Reported-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Signed-off-by: Jani Nikula <jani@nikula.org>
Austin Clements [Thu, 24 May 2012 19:32:31 +0000 (15:32 -0400)]
Recommend libgmime-2.6-dev in INSTALL
Given that everything prefers 2.6 over 2.4, it seems appropriate to
suggest that people install the 2.6 dev package instead of 2.4.
Austin Clements [Thu, 24 May 2012 22:01:13 +0000 (18:01 -0400)]
new: Unify add_files and add_files_recursive
Since starting at the top of a directory tree and recursing within
that tree are now identical operations, there's no need for both
add_files and add_files_recursive. This eliminates add_files (which
did nothing more than call add_files_recursive after the previous
patch) and renames add_files_recursive to add_files.
Austin Clements [Thu, 24 May 2012 22:01:12 +0000 (18:01 -0400)]
new: Merge error checks from add_files and add_files_recursive
Previously, add_files_recursive could have been called on a symlink to
a non-directory. Hence, calling it on a non-directory was not an
error, so a separate function, add_files, existed to fail loudly in
situations where the path had to be a directory.
With the new stat-ing logic, add_files_recursive is always called on
directories, so the separation of this logic is no longer necessary.
Hence, this patch moves the strict error checking previously done by
add_files into add_files_recursive.