unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] emacs: defconst notmuch-emacs-version to a value during byte compilation
@ 2014-01-19 12:51 Tomi Ollila
  2014-01-19 12:51 ` [PATCH 2/2] emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it Tomi Ollila
  2014-01-23 18:12 ` [PATCH 1/2] emacs: defconst notmuch-emacs-version to a value during byte compilation Mark Walters
  0 siblings, 2 replies; 4+ messages in thread
From: Tomi Ollila @ 2014-01-19 12:51 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

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 | 4 +++-
 emacs/notmuch-lib.el | 7 +++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 42bfbd9..1b2db7e 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -40,7 +40,9 @@ CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp
 
 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-lib.el b/emacs/notmuch-lib.el
index 2be409b..81eed54 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -168,6 +168,13 @@ Otherwise the output will be returned"
       (notmuch-check-exit-status status (cons notmuch-command args) output)
       output)))
 
+;; defconst notmuch-emacs-version to a value during build-time byte compilation
+(defconst notmuch-emacs-version
+  (eval-when-compile (if (boundp 'notmuch--version)
+			 notmuch--version
+		       "not-compiled"))
+  "Version string of this version of Notmuch Emacs MUA.")
+
 (defun notmuch-version ()
   "Return a string with the notmuch version number."
   (let ((long-string
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-23 23:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-19 12:51 [PATCH 1/2] emacs: defconst notmuch-emacs-version to a value during byte compilation Tomi Ollila
2014-01-19 12:51 ` [PATCH 2/2] emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it Tomi Ollila
2014-01-23 18:12 ` [PATCH 1/2] emacs: defconst notmuch-emacs-version to a value during byte compilation Mark Walters
2014-01-23 23:45   ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).