aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.c
Commit message (Collapse)AuthorAge
* cli: change argument parsing convention for subcommandsGravatar David Bremner2011-10-22
| | | | | | | | | previously we deleted the subcommand name from argv before passing to the subcommand. In this version, the deletion is done in the actual subcommands. Although this causes some duplication of code, it allows us to be more flexible about how we parse command line arguments in the subcommand, including possibly using off-the-shelf routines like getopt_long that expect the name of the command in argv[0].
* docs: Update man page, NEWS and online help for new dump arguments.Gravatar David Bremner2011-10-16
| | | | | We mention in all three places that using the filename argument is deprecated.
* Add missing call to g_type_init()Gravatar Aaron Ecay2011-09-10
| | | | | | | | | The Glib docs state "Prior to any use of the type system, g_type_init() has to be called".[1] To not do so can lead to segfaults. The g_type system is currently used by various "filters" that operate on uuencoded text, message headers, etc. [1] http://developer.gnome.org/gobject/2.28/gobject-Type-Information.html#g-type-init
* fix sum moar typos [user-visible documentation in code]Gravatar Pieter Praet2011-06-23
| | | | | | | | | | | | Various typo fixes in documentation within the code that can be made available to the user, (emacs function help strings, "notmuch help" output, notmuch man page, etc.). Signed-off-by: Pieter Praet <pieter@praet.org> Edited-by: Carl Worth <cworth@cworth.org> Restricted to just documentation and fixed fix of "comman" to "common" rather than "command".
* Add decryption of PGP/MIME-encrypted parts with --decrypt.Gravatar Jameson Graef Rollins2011-05-27
| | | | | | | | | | | | | This adds support for decrypting PGP/MIME-encrypted parts to notmuch-show and notmuch-reply. The --decrypt option implies --verify. Once decryption (and possibly signature verification) is done, a new part_encstatus formatter is emitted, the part_sigstatus formatter is emitted, and the entire multipart/encrypted part is replaced by the contents of the encrypted part. At the moment only a json part_encstatus formatting function is available, even though decryption is done for all formats. Emacs support to follow.
* Add signature verification of PGP/MIME-signed parts with --verify.Gravatar Jameson Graef Rollins2011-05-27
| | | | | | | | | | | | | | | | This is primarily for notmuch-show, although the functionality is added to show-message. Once signatures are processed a new part_sigstatus formatter is emitted, and the entire multipart/signed part is replaced with the contents of the signed part. At the moment only a json part_sigstatus formatting function is available. Emacs support to follow. The original work for this patch was done by Daniel Kahn Gillmor <dkg@fifthhorseman.net> whose help with this functionality I greatly appreciate.
* notmuch: Implement search-tags as an alias for "search --output=tags *"Gravatar Carl Worth2011-05-24
| | | | | | | | | | | Ever since we added support for "notmuch search --output=tags" the "notmuch search-tags" command has been redundant. The recent addition of alias support makes it easy to drop the explicit search-tags command in favor of a simple alias that runs "notmuch search --output=tags *". So there's no longer any documentation of the search-tags command, but existing scripts will not break at all.
* notmuch show: Update documentation for default --format=raw for --partGravatar Carl Worth2011-05-24
| | | | | | | | We recently made the --part option to "notmuch show" trigger a default format of "raw", (since the previous default of "text" is not often useful with a single part---especially a non-text part). Here, we update the documentation to match.
* notmuch: Support "notmuch part" as an alias for "notmuch show --format=raw"Gravatar Carl Worth2011-05-24
| | | | | | | | | | We unifed the "notmuch part" functionality into "notmuch show" where the implementation is both simpler and more powerful. But there's no good reason to break users of the old interface. Add support for aliases, which are undocumented means of getting at functionality through deprecated names. The first such alias is "notmuch part" as implemented here.
* New part output handling as option to notmuch-show.Gravatar Jameson Graef Rollins2011-05-23
| | | | | | | | | Outputting of single MIME parts is moved to an option of notmuch show, instead of being handled in it's own sub-command. The recent rework of multipart mime allowed for this change but consolidating part handling into a single recursive function (show_message_part) that includes formatting. This allows for far simpler handling single output of a single part, including formatting.
* notmuch show: Properly nest MIME parts within mulipart partsGravatar Carl Worth2011-05-17
| | | | | | | | | | | | | | | | | | | | | | | Previously, notmuch show flattened all output, losing information about the nesting of the MIME hierarchy. Now, the output is properly nested, (both in the --format=text and --format=json output), so that clients can analyze the original MIME structure. Internally, this required splitting the final closing delimiter out of the various show_part functions and putting it into a new show_part_end function instead. Also, the show_part function now accepts a new "first" argument that is set not only for the first MIME part of a message, but also for each first MIME part within a series of multipart parts. This "first" argument controls the omission of a preceding comma when printing a part (for json). Many thanks to David Edmondson <dme@dme.org> for originally identifying the lack of nesting in the json output and submitting an early implementation of this feature. Thanks as well to Jameson Graef Rollins <jrollins@finestructure.net> for carefully shepherding David's patches through a remarkably long review process, patiently explaining them, and providing a cleaned up series that led to this final implementation. Jameson also provided the new emacs code here.
* notmuch search: Clean up some memory leaks during search loop.Gravatar Carl Worth2011-01-26
| | | | | | | | | | With talloc, we were already freeing all memory by the time we exited the loop, but that didn't help with excess use of memory inside the loop, (which was mostly from tallocing some objects with the incorrect parent). Thanks to Andrew Tridgell for sitting next to me and teaching me to use talloc_report_full to find these leaks.
* Add documentation for the recently added folder-based searching.Gravatar Carl Worth2011-01-15
| | | | Augmenting both the builtin help as well as the manual page.
* Rename "notmuch cat" to "notmuch show --format=raw"Gravatar Carl Worth2010-11-06
| | | | | | | | | This is part of an effort to avoid proliferation of excessive top-level notmuch commands. Also, "raw" better captures the functionality here, (as opposed to "cat" which is a fairly oblique reference to a bad Unix abbreviation whose metaphor doesn't work here since "notmuch cat" operates only on a single message and hence cannot "con'cat'enate" anything).
* Add 'cat' subcommandGravatar Michal Sojka2010-11-05
| | | | | | | | | | | | This command outputs a raw message matched by search term to the standard output. It allows MUAs to access the messages for piping, attachment manipulation, etc. by running notmuch cat rather then directly access the file. This will simplify the MUAs when they need to operate on a remote database. Edited-by: Carl Worth <cworth@cworth.org>: Remove trailing whitespace, add missing "test_done" to new test script to avoid "Unexpected exit" error.
* documentation: Add the "files" option to the synopsis of "search --output="Gravatar Carl Worth2010-10-28
| | | | | This was inadvertently left off when --output=files was recently added as a new option.
* notmuch search: Add a new "notmuch search --output=files"Gravatar Carl Worth2010-10-28
| | | | Yet another thing that will be extremely handy for scripts.
* notmuch search: Add a new --output=(summary|threads|messages|tags) option.Gravatar Carl Worth2010-10-28
| | | | | This can be handy for scripts which need to extract just a thread ID from a search term, for example.
* notmuch config: Allow for new "notmuch config set" in addition to getGravatar Carl Worth2010-10-27
| | | | | | It is now possible to set configuration items from the command-line in a manner quite similar to the support for querying configuration items.
* notmuch: Add a new "notmuch config" command for querying configuration.Gravatar Carl Worth2010-10-27
| | | | | So far, we implement only "notmuch config get". It won't be too much work from here to also implement "notmuch config set".
* notmuch show: Add documentation of --format=mboxGravatar Carl Worth2010-09-16
| | | | | Shame on me for adding a feature without documenting it at the same time.
* Fix help message for "show"Gravatar Jameson Rollins2010-04-21
| | | | | Help message for "show" mistakenly refers to '--output' instead of '--format'.
* notmuch.c: Shorten version stringGravatar Sebastian Spaeth2010-04-16
| | | | | | | | We previously output "notmuch version 0.1" as response to notmuch --version. Shorten this to "notmuch 0.1" as we know that we will receive a version number when we explicitely ask for it. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
* notmuch count: Remove unneeded paragraph from documentation.Gravatar Carl Worth2010-04-09
| | | | | This paragraph acts like it's introducing an example, but then no example is given. Just drop this.
* notmuch count: Remove special handling of "*".Gravatar Carl Worth2010-04-09
| | | | | | From both the implementation and from the documentation. This is handled generically in the library for all search-based commands, so count doesn't need special treatment.
* notmuch: Document the new special-case syntax of "*".Gravatar Carl Worth2010-04-09
| | | | This functionality came through a recent addition to the library.
* Have notmuch count default to showing the total.Gravatar Mike Kelly2010-04-09
| | | | | | | If no parameters are given to notmuch-count, or just '' or '*' are given, return the total number of messages in the database. update notmuch count help
* Merge remote branch 'dme/dme-for-cworth'Gravatar Carl Worth2010-04-02
|\ | | | | | | | | Conflicts: notmuch.c (Simply the change in documentation indentation level).
* | notmuch help: Eliminate a gratuitous level of indentation.Gravatar Carl Worth2010-04-02
| | | | | | | | | | | | I don't really know why we ended up having everything indented by two tabs, (perhaps trying to make it match the man page)? But wihout any containing context to justify that it just looks odd.
* | notmuch help: Simplify output by omitting arguments for each command.Gravatar Carl Worth2010-04-02
| | | | | | | | | | | | | | | | | | The output was far too busy otherwise. It's more useful to just show the argument list in the case of "notmuch help <command>" for a specific command. (Credit due to running "git help" and seeing a much more readable list than what was coming out of "notmuch help".)
* | notmuch: Add a version (0.1 initially) with a new --version option.Gravatar Carl Worth2010-04-02
| | | | | | | | | | We're planning to do actual releases soon, so we need a version number to put into the tar file.
* | notmuch: Add support for a --help option.Gravatar Carl Worth2010-04-02
| | | | | | | | | | | | Previously, only "notmuch help" worked while a call to "notmuch --help" would just print a message telling the user to call "notmuch help". Instead of the redirection, just support --help directly now.
| * notmuch: Add a 'part' subcommandGravatar David Edmondson2010-04-02
|/ | | | | | | | | | | A new 'part' subcommand allows the user to extract a single part from a MIME message. Usage: notmuch part --part=<n> <search terms> The search terms must match only a single message (e.g. id:foo@bar.com). The part number specified refers to the part identifiers output by `notmuch show'. The content of the part is written the stdout with no formatting or identification marks. It is not JSON formatted.
* Add is:<tag> as a synonym for tag:<tag> in search terms.Gravatar Carl Worth2010-03-09
| | | | | I like the readability of this, it provides compatibility with people trained in this syntax by sup, and it even saves one character.
* Add an "--format=(json|text)" command-line option to both notmuch-search and ↵Gravatar Scott Robinson2010-02-23
| | | | | | | | | | | | | notmuch-show. In the case of notmuch-show, "--format=json" also implies "--entire-thread" as the thread structure is implicit in the emitted document tree. As a coincidence to the implementation, multipart message ID numbers are now incremented with each part printed. This changes the previous semantics, which were unclear and not necessary related to the actual ordering of the message parts.
* notmuch new: Remove hack to ignore read-only directories in mail store.Gravatar Carl Worth2010-01-06
| | | | | | | This was really the last thing keeping the initial run of "notmuch new" being different from all other runs. And I'm taking a fresh look at the performance of "notmuch new" anyway, so I think we can safely drop this optimization.
* notmuch.1: Document the new --entire-thread option to "notmuch show".Gravatar Carl Worth2009-12-02
| | | | | This was added to "notmuch help" earlier, but not to the man page. Add it there, and use consistent wording in both places.
* notmuch show: limit display to only matching messagesGravatar Bart Trojanowski2009-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the default behaviour of notmuch show to display only messages that match the search expression. However, --entire-thread option is provided to display all messages in threads that matched the search expression. It is deemed that will be more useful for human users on the command line. Scripts can be modified to include the --entire-thread option so that they can display all messages once more. Example: $ notmuch search subject:git AND thread:23d99d0f364f93e90e15df8b42eddb5b thread:23d99d0f364f93e90e15df8b42eddb5b July 31 [4/12] Johan Herland; [RFCv2 00/12] Foreign VCS helper program for CVS repositories (inbox unread) Note that in this thread 4 out of 12 messages matched. The default show behaviour is to show only those messages that match: $ notmuch show subject:git AND thread:23d99d0f364f93e90e15df8b42eddb5b | grep 'message{' | wc -l 4 With the --entire-thread option the output will contain all dozen messages: $ notmuch show --entire-thread subject:git AND thread:23d99d0f364f93e90e15df8b42eddb5b | grep 'message{' | wc -l 12 Signed-off-by: Bart Trojanowski <bart@jukie.net>
* Documentation for notmuch reply --format=(default|headers-only)Gravatar Jed Brown2009-11-28
| | | | Signed-off-by: Jed Brown <jed@59A2.org>
* search-tags: Add support for search-terms.Gravatar Jan Janak2009-11-26
| | | | | | | | | | | | | | | This patch adds support for search-terms to 'notmuch search-tags'. If no search-term is provided then the command returns a list of all tags from the database. If the user provides one or more search-terms as arguments then the command collects tags from matching messages only. This could be used by functions in the Emacs mode to further limit the list of tags offered for completion. For example, functions that remove tags from message(s) could offer only tags present in the message(s). Signed-off-by: Jan Janak <jan@ryngle.com>
* notmuch: New command 'search-tags'.Gravatar Jan Janak2009-11-26
| | | | | | | | | | This is a new notmuch command that can be used to search for all tags found in the database. The resulting list is alphabetically sorted. The primary use-case for this new command is to provide the tag completion feature in Emacs (and other interfaces). Signed-off-by: Jan Janak <jan@ryngle.com>
* notmuch search: Remove the chunked-searching hack.Gravatar Carl Worth2009-11-23
| | | | | | | | | | | | | This was a poor workaround around the fact that the existing notmuch_threads_t object is implemented poorly. It's got a fine iterartor-based interface, but the implementation does all of the work up-front in _create rather than doing the work incrementally while iterating. So to start fixing this, first get rid of all the hacks we had working around this. This drops the --first and --max-threads options from the search command, (but hopefully nobody was using them anyway---notmuch.el certainly wasn't).
* Fix printing of literal '%' in help message.Gravatar Carl Worth2009-11-23
| | | | I suppose I could have just used puts instead...
* Add rudimentary date-based search.Gravatar Carl Worth2009-11-23
| | | | | | | | | | | | | The rudimentary aspect here is that the date ranges are specified with UNIX timestamp values (number of seconds since 1970-01-01 UTC). One thing that can help here is using the date program to determins timestamps, such as: $(date +%s -d 2009-10-01)..$(date +%s) Long-term, we'll probably need to do our own query parsing to be able to support directly-specified dates and also relative expressions like "since:'2 months ago'".
* Add 'notmuch count' command to show the count of matching messagesGravatar Keith Packard2009-11-23
| | | | | | | | | | | Getting the count of matching threads or messages is a fairly expensive operation. Xapian provides a very efficient mechanism that returns an approximate value, so use that for this new command. This returns the number of matching messages, not threads, as that is cheap to compute. Signed-off-by: Keith Packard <keithp@keithp.com>
* Support multiple configuration files via $NOTMUCH_CONFIGGravatar Alec Berryman2009-11-23
| | | | | If present, $NOTMUCH_CONFIG will be used as the configuration file location.
* Support for printing file paths in new commandGravatar Adrian Perez2009-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For very large mail boxes, it is desirable to know which files are being processed e.g. when a crash occurs to know which one was the cause. Also, it may be interesting to have a better idea of how the operation is progressing when processing mailboxes with big messages. This patch adds support for printing messages as they are processed by "notmuch new": * The "new" command now supports a "--verbose" flag. * When running in verbose mode, the file path of the message about to be processed is printed in the following format: current/total: /path/to/message/file Where "current" is the number of messages processed so far and "total" is the total count of files to be processed. The status line is erased using an ANSI sequence "\033[K" (erase current line from the cursor to the end of line) each time it is refreshed. This should not pose a problem because nearly every terminal supports it. * The signal handler for SIGALRM and the timer are not enabled when running in verbose mode, because we are already printing progress with each file, periodical reports are not neccessary.
* notmuch main(): Remove stale comment.Gravatar Carl Worth2009-11-18
| | | | The code this comment was referring to has since been deleted.
* notmuch help: Print to stdout, not to stderr.Gravatar Lars Kellogg-Stedman2009-11-18
| | | | | | Let usage() take a FILE * argument so that you can output to stderr in response to usage errors, and stdout in response to an explicit request.
* notmuch help: Update documentation (following recent text from notmuch.1)Gravatar Carl Worth2009-11-17
| | | | | | | We take the recently created text from the notmuch manual page and update the "notmuch help" command to use similar text. In particular, we add a new "notmuch help search-terms" for documenting the search syntax that is common to several commands.