aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* man: Update notmuch-dump(1) and notmuch-restore(1)Gravatar Austin Clements2013-01-06
| | | | | Describe the new batch-tag format. For notmuch-restore, rather than half-heartedly duplicating the description, we now cite notmuch-dump.
* dump/restore: Use Xapian queries for batch-tag formatGravatar Austin Clements2013-01-06
| | | | | | | | | | | | | | This switches the new batch-tag format away from using a home-grown hex-encoding scheme for message IDs in the dump to simply using Xapian queries with Xapian quoting syntax. This has a variety of advantages beyond presenting a cleaner and more consistent interface. Foremost is that it will dramatically simplify the quoting for batch tagging, which shares the same input format. While the hex-encoding is no better or worse for the simple ID queries used by dump/restore, it becomes onerous for general-purpose queries used in batch tagging. It also better handles strange cases like "id:foo and bar", since this is no longer syntactically valid.
* dump: Disallow \n in message IDsGravatar Austin Clements2013-01-06
| | | | | | | | | | | | | | | When we switch to using regular Xapian queries in the dump format, \n will cause problems, so we disallow it. Specially, while Xapian can quote and parse queries containing \n without difficultly, quoted queries containing \n still span multiple lines, which breaks the line-orientedness of the dump format. Strictly speaking, we could still round-trip these, but it would significantly complicate restore as well as scripts that deal with tag dumps. This complexity would come at absolutely no benefit: because of the RFC 2822 unfolding rules, no amount of standards negligence can produce a message with a message ID containing a line break (not even Outlook can do it!). Hence, we simply disallow it.
* util: Function to parse boolean term queriesGravatar Austin Clements2013-01-06
| | | | | | | This parses the subset of Xapian's boolean term quoting rules that are used by make_boolean_term. This is provided as a generic string utility, but will be used shortly in notmuch restore to parse and optimize for ID queries.
* util: Factor out boolean term quoting routineGravatar Austin Clements2013-01-06
| | | | | | | | | | | | | | | | | This is now a generic boolean term quoting function. It performs minimal quoting to produce user-friendly queries. This could live in tag-util as well, but it is really nothing specific to tags (although the conventions are specific to Xapian). The API is changed from "caller-allocates" to "readline-like". The scan for max tag length is pushed down into the quoting routine. Furthermore, this now combines the term prefix with the quoted term; arguably this is just as easy to do in the caller, but this will nicely parallel the boolean term parsing function to be introduced shortly. This is an amalgamation of code written by David Bremner and myself.
* restore: Make missing messages non-fatal (again)Gravatar Austin Clements2013-01-06
| | | | | | | | | | | | | Previously, restore would abort if a message ID in the dump was missing. Furthermore, it would only report this as a warning. This patch makes it distinguish abort-worthy lookup failures like out-of-memory from non-fatal failure to find a message ID. The former is reported as an error and causes restore to abort, while the latter is reported as a warning and does not cause an abort. This restores 0.14's non-fatal handling of missing message IDs in restore (though 0.14 also considered serious errors non-fatal; we retain the new and better handling of serious errors).
* notmuch-restore: handle empty input file, leading blank lines and comments.Gravatar David Bremner2013-01-06
| | | | | | | | | | This patch corrects several undesirable behaviours: 1) Empty files were not detected, leading to buffer read overrun. 2) An initial blank line cause restore to silently abort 3) Initial comment line caused format detection to fail
* test/dump-restore: new tests for empty files and leading comments/whitespace.Gravatar David Bremner2013-01-06
| | | | | Three of these are marked broken; the third is a regression test, since it passes by virtue of batch-tag being the default input format.
* perf-test: initial support for talloc leak report in memory testsGravatar David Bremner2012-12-30
| | | | | As with the valgrind logs, we print a (very) brief summary and leave the log for inspection.
* notmuch-restore: use debug version of talloc_strndupGravatar David Bremner2012-12-30
| | | | This gives line numbers for better debugging.
* util: add talloc-extra.[ch]Gravatar David Bremner2012-12-30
| | | | | These are intended to be simple wrappers to provide slightly better debugging information than what talloc currently provides natively.
* CLI: add talloc leak report, controlled by an environment variable.Gravatar David Bremner2012-12-30
| | | | | | | The argument handling in notmuch.c seems due for an overhaul, but until then use an environment variable to specify a location to write the talloc leak report to. This is only enabled for the (interesting) case where some notmuch subcommand is invoked.
* notmuch-tag.1: tidy synopsis formatting, referenceGravatar David Bremner2012-12-26
| | | | Consistently use [...]; one less space. Use singular <search-term>
* parse_tag_line: use enum for return value.Gravatar David Bremner2012-12-26
| | | | | This is essentially cosmetic, since success=0 is promised by the comments in tag-utils.h.
* contrib: pick: close message pane when quitting from show in the message paneGravatar Mark Walters2012-12-25
| | | | | | | We add a hook to the show buffer in the message window to close the message window when that buffer quits. It checks that the message-window is still displaying the show-message buffer and then closes it.
* NEWS for emacs part visibility changeGravatar Mark Walters2012-12-25
| | | | Wording suggested by Austin.
* perf-test: add memory leak test for dump restoreGravatar David Bremner2012-12-25
| | | | | | In id:87vcc2q5n2.fsf@nikula.org, Jani points out a memory leak in the current version of the sup restore code. Among other things, this test is intended to verify a fix for that leak.
* perf-test: initial version of memory test infrastructure.Gravatar David Bremner2012-12-25
| | | | | | | | | | | | | | | | The idea is run some code under valgrind --leak-check=full and report a summary, leaving the user to peruse the log file if they want. We go to some lengths to preserve the log files from accidental overwriting; the full corpus takes about 3 hours to run under valgrind on my machine. The naming of the log directories may be slightly controversial; in the unlikely event of two runs in less than a second, the log will be overwritten. A previous version with mktemp+timestamp was dismissed as overkill; just mktemp alone does not sort nicely. One new test is included, to check notmuch new for memory leaks.
* perf-test: rename current tests as "time tests"Gravatar David Bremner2012-12-25
| | | | | | | | This is almost entirely renaming files, except for updating a few references to those file names, and changing the makefile target. A new set of memory tests will be run separately because they take much longer.
* perf-test: remove redundant "initial notmuch new"Gravatar David Bremner2012-12-25
| | | | | The initial notmuch-new and caching are now done automatically by time_start
* contrib: pick: slightly tweak running search and pick from pick bufferGravatar Mark Walters2012-12-24
| | | | | | | | | Previously running search or pick from the pick buffer did not close the message pane (if open). This meant that then new search ends up in a very small window. Fix this so that the message pane is shut. However, make it so that the pane is shut after the search string is entered in case the user is basing the search on something in the current message.
* _notmuch_message_index_file: unref (free) address lists from gmime.Gravatar David Bremner2012-12-24
| | | | | | | | | Apparently as of GMime 2.4, you don't need to call internet_address_list_destroy anymore, but you still need to call g_object_unref (from the GMime Changelog). On the medium performance corpus, valgrind shows "possibly lost" leakage in "notmuch new" dropping from 7M to 300k.
* lib/message-file.c: use g_malloc () & g_free () in hash table valuesGravatar Tomi Ollila2012-12-24
| | | | | | | | | | | | | | | | | | | | | The message->headers hash table values get data returned by g_mime_utils_header_decode_text (). The pointer returned by g_mime_utils_header_decode_text is from the following line in rfc2047_decode_tokens return g_string_free (decoded, FALSE); The docs for g_string_free say Frees the memory allocated for the GString. If free_segment is TRUE it also frees the character data. If it's FALSE, the caller gains ownership of the buffer and must free it after use with g_free(). The remaining frees and allocations referencing to message->headers hash values have been changed to use g_free and g_malloc functions. This combines and completes the changes started by David Bremner.
* NEWS: emacs: hello point placement, tagging customization, thread id stashingGravatar Jani Nikula2012-12-22
|
* NEWS: notmuch search --format=text0Gravatar Jani Nikula2012-12-22
|
* notmuch-restore: allocate a temporary talloc context for each line parsed.Gravatar David Bremner2012-12-22
| | | | | This lets the high level code in notmuch restore be ignorant about what the lower level code is doing as far as allocating memory.
* tag-utils: use the tag_opt_list_t as talloc context, if possible.Gravatar David Bremner2012-12-22
| | | | | | | | | The memory usage discipline of tag_op_list_t is never to free the internal array of tag operations before freeing the whole list, so it makes sense to take advantage of hierarchical de-allocation by talloc. By not relying on the context passed into tag_parse_line, we can allow tag_op_list_t structures to live longer than that context.
* notmuch-restore: fix return value propagationGravatar David Bremner2012-12-22
| | | | | | | | | | Previously notmuch_restore_command returned 0 if tag_message returned a non-zero (failure) value. This is wrong, since non-zero status indicates something mysterious went wrong with retrieving the message, or applying it. There was also a failure to check or propagate the return value from tag_op_list_apply in tag_message.
* emacs: show: set default show-all-multipart/alternatives to nilGravatar Mark Walters2012-12-21
| | | | | | Now that the invisibility display of parts is present we no longer need to force the display of all multipart/alternatives: users can toggle them for themselves when needed.
* emacs: show: add invisibility button actionGravatar Mark Walters2012-12-21
| | | | | | | | | This adds a button action to show hidden parts. In this version "RET" toggles the visibility of any part which puts content in the buffer (as opposed to attachments such as application/pdf). The button is used to hide parts when appropriate (eg text/html in multipart/alternative).
* emacs: show: add overlays for each partGravatar Mark Walters2012-12-21
| | | | | | | | | | | This makes notmuch-show-insert-bodypart add an overlay for any non-trivial part with a button header (currently the first text/plain part does not have a button). At this point the overlay is available to the button but there is no action using it yet. In addition the argument HIDE is passed down to notmuch-show-insert-part-overlays to request that the part be hidden by default but this is not acted on yet.
* emacs: show: modify insert-part-header to save the button textGravatar Mark Walters2012-12-21
| | | | | | | This just make notmuch-show-insert-part-header save the basic button text for parts as an attribute. This makes it simpler for the button action (added in a later patch) to reword the label as appropriate (eg append "(not shown)" or not as appropriate).
* emacs: Eliminate buffer invisibility specs from show and washGravatar Austin Clements2012-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, all visibility in show buffers for headers, message bodies, and washed text was specified by generating one or more symbols for each region and creating overlays with their 'invisible property set to carefully crafted combinations of these symbols. Visibility was controlled not by modifying the overlays directly, but by adding and removing the generated symbols from a gigantic buffer invisibilty spec. This has myriad negative consequences. It's slow because Emacs' display engine has to traverse the buffer invisibility list for every overlay and, since every overlay has its own symbol, this makes rendering O(N^2) in the number of overlays. It composes poorly because symbol-type 'invisible properties are taken from the highest priority overlay over a given character (which is often ambiguous!), rather than being gathered from all overlays over a character. As a result, we have to include symbols related to message hiding in the wash code lest the wash overlays un-hide parts of hidden messages. It also requires various workarounds for isearch to properly open overlays, to set up buffer-invisibility-spec for remove-from-invisibility-spec to work right, and to explicitly refresh the display after updating the buffer invisibility spec. None of this is necessary. This patch converts show and wash to use simple boolean 'invisible properties and to not use the buffer invisibility spec. Rather than adding and removing generated symbols from the invisibility spec, the code now directly toggles the 'invisible property of the appropriate overlay. This speeds up rendering because the display engine only has to check the boolean values of the overlays over a character. It composes nicely because text will be invisible if *any* overlay over it has 'invisible t, which means we can overlap invisibility overlays with abandon. We no longer need any of the workarounds mentioned above. And it fixes a minor bug for free: now, when isearch opens a washed region, the button text will update to say "Click/Enter to hide" rather than remaining unchanged.
* news: Promote some things to a general sectionGravatar Austin Clements2012-12-21
| | | | | | | Date range search may be implemented as a library change, but it's an important user-facing change that affects all notmuch usage. Tag name restrictions aren't as important, but they affect both the CLI interface and the Emacs interface.
* News for changes from Austin ClementsGravatar Austin Clements2012-12-21
| | | | I fear I've fallen behind on my NEWS duties.
* python: remove now unused import of module sysGravatar Justus Winter2012-12-21
| | | | Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: remove functions that have been marked as deprecated in 0.14Gravatar Justus Winter2012-12-21
| | | | | | | | | | | Removes Message.{format,print}_messages. This code adds functionality at the python level that is unlikely to be useful for anyone. Furthermore the python bindings strive to be a thin wrapper around libnotmuch. The code has been marked as deprecated in 0.14 and is now removed. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* python: remove Database.db_pGravatar Justus Winter2012-12-21
| | | | | | The function has been marked as deprecated in 0.14 and is now removed. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
* man: document notmuch search --format=text0Gravatar Jani Nikula2012-12-18
|
* test: notmuch search --format=text0Gravatar Jani Nikula2012-12-18
|
* cli: add --format=text0 to notmuch searchGravatar Jani Nikula2012-12-18
| | | | | | | Add new format text0, which is otherwise the same as text, but use the null character as separator instead of the newline character. This is similar to find(1) -print0 option, and works together with the xargs(1) -0 option.
* sprinter: add text0 formatter for null character separated textGravatar Jani Nikula2012-12-18
| | | | | Same as the text formatter, but with each field separated by a null character rather than a newline character.
* sprinter: clarify separator documentationGravatar Jani Nikula2012-12-18
| | | | For text printers, the separator is a syntactic element.
* contrib: pick: Do not indent messages in the message paneGravatar Mark Walters2012-12-18
| | | | | | | Currently pick just uses notmuch-show to display messages in the message pane: this means that they get indented just as show would. However, since pick is only displaying one message at a time there is no need to indent so override the indentation.
* test: conform to content length, encoding fieldsGravatar Peter Wang2012-12-17
| | | | | | Update tests to expect content-length and content-transfer-encoding fields in show --format=json output, for leaf parts with omitted body content.
* show: indicate length, encoding of omitted body contentGravatar Peter Wang2012-12-17
| | | | | | | | | | | If a leaf part's body content is omitted, return the encoded length and transfer encoding in --format=json output. This information may be used by the consumer, e.g. to decide whether to download a large attachment over a slow link. Returning the _encoded_ content length is more efficient than returning the _decoded_ content length. Returning the transfer encoding allows the consumer to estimate the decoded content length.
* show: indicate charset for all omitted partsGravatar Peter Wang2012-12-17
| | | | | | Write a "charset" field for all omitted parts for which it is applicable, not only text/html parts. Factor out the code to a separate function. It will be extended with more fields next.
* test: normalize only message filenames in show jsonGravatar Peter Wang2012-12-17
| | | | | | | notmuch_json_show_sanitize replaced "filename" field values even in part structures, where the value is predictable. Make it only normalize the filename value if it is an absolute path (begins with slash), which is true of the Maildir filenames that were intended to be normalized away.
* emacs: Use --format-version for search, show, and replyGravatar Austin Clements2012-12-16
|
* emacs: Special handling for version mismatch errorsGravatar Austin Clements2012-12-16
| | | | | Since Emacs has more semantic information, we suppress the generic format version error from the CLI and give a more informative error.