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 EFA22431FC9 for ; Fri, 14 Dec 2012 21:15:57 -0800 (PST) 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 HSIMEeuTUFfF for ; Fri, 14 Dec 2012 21:15:56 -0800 (PST) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id AC912429E3D for ; Fri, 14 Dec 2012 21:15:37 -0800 (PST) X-AuditID: 1209190c-b7f886d000000936-8c-50cc0779934b Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 93.02.02358.9770CC05; Sat, 15 Dec 2012 00:15:37 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id qBF5FQdH020493; Sat, 15 Dec 2012 00:15:26 -0500 Received: from drake.dyndns.org (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qBF5FOPB011444 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 15 Dec 2012 00:15:25 -0500 (EST) Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1Tjk5s-0002kL-58; Sat, 15 Dec 2012 00:15:24 -0500 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 2/7] emacs: Use unified error handling in notmuch-call-notmuch-process Date: Sat, 15 Dec 2012 00:15:08 -0500 Message-Id: <1355548513-10085-3-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1355548513-10085-1-git-send-email-amdragon@mit.edu> References: <1355548513-10085-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6nrlvJfibAoPmfkMXquTwW12/OZHZg 8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Mq6fWMZYsIyr4tf6KUwNjOs5uhg5OSQETCRW t6xlhbDFJC7cW8/WxcjFISSwj1HiwJqjUM4GRokthy9DOY+YJP7c/coO4cxllDi56itYP5uA hsS2/csZQWwRAWmJnXdng8WZBRwlPu9fxAZiCwuESdx69IcZxGYRUJV4/rkLLM4r4CAx5/k+ qDsUJbqfTQCLcwL1Lvt4jgXEFgKqOfvqLusERv4FjAyrGGVTcqt0cxMzc4pTk3WLkxPz8lKL dA31cjNL9FJTSjcxgkKJU5JnB+Obg0qHGAU4GJV4eHdEnA4QYk0sK67MPcQoycGkJMp7i+FM gBBfUn5KZUZicUZ8UWlOavEhRgkOZiURXrEtQOW8KYmVValF+TApaQ4WJXHeyyk3/YUE0hNL UrNTUwtSi2CyMhwcShK8P9iAhgoWpaanVqRl5pQgpJk4OEGG8wANB6vhLS5IzC3OTIfIn2JU lBLnvQqSEABJZJTmwfXCYv0VozjQK8K80SBVPMA0Adf9CmgwE9DguEvHQQaXJCKkpBoY9S5I NWwof/r5w9Ud8lo/X4c9exvk7bb9e5fnf44jDNGhK49XL/e1/nAhuGWl/jnWnb9OTrnhOjfv WITpu7wfxVvepDwX/qFstUHvVf8mfqmX/5cxqJ+JPHsrcP36tMeRet4tXYuyD61YlffR7/L8 G9Er7nZcXZQnmcT74+dpjuU5Ykdt/jz52qfEUpyRaKjFXFScCABdaiRT0AIAAA== 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: Sat, 15 Dec 2012 05:15:58 -0000 This makes notmuch-call-notmuch-process use the unified CLI error handling, which basically refines the error handling this function already did. --- emacs/notmuch.el | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index f9454d8..e25b54e 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -538,17 +538,10 @@ If BARE is set then do not prefix with \"thread:\"" Output from the process will be presented to the user as an error and will also appear in a buffer named \"*Notmuch errors*\"." - (let ((error-buffer (get-buffer-create "*Notmuch errors*"))) - (with-current-buffer error-buffer - (erase-buffer)) - (if (eq (apply 'call-process notmuch-command nil error-buffer nil args) 0) - (point) - (progn - (with-current-buffer error-buffer - (let ((beg (point-min)) - (end (- (point-max) 1))) - (error (buffer-substring beg end)) - )))))) + (with-temp-buffer + (let ((status (apply #'call-process notmuch-command nil t nil args))) + (notmuch-check-exit-status status (cons notmuch-command args) + (buffer-string))))) (defun notmuch-search-set-tags (tags &optional pos) (let ((new-result (plist-put (notmuch-search-get-result pos) :tags tags))) -- 1.7.10.4