[PATCH v3 2/3] emacs: defconst notmuch-emacs-version to a value during byte compilation
Tomi Ollila
tomi.ollila at iki.fi
Sun Feb 23 13:01:47 PST 2014
The notmuch cli program and emacs lisp versions may differ. For now
we can help users with their emacs client problems better if we can
ask what version of emacs MUA they are running. In the future we can
put the emacs MUA version to User-Agent: string in outgoing mail.
---
emacs/Makefile.local | 6 +++++-
emacs/notmuch.el | 7 +++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 6a39b32..9e3fb7a 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -24,6 +24,8 @@ emacs_images := \
emacs_bytecode = $(emacs_sources:.el=.elc)
+$(dir)/notmuch.elc: version.stamp
+
# Because of defmacro's and defsubst's, we have to account for load
# dependencies between Elisp files when byte compiling. Otherwise,
# the byte compiler may load an old .elc file when processing a
@@ -49,7 +51,9 @@ CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x
ifeq ($(HAVE_EMACS),1)
%.elc: %.el $(global_deps)
- $(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
+ $(call quiet,EMACS) --directory emacs \
+ --eval "(setq notmuch--version \"$(VERSION)\")" \
+ -batch -f batch-byte-compile $<
endif
ifeq ($(WITH_EMACS),1)
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 0471750..1b15054 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -81,6 +81,13 @@ To enter a line break in customize, press \\[quoted-insert] C-j."
:type '(alist :key-type (string) :value-type (string))
:group 'notmuch-search)
+;; defconst notmuch-version to a value during build-time byte compilation...
+(defconst notmuch-emacs-version
+ (eval-when-compile (if (boundp 'notmuch--version)
+ notmuch--version
+ "unknown"))
+ "Version string of this version of Notmuch Emacs MUA.")
+
(defvar notmuch-query-history nil
"Variable to store minibuffer history for notmuch queries")
--
1.8.0
More information about the notmuch
mailing list