]> git.notmuchmail.org Git - notmuch/commitdiff
Merge branch 'release'
authorDavid Bremner <bremner@debian.org>
Fri, 25 Jan 2013 02:29:09 +0000 (22:29 -0400)
committerDavid Bremner <bremner@debian.org>
Fri, 25 Jan 2013 02:29:09 +0000 (22:29 -0400)
Conflicts:
NEWS

Inserted news from 0.15.1

NEWS
bindings/python/notmuch/database.py
devel/TODO
devel/release-checks.sh
emacs/notmuch-hello.el
lib/Makefile.local
man/man1/notmuch.1
notmuch-tag.c
notmuch.c

diff --git a/NEWS b/NEWS
index 97f23058150d1d90daab39d9acbee53df626c4cf..9bd7a11e7513b763e0ead86d8c55eb1c7d87c794 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+Notmuch 0.16 (2013-MM-DD)
+=========================
+
+Command-Line Interface
+----------------------
+
+Deprecated commands "part" and "search-tags" are removed.
+
 Notmuch 0.15.1 (2013-01-24)
 =========================
 
@@ -191,8 +199,8 @@ Internal test framework changes
 
 The emacsclient binary is now user-configurable
 
-  The test framework now accepts TEST_EMACSCLIENT in addition to
-  TEST_EMACS for configuring the emacsclient to use.  This is
+  The test framework now accepts `TEST_EMACSCLIENT` in addition to
+  `TEST_EMACS` for configuring the emacsclient to use.  This is
   necessary to avoid using an old emacsclient with a new emacs, which
   can result in buggy behavior.
 
index fe692eb7ae4e38dceeb9aae24ca9b6cccb595a09..7ddf5cfe7d8d265980963ca09a1388b36717c851 100644 (file)
@@ -188,7 +188,7 @@ class Database(object):
                                        "already has an open one.")
 
         db = NotmuchDatabaseP()
-        status = Database._create(_str(path), Database.MODE.READ_WRITE, byref(db))
+        status = Database._create(_str(path), byref(db))
 
         if status != STATUS.SUCCESS:
             raise NotmuchError(status)
index eb757af5da2ab3c75099189dfc6c0de020f107bb..e4f36c2cb8530fc0621b48fe9d05147432aae293 100644 (file)
@@ -57,11 +57,6 @@ Automatically open a message when navigating to it with N or P.
 
 Change 'a' command in thread-view mode to only archive open messages.
 
-Add a binding to open all closed messages.
-
-Change the 'a'rchive command in the thread view to only archive open
-messages.
-
 Completion
 ----------
 Fix bash completion to complete multiple search options (both --first
@@ -75,11 +70,6 @@ listing of duplicate messages, (distinct filenames with the same
 Message-ID). I'm not sure what the option should be named. Perhaps
 --with-duplicates ?
 
-Add a -0 option to "notmuch search" so that one can safely deal with
-any filename with:
-
-       notmuch search --output=files -0 <terms> | xargs -0 <command>
-
 "notmuch setup" should use realpath() before replacing the
 configuration file. The ensures that the final target file of any
 intermediate symbolic links is what is actually replaced, (rather than
@@ -118,13 +108,6 @@ file.
 Allow configuration for filename patterns that should be ignored when
 indexing.
 
-Replace the "notmuch part --part=id" command with "notmuch show
---part=id", (David Edmondson wants to rewrite some of "notmuch show" to
-provide more MIME-structure information in its output first).
-
-Replace the "notmuch search-tags" command with "notmuch search
---output=tags".
-
 Fix to avoid this ugly message:
 
        (process:17197): gmime-CRITICAL **: g_mime_message_get_mime_part: assertion `GMIME_IS_MESSAGE (message)' failed
@@ -163,12 +146,13 @@ vs. tag-when-all-files-flagged (* above)).
 Add an interface to accept a "key" and a byte stream, rather than a
 filename.
 
-Provide a sane syntax for date ranges. First, we don't want to require
-both endpoints to be specified. For example it would be nice to be
-able to say things like "since:2009-01-1" or "until:2009-01-1" and
-have the other endpoint be implicit. Second we'd like to support
-relative specifications of time such as "since:'2 months ago'". To do
-any of this we're probably going to need to break down an write our
+Improve syntax for date ranges queries. date:expr should be
+interpreted as date:expr..expr so that, for example, "date:2013-01-22"
+would cover the whole of the specified day (currently that's not even
+recognized as a date range expression). It might be nice to be able to
+use things like "since:2013-01-22" and "until:2013-01-22" as synonyms
+to "date:2013-01-22.." and "date:..2013-01-22", respectively. To do
+any of this we're probably going to need to break down and write our
 own parser for the query string rather than using Xapian's QueryParser
 class.
 
index e1d19f20effa32b08425106fcb81ac1618db773b..d2bbc6a06d077f7f57c6bab8713fc6f30e55bf02 100755 (executable)
@@ -53,12 +53,13 @@ fi < ./version
 
 readonly VERSION
 
+# In the rest of this file, tests collect list of errors to be fixed
+
 verfail ()
 {
        echo No.
-       echo "$@"
-       echo "Please follow the instructions in RELEASING to choose a version"
-       exit 1
+       append_emsg "$@"
+       append_emsg "  Please follow the instructions in RELEASING to choose a version"
 }
 
 echo -n "Checking that '$VERSION' is good with digits and periods... "
@@ -73,8 +74,6 @@ case $VERSION in
 esac
 
 
-# In the rest of this file, tests collect list of errors to be fixed
-
 echo -n "Checking that this is Debian package for notmuch... "
 read deb_notmuch deb_version rest < debian/changelog
 if [ "$deb_notmuch" = 'notmuch' ]
index 6db62a01c46b09e7851c9259552c13d7a7574c6b..00b78e1ed265a74d52aaf78d7479934f55a65cfb 100644 (file)
@@ -504,7 +504,7 @@ Complete list of currently available key bindings:
          (notmuch-remove-if-not
           (lambda (tag)
             (not (member tag hide-tags)))
-          (process-lines notmuch-command "search-tags"))))
+          (process-lines notmuch-command "search" "--output=tags" "*"))))
 
 (defun notmuch-hello-insert-header ()
   "Insert the default notmuch-hello header."
index 778594472fb52a4925b58b6fdf9b9d6ae0317f6d..155ac02ff00e3f90bd4227edf393e90f0e887bdf 100644 (file)
@@ -73,7 +73,7 @@ libnotmuch_modules := $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
 $(dir)/libnotmuch.a: $(libnotmuch_modules)
        $(call quiet,AR) rcs $@ $^
 
-$(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym
+$(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym util/libutil.a parse-time-string/libparse-time-string.a
        $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@ util/libutil.a parse-time-string/libparse-time-string.a
 
 notmuch.sym: $(srcdir)/$(dir)/notmuch.h $(libnotmuch_modules)
index 9b25c275c3f880235beaf23c6424153e70478a3e..0805be83cbca8389256e8b9081280a8c42065da1 100644 (file)
@@ -21,7 +21,7 @@
 notmuch \- thread-based email index, search, and tagging
 .SH SYNOPSIS
 .B notmuch
-.IR command " [" args " ...]"
+.RI "[" option " ...] " command  " [" arg " ...]"
 .SH DESCRIPTION
 Notmuch is a command-line based program for indexing, searching,
 reading, and tagging large collections of email messages.
@@ -50,6 +50,26 @@ interfaces to notmuch. The emacs-based interface to notmuch (available under
 in the Notmuch source distribution) is probably the most widely used at
 this time.
 
+.SH OPTIONS
+
+Supported global options for
+.B notmuch
+include
+
+.RS 4
+.TP 4
+.B \-\-help
+
+Print a synopsis of available commands and exit.
+.RE
+
+.RS 4
+.TP 4
+.B \-\-version
+
+Print the installed version of notmuch, and exit.
+.RE
+
 .SH COMMANDS
 
 
index b54c55dd71428ebca229f6135d57a78e109f8e00..d9daf8fbe44a39f50ba2464cb6a057cfe372afc1 100644 (file)
@@ -97,7 +97,7 @@ tag_query (void *ctx, notmuch_database_t *notmuch, const char *query_string,
     notmuch_query_t *query;
     notmuch_messages_t *messages;
     notmuch_message_t *message;
-    int ret = 0;
+    int ret = NOTMUCH_STATUS_SUCCESS;
 
     /* Optimize the query so it excludes messages that already have
      * the specified set of tags. */
index 4fc0973d3715ddd6a967d0c16f8f188b7f951c51..a674481fe497059ddc43b581bc41e9165da94877 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -31,18 +31,6 @@ typedef struct command {
     const char *summary;
 } command_t;
 
-#define MAX_ALIAS_SUBSTITUTIONS 3
-
-typedef struct alias {
-    const char *name;
-    const char *substitutions[MAX_ALIAS_SUBSTITUTIONS];
-} alias_t;
-
-alias_t aliases[] = {
-    { "part", { "show", "--format=raw"}},
-    { "search-tags", {"search", "--output=tags", "*"}}
-};
-
 static int
 notmuch_help_command (void *ctx, int argc, char *argv[]);
 
@@ -260,9 +248,15 @@ main (int argc, char *argv[])
 {
     void *local;
     command_t *command;
-    alias_t *alias;
-    unsigned int i, j;
-    const char **argv_local;
+    unsigned int i;
+    notmuch_bool_t print_help=FALSE, print_version=FALSE;
+    int opt_index;
+
+    notmuch_opt_desc_t options[] = {
+       { NOTMUCH_OPT_BOOLEAN, &print_help, "help", 'h', 0 },
+       { NOTMUCH_OPT_BOOLEAN, &print_version, "version", 'v', 0 },
+       { 0, 0, 0, 0, 0 }
+    };
 
     talloc_enable_null_tracking ();
 
@@ -277,56 +271,28 @@ main (int argc, char *argv[])
     if (argc == 1)
        return notmuch (local);
 
-    if (strcmp (argv[1], "--help") == 0)
+    opt_index = parse_arguments (argc, argv, options, 1);
+    if (opt_index < 0) {
+       /* diagnostics already printed */
+       return 1;
+    }
+
+    if (print_help)
        return notmuch_help_command (NULL, argc - 1, &argv[1]);
 
-    if (strcmp (argv[1], "--version") == 0) {
+    if (print_version) {
        printf ("notmuch " STRINGIFY(NOTMUCH_VERSION) "\n");
        return 0;
     }
 
-    for (i = 0; i < ARRAY_SIZE (aliases); i++) {
-       alias = &aliases[i];
-
-       if (strcmp (argv[1], alias->name) == 0)
-       {
-           int substitutions;
-
-           argv_local = talloc_size (local, sizeof (char *) *
-                                     (argc + MAX_ALIAS_SUBSTITUTIONS - 1));
-           if (argv_local == NULL) {
-               fprintf (stderr, "Out of memory.\n");
-               return 1;
-           }
-
-           /* Copy all substution arguments from the alias. */
-           argv_local[0] = argv[0];
-           for (j = 0; j < MAX_ALIAS_SUBSTITUTIONS; j++) {
-               if (alias->substitutions[j] == NULL)
-                   break;
-               argv_local[j+1] = alias->substitutions[j];
-           }
-           substitutions = j;
-
-           /* And copy all original arguments (skipping the argument
-            * that matched the alias of course. */
-           for (j = 2; j < (unsigned) argc; j++) {
-               argv_local[substitutions+j-1] = argv[j];
-           }
-
-           argc += substitutions - 1;
-           argv = (char **) argv_local;
-       }
-    }
-
     for (i = 0; i < ARRAY_SIZE (commands); i++) {
        command = &commands[i];
 
-       if (strcmp (argv[1], command->name) == 0) {
+       if (strcmp (argv[opt_index], command->name) == 0) {
            int ret;
            char *talloc_report;
 
-           ret = (command->function)(local, argc - 1, &argv[1]);
+           ret = (command->function)(local, argc - opt_index, argv + opt_index);
 
            /* in the future support for this environment variable may
             * be supplemented or replaced by command line arguments