[PATCH v4 2/3] emacs: add notmuch-version.el.tmpl and create notmuch-version.el from it
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 8 Apr 2014 01:05:24 +0000 (01:05 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:01:23 +0000 (10:01 -0800)
b2/e023172d3fa29783f44a612e4c1b61b9d9561d [new file with mode: 0644]

diff --git a/b2/e023172d3fa29783f44a612e4c1b61b9d9561d b/b2/e023172d3fa29783f44a612e4c1b61b9d9561d
new file mode 100644 (file)
index 0000000..ceb5c8e
--- /dev/null
@@ -0,0 +1,145 @@
+Return-Path: <too@guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 15239431FBC\r
+       for <notmuch@notmuchmail.org>; Mon,  7 Apr 2014 11:05:24 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.07\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.07 tagged_above=-999 required=5\r
+       tests=[DATE_IN_PAST_96_XX=2.07] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id mJOWGUD3Osfy for <notmuch@notmuchmail.org>;\r
+       Mon,  7 Apr 2014 11:05:14 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 8254F431FB6\r
+       for <notmuch@notmuchmail.org>; Mon,  7 Apr 2014 11:05:14 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 7D6741000E3; Mon,  7 Apr 2014 21:05:07 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 2/3] emacs: add notmuch-version.el.tmpl and create\r
+       notmuch-version.el from it\r
+Message-Id: <1395261431-24668-2b-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+In-Reply-To: <1395261431-24668-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1395261431-24668-1-git-send-email-tomi.ollila@iki.fi>\r
+Cc: tomi.ollila@iki.fi\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+Date: Mon, 07 Apr 2014 18:05:24 -0000\r
+X-Original-Date: Wed, 19 Mar 2014 22:37:10 +0200\r
+X-List-Received-Date: Mon, 07 Apr 2014 18:05:24 -0000\r
+\r
+The notmuch cli program and emacs lisp versions may differ (especially\r
+in remote usage). It helps to resolve problems if we can determine\r
+the versions of notmuch cli and notmuch emacs mua separately.\r
+\r
+The build process now creates notmuch-version.el from template file\r
+by filling the version info to notmuch-emacs-version variable.\r
+---\r
+\r
+Alternative to id:1395261431-24668-2-git-send-email-tomi.ollila@iki.fi\r
+only change being in notmuch-emacs-version docstring.\r
+\r
+ emacs/.gitignore              |  1 +\r
+ emacs/Makefile.local          | 11 +++++++++--\r
+ emacs/notmuch-version.el.tmpl | 23 +++++++++++++++++++++++\r
+ emacs/notmuch.el              |  4 ++++\r
+ 4 files changed, 37 insertions(+), 2 deletions(-)\r
+ create mode 100644 emacs/notmuch-version.el.tmpl\r
+\r
+diff --git a/emacs/.gitignore b/emacs/.gitignore\r
+index 5421301..9fa1c44 100644\r
+--- a/emacs/.gitignore\r
++++ b/emacs/.gitignore\r
+@@ -1,2 +1,3 @@\r
+ .eldeps*\r
+ *.elc\r
++notmuch-version.el\r
+diff --git a/emacs/Makefile.local b/emacs/Makefile.local\r
+index 6a39b32..ca039e5 100644\r
+--- a/emacs/Makefile.local\r
++++ b/emacs/Makefile.local\r
+@@ -17,7 +17,14 @@ emacs_sources := \\r
+       $(dir)/notmuch-crypto.el \\r
+       $(dir)/notmuch-tag.el \\r
+       $(dir)/coolj.el \\r
+-      $(dir)/notmuch-print.el\r
++      $(dir)/notmuch-print.el \\r
++      $(dir)/notmuch-version.el\r
++\r
++$(dir)/notmuch-version.el: $(dir)/Makefile.local version.stamp\r
++$(dir)/notmuch-version.el: $(dir)/notmuch-version.el.tmpl\r
++      @sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \\r
++           -e 's/%VERSION%/"$(VERSION)"/' $< > $@\r
++\r
\r
+ emacs_images := \\r
+       $(srcdir)/$(dir)/notmuch-logo.png\r
+@@ -71,4 +78,4 @@ endif\r
+       mkdir -p "$(DESTDIR)$(emacsetcdir)"\r
+       install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"\r
\r
+-CLEAN := $(CLEAN) $(emacs_bytecode)\r
++CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el\r
+diff --git a/emacs/notmuch-version.el.tmpl b/emacs/notmuch-version.el.tmpl\r
+new file mode 100644\r
+index 0000000..6cf367b\r
+--- /dev/null\r
++++ b/emacs/notmuch-version.el.tmpl\r
+@@ -0,0 +1,23 @@\r
++;; -*- emacs-lisp -*-\r
++;;\r
++;; %AG%\r
++;;\r
++;; This file is part of Notmuch.\r
++;;\r
++;; Notmuch is free software: you can redistribute it and/or modify it\r
++;; under the terms of the GNU General Public License as published by\r
++;; the Free Software Foundation, either version 3 of the License, or\r
++;; (at your option) any later version.\r
++;;\r
++;; Notmuch is distributed in the hope that it will be useful, but\r
++;; WITHOUT ANY WARRANTY; without even the implied warranty of\r
++;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
++;; General Public License for more details.\r
++;;\r
++;; You should have received a copy of the GNU General Public License\r
++;; along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.\r
++\r
++(defconst notmuch-emacs-version %VERSION%\r
++  "Version of Notmuch Emacs MUA.")\r
++\r
++(provide 'notmuch-version)\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 0471750..b7dd944 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -61,6 +61,10 @@\r
+ (require 'notmuch-message)\r
+ (require 'notmuch-parser)\r
\r
++(unless (require 'notmuch-version nil t)\r
++  (defconst notmuch-emacs-version "unknown"\r
++    "Placeholder variable when notmuch-version.el[c] is not available."))\r
++\r
+ (defcustom notmuch-search-result-format\r
+   `(("date" . "%12s ")\r
+     ("count" . "%-7s ")\r
+-- \r
+1.8.0\r
+\r