1 Return-Path: <tomi.ollila@iki.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id C82F9431FBD
\r
6 for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 11:54:39 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id ewJeUWvziG9r for <notmuch@notmuchmail.org>;
\r
16 Sun, 26 Jan 2014 11:54:33 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 865AE431FBC
\r
19 for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 11:54:33 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id E1CAF100051;
\r
22 Sun, 26 Jan 2014 21:54:24 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH] emacs: add a function to heuristically test if the CLI is
\r
27 In-Reply-To: <1390763615-24477-1-git-send-email-david@tethera.net>
\r
28 References: <1390762444-18793-1-git-send-email-david@tethera.net>
\r
29 <1390763615-24477-1-git-send-email-david@tethera.net>
\r
30 User-Agent: Notmuch/0.17+55~g4397960 (http://notmuchmail.org) Emacs/24.3.1
\r
31 (x86_64-unknown-linux-gnu)
\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
33 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
34 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
35 Date: Sun, 26 Jan 2014 21:54:24 +0200
\r
36 Message-ID: <m28uu25xjj.fsf@guru.guru-group.fi>
\r
38 Content-Type: text/plain
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Sun, 26 Jan 2014 19:54:39 -0000
\r
53 On Sun, Jan 26 2014, David Bremner <david@tethera.net> wrote:
\r
55 > We cache the result so that we can call the function many places
\r
56 > without worrying about the cost.
\r
58 > thanks to Tomi for catching the typos (uncommitted changes on my end).
\r
65 > emacs/notmuch-lib.el | 11 +++++++++++
\r
66 > 1 file changed, 11 insertions(+)
\r
68 > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
\r
69 > index 2be409b..140d760 100644
\r
70 > --- a/emacs/notmuch-lib.el
\r
71 > +++ b/emacs/notmuch-lib.el
\r
72 > @@ -168,6 +168,17 @@ Otherwise the output will be returned"
\r
73 > (notmuch-check-exit-status status (cons notmuch-command args) output)
\r
76 > +(defvar notmuch--cli-sane-p nil
\r
77 > + "Cache whether the CLI seems to be configured sanely.")
\r
79 > +(defun notmuch-cli-sane-p ()
\r
80 > + "Return t if the cli seems to be configured sanely."
\r
81 > + (unless notmuch--cli-sane-p
\r
82 > + (let ((status (call-process notmuch-command nil nil nil
\r
83 > + "config" "get" "user.primary_email")))
\r
84 > + (setq notmuch--cli-sane-p (= status 0))))
\r
85 > + notmuch--cli-sane-p)
\r
87 > (defun notmuch-version ()
\r
88 > "Return a string with the notmuch version number."
\r
89 > (let ((long-string
\r
93 > _______________________________________________
\r
94 > notmuch mailing list
\r
95 > notmuch@notmuchmail.org
\r
96 > http://notmuchmail.org/mailman/listinfo/notmuch
\r