From a6abcfbeb4c14ded6c12399acee9990b9bd59aba Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 24 Jun 2013 19:43:18 +2000 Subject: [PATCH] [PATCH 2/3] emacs: Use S-exp format everywhere --- b8/4570b7e58ceefa2440604bdf89a9b5e92c1ae1 | 137 ++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 b8/4570b7e58ceefa2440604bdf89a9b5e92c1ae1 diff --git a/b8/4570b7e58ceefa2440604bdf89a9b5e92c1ae1 b/b8/4570b7e58ceefa2440604bdf89a9b5e92c1ae1 new file mode 100644 index 000000000..f036455d0 --- /dev/null +++ b/b8/4570b7e58ceefa2440604bdf89a9b5e92c1ae1 @@ -0,0 +1,137 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 0BF4F431FBD + for ; Sun, 23 Jun 2013 16:43:37 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id Sbk0dXkjp6CL for ; + Sun, 23 Jun 2013 16:43:29 -0700 (PDT) +Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu + [18.9.25.13]) + by olra.theworths.org (Postfix) with ESMTP id DC8DF431FB6 + for ; Sun, 23 Jun 2013 16:43:28 -0700 (PDT) +X-AuditID: 1209190d-b7f078e000000937-9c-51c78820db61 +Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) + by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP + id 32.DD.02359.02887C15; Sun, 23 Jun 2013 19:43:28 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id r5NNhP6J025545; + Sun, 23 Jun 2013 19:43:26 -0400 +Received: from drake.dyndns.org + (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [216.15.114.40]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r5NNhNWN023368 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Sun, 23 Jun 2013 19:43:25 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1UqtwJ-0000L4-Ul; Sun, 23 Jun 2013 19:43:23 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH 2/3] emacs: Use S-exp format everywhere +Date: Sun, 23 Jun 2013 19:43:18 -0400 +Message-Id: <1372030999-1262-2-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1372030999-1262-1-git-send-email-amdragon@mit.edu> +References: <1372030999-1262-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsUixCmqrKvQcTzQ4MhnaYvrN2cyOzB6PFt1 + izmAMYrLJiU1J7MstUjfLoErY/ehVpaC18IVf7ZOZW1gXCTQxcjJISFgIvH3xQtGCFtM4sK9 + 9WxdjFwcQgL7GCUab6xkgXA2Mkp82/wWyrnDJLG+4RgjhDOXUeL9lmOsIP1sAhoS2/YvB5sl + IiAtsfPubKA4BwezgJrEny4VkLCwgLlE9/oDzCA2i4CqxKm+NWDlvAL2ElvProE6Q1Gi+9kE + NhCbU8BB4v+PiewgY4SAauauSJrAyL+AkWEVo2xKbpVubmJmTnFqsm5xcmJeXmqRrpFebmaJ + XmpK6SZGcNBI8u5gfHdQ6RCjAAejEg/vD8vjgUKsiWXFlbmHGCU5mJREec+3AIX4kvJTKjMS + izPii0pzUosPMUpwMCuJ8PZaAeV4UxIrq1KL8mFS0hwsSuK8ord2BgoJpCeWpGanphakFsFk + ZTg4lCR4P7cBNQoWpaanVqRl5pQgpJk4OEGG8wANZ24HGV5ckJhbnJkOkT/FqCglzvsTpFkA + JJFRmgfXC4vqV4ziQK8I814EqeIBJgS47ldAg5mABk9OBRtckoiQkmpgtGQMeSz7c5Z6zE3z + M2yVfLPUCmbc6M956j+1jpF11vz4osKLEx8U8qr1B3zbtGCTUcnSsDf/jBSZN3Fxr58SrcVb + 4ln5weui1evcA057MmclOy/iEzzjXOzD6Lr2hVdMxLrc96ozc58vdHsxn/luxo25c3cfXsuy + 2iZEmjfptl2D6UuVJya/lFiKMxINtZiLihMBJIbCZsUCAAA= +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 23 Jun 2013 23:43:37 -0000 + +This switches `notmuch-mua-reply' and `notmuch-query-get-threads' to +the S-exp format. These were the last two uses of the JSON format in +the Emacs frontend. +--- + emacs/notmuch-mua.el | 4 ++-- + emacs/notmuch-query.el | 4 ++-- + test/emacs-show | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +index 24eebff..329d342 100644 +--- a/emacs/notmuch-mua.el ++++ b/emacs/notmuch-mua.el +@@ -146,7 +146,7 @@ list." + (unless (bolp) (insert "\n"))) + + (defun notmuch-mua-reply (query-string &optional sender reply-all) +- (let ((args '("reply" "--format=json" "--format-version=1")) ++ (let ((args '("reply" "--format=sexp" "--format-version=1")) + reply + original) + (when notmuch-show-process-crypto +@@ -158,7 +158,7 @@ list." + (setq args (append args (list query-string))) + + ;; Get the reply object as JSON, and parse it into an elisp object. +- (setq reply (apply #'notmuch-call-notmuch-json args)) ++ (setq reply (apply #'notmuch-call-notmuch-sexp args)) + + ;; Extract the original message to simplify the following code. + (setq original (plist-get reply :original)) +diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el +index 6e9f406..51d427f 100644 +--- a/emacs/notmuch-query.el ++++ b/emacs/notmuch-query.el +@@ -29,11 +29,11 @@ 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=json" "--format-version=1"))) ++ (let ((args '("show" "--format=sexp" "--format-version=1"))) + (if notmuch-show-process-crypto + (setq args (append args '("--decrypt")))) + (setq args (append args search-terms)) +- (apply #'notmuch-call-notmuch-json args))) ++ (apply #'notmuch-call-notmuch-sexp args))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Mapping functions across collections of messages. +diff --git a/test/emacs-show b/test/emacs-show +index 9f2ccb0..ae70053 100755 +--- a/test/emacs-show ++++ b/test/emacs-show +@@ -189,7 +189,7 @@ This is an error (see *Notmuch errors* for more details) + --- + [XXX] + This is an error +-command: $PWD/notmuch_fail show --format\\=json --format-version\\=1 --exclude\\=false \\' \\* \\' ++command: $PWD/notmuch_fail show --format\\=sexp --format-version\\=1 --exclude\\=false \\' \\* \\' + exit status: 1 + stderr: + This is an error +-- +1.7.10.4 + -- 2.26.2