]> git.notmuchmail.org Git - notmuch/commitdiff
CLI: define and use format version 5
authorDavid Bremner <david@tethera.net>
Sun, 22 Aug 2021 00:00:11 +0000 (17:00 -0700)
committerDavid Bremner <david@tethera.net>
Sun, 22 Aug 2021 14:05:13 +0000 (07:05 -0700)
This is a bit of a cheat, since the format does not actually
change. On the other hand it is fairly common to do something like
this to shared libary SONAMEs when the ABI changes in some subtle way.
It does rely on the format-version argument being early enough on the
command line to generate a sensible error message.

devel/schemata
emacs/notmuch-address.el
emacs/notmuch-mua.el
emacs/notmuch-query.el
emacs/notmuch-tree.el
emacs/notmuch.el
notmuch-client.h
test/T310-emacs.sh
test/T450-emacs-show.sh

index ae84a5285e6e23f978b15840b526232b40edae7c..01e3a3df03305244b1c206040c5d9c85ef3b8ac1 100644 (file)
@@ -14,7 +14,7 @@ are interleaved. Keys are printed as keywords (symbols preceded by a
 colon), e.g. (:id "123" :time 54321 :from "foobar"). Null is printed as
 nil, true as t and false as nil.
 
-This is version 4 of the structured output format.
+This is version 5 of the structured output format.
 
 Version history
 ---------------
@@ -36,6 +36,10 @@ v4
 - (notmuch 0.29) added message.crypto to identify overall message
   cryptographic state
 
+v5
+- sorting support for notmuch show (no change to actual schema,
+  just new command line argument)
+
 Common non-terminals
 --------------------
 
index f0af666754b798ac0f83b90db079f8aecd94422a..9fc13bc5e44fe133c0b94da54e0eebc524820f91 100644 (file)
@@ -308,7 +308,7 @@ execution, CALLBACK is called when harvesting finishes."
                            (and config-query
                                 (format " and (%s)" config-query)))
                  from-or-to-me-query))
-        (args `("address" "--format=sexp" "--format-version=4"
+        (args `("address" "--format=sexp" "--format-version=5"
                 ,(if sent "--output=recipients" "--output=sender")
                 "--deduplicate=address"
                 ,query)))
index 17954fb3771555ff0e4c44e0d827d932a1a08a8b..f510c043fc4c9515dbe7910e3c1bc6b4c214b1f5 100644 (file)
@@ -235,7 +235,7 @@ Typically this is added to `notmuch-mua-send-hook'."
 ;;; Mua reply
 
 (defun notmuch-mua-reply (query-string &optional sender reply-all)
-  (let ((args '("reply" "--format=sexp" "--format-version=4"))
+  (let ((args '("reply" "--format=sexp" "--format-version=5"))
        (process-crypto notmuch-show-process-crypto)
        reply
        original)
index d7349b771e4ff4efde18249d54a32a8dc2adde45..5c7f4f8d8918504a70e23c436c6f644c44f1f2ce 100644 (file)
@@ -31,7 +31,7 @@
 A thread is a forest or list of trees. A tree is a two element
 list where the first element is a message, and the second element
 is a possibly empty forest of replies."
-  (let ((args '("show" "--format=sexp" "--format-version=4")))
+  (let ((args '("show" "--format=sexp" "--format-version=5")))
     (when notmuch-show-process-crypto
       (setq args (append args '("--decrypt=true"))))
     (setq args (append args search-terms))
index 01a77b716f3fa12c14317cc9dc790cd7301a6df7..2f508128cc78f2cbab0f146e4acb6c33fe2336e2 100644 (file)
@@ -1103,7 +1103,7 @@ the same as for the function notmuch-tree."
     (notmuch-tag-clear-cache)
     (let ((proc (notmuch-start-notmuch
                 "notmuch-tree" (current-buffer) #'notmuch-tree-process-sentinel
-                "show" "--body=false" "--format=sexp" "--format-version=4"
+                "show" "--body=false" "--format=sexp" "--format-version=5"
                 sort-arg message-arg search-args))
          ;; Use a scratch buffer to accumulate partial output.
          ;; This buffer will be killed by the sentinel, which
index 351334aa00a34b198a89fd7ea065438a740c7a22..739cb93bafe47db0df98bbea3299f05f2ec989c0 100644 (file)
@@ -1020,7 +1020,7 @@ the configured default sort order."
       (save-excursion
        (let ((proc (notmuch-start-notmuch
                     "notmuch-search" buffer #'notmuch-search-process-sentinel
-                    "search" "--format=sexp" "--format-version=4"
+                    "search" "--format=sexp" "--format-version=5"
                     (if oldest-first
                         "--sort=oldest-first"
                       "--sort=newest-first")
index 8227fea479d4e234da32c4e2f9d26dfd4f60cf41..8643a63f0a57df633767c099a730d0dbb188495f 100644 (file)
@@ -137,7 +137,7 @@ chomp_newline (char *str)
  * this.  New (required) map fields can be added without increasing
  * this.
  */
-#define NOTMUCH_FORMAT_CUR 4
+#define NOTMUCH_FORMAT_CUR 5
 /* The minimum supported structured output format version.  Requests
  * for format versions below this will return an error. */
 #define NOTMUCH_FORMAT_MIN 1
index 7b70175bcb94082ddcaa7194daf120af0b56d0e8..d69d94a399a1d39fc753677d0b73f21c073439fb 100755 (executable)
@@ -1060,7 +1060,7 @@ End of search results.
 YYY/notmuch_fail exited with status 1 (see *Notmuch errors* for more details)
 === ERROR ===
 YYY/notmuch_fail exited with status 1
-command: YYY/notmuch_fail search --format\=sexp --format-version\=4 --sort\=newest-first tag\:inbox
+command: YYY/notmuch_fail search --format\=sexp --format-version\=5 --sort\=newest-first tag\:inbox
 exit status: 1"
 
 test_begin_subtest "Search handles subprocess warnings"
index 9d08d2ccf933bc99f08c358143563e0783607db4..a750cc4dd6984173a25e3e7351e3d45ae733ee24 100755 (executable)
@@ -192,7 +192,7 @@ test_expect_equal "$(notmuch_emacs_error_sanitize notmuch_fail OUTPUT MESSAGES E
 This is an error (see *Notmuch errors* for more details)
 === ERROR ===
 This is an error
-command: YYY/notmuch_fail show --format\\=sexp --format-version\\=4 --decrypt\\=true --exclude\\=false \\' \\* \\'
+command: YYY/notmuch_fail show --format\\=sexp --format-version\\=5 --decrypt\\=true --exclude\\=false \\' \\* \\'
 exit status: 1
 stderr:
 This is an error