1 Return-Path: <too@guru-group.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 arlo.cworth.org (Postfix) with ESMTP id 22FD26DE1413
\r
6 for <notmuch@notmuchmail.org>; Sun, 2 Aug 2015 07:48:49 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.307 tagged_above=-999 required=5 tests=[AWL=0.847,
\r
12 RP_MATCHES_RCVD=-0.55, T_HEADER_FROM_DIFFERENT_DOMAINS=0.01]
\r
14 Received: from arlo.cworth.org ([127.0.0.1])
\r
15 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id gqeejnsDkrxa for <notmuch@notmuchmail.org>;
\r
17 Sun, 2 Aug 2015 07:48:45 -0700 (PDT)
\r
18 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
19 by arlo.cworth.org (Postfix) with ESMTP id BCB046DE1410
\r
20 for <notmuch@notmuchmail.org>; Sun, 2 Aug 2015 07:48:44 -0700 (PDT)
\r
21 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
22 id B8C881000B3; Sun, 2 Aug 2015 17:48:26 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: notmuch@notmuchmail.org,
\r
25 markwalters1009@gmail.com,
\r
27 Subject: [PATCH 2/2] emacs: prefer notmuch-emacs-version in User-Agent: header
\r
28 Date: Sun, 2 Aug 2015 17:48:14 +0300
\r
29 Message-Id: <1438526894-19657-2-git-send-email-tomi.ollila@iki.fi>
\r
30 X-Mailer: git-send-email 2.0.0
\r
31 In-Reply-To: <1438526894-19657-1-git-send-email-tomi.ollila@iki.fi>
\r
32 References: <1438526894-19657-1-git-send-email-tomi.ollila@iki.fi>
\r
33 Cc: tomi.ollila@iki.fi
\r
34 X-BeenThere: notmuch@notmuchmail.org
\r
35 X-Mailman-Version: 2.1.18
\r
37 List-Id: "Use and development of the notmuch mail system."
\r
38 <notmuch.notmuchmail.org>
\r
39 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
40 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
42 List-Post: <mailto:notmuch@notmuchmail.org>
\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
44 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
46 X-List-Received-Date: Sun, 02 Aug 2015 14:48:49 -0000
\r
48 Now that we have `notmuch-emacs-version' defined in notmuch emacs MUA
\r
49 use that as a part of User-Agent: header to provide more accurate
\r
50 version information when sending emails.
\r
52 In case some incomplete installation of notmuch emacs MUA is used and
\r
53 `notmuch-emacs-version' is defined as "unknown" then fall back to ask
\r
54 version info from cli (as it used to be before this commit).
\r
56 Requiring notmuch-version[.elc] and if that is missing setting
\r
57 "fallback" notmuch-emacs-version (to "unknown") was moved from
\r
58 notmuch.el to notmuch-lib.el as notmuch-mua.el (which provides
\r
59 User-Agent: information) require's the latter.
\r
62 Note that I did not create notmuch-guess-emacs-version (or something)
\r
63 function. The idea is good but there is one HARD problem: naming it.
\r
64 Also, I personally suspect that no-one is going to need that function in
\r
67 emacs/notmuch-lib.el | 4 ++++
\r
68 emacs/notmuch-mua.el | 5 ++++-
\r
69 emacs/notmuch.el | 4 ----
\r
70 3 files changed, 8 insertions(+), 5 deletions(-)
\r
72 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
\r
73 index e16a1b9..201d7ec 100644
\r
74 --- a/emacs/notmuch-lib.el
\r
75 +++ b/emacs/notmuch-lib.el
\r
77 (require 'mm-decode)
\r
80 +(unless (require 'notmuch-version nil t)
\r
81 + (defconst notmuch-emacs-version "unknown"
\r
82 + "Placeholder variable when notmuch-version.el[c] is not available."))
\r
84 (autoload 'notmuch-jump-search "notmuch-jump"
\r
85 "Jump to a saved search by shortcut key." t)
\r
87 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
\r
88 index 934f6c9..3e52d5e 100644
\r
89 --- a/emacs/notmuch-mua.el
\r
90 +++ b/emacs/notmuch-mua.el
\r
91 @@ -118,7 +118,10 @@ (defun notmuch-mua-user-agent-full ()
\r
93 (defun notmuch-mua-user-agent-notmuch ()
\r
94 "Generate a `User-Agent:' string suitable for notmuch."
\r
95 - (concat "Notmuch/" (notmuch-cli-version) " (http://notmuchmail.org)"))
\r
96 + (let ((notmuch-version (if (string= notmuch-emacs-version "unknown")
\r
97 + (notmuch-cli-version)
\r
98 + notmuch-emacs-version)))
\r
99 + (concat "Notmuch/" notmuch-version " (http://notmuchmail.org)")))
\r
101 (defun notmuch-mua-user-agent-emacs ()
\r
102 "Generate a `User-Agent:' string suitable for notmuch."
\r
103 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
104 index 6564816..5284e77 100644
\r
105 --- a/emacs/notmuch.el
\r
106 +++ b/emacs/notmuch.el
\r
108 (require 'notmuch-message)
\r
109 (require 'notmuch-parser)
\r
111 -(unless (require 'notmuch-version nil t)
\r
112 - (defconst notmuch-emacs-version "unknown"
\r
113 - "Placeholder variable when notmuch-version.el[c] is not available."))
\r
115 (defcustom notmuch-search-result-format
\r
116 `(("date" . "%12s ")
\r
117 ("count" . "%-7s ")
\r