From 1279853398f852fd1e9f5b1632bb406e79e7c12f Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Sat, 22 Feb 2014 01:20:36 +0200 Subject: [PATCH] [PATCH 2/3] emacs: defconst notmuch-emacs-version to a value during byte compilation --- c3/4a6e416f77fc57e6556c2c708304623a0bc72a | 99 +++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 c3/4a6e416f77fc57e6556c2c708304623a0bc72a diff --git a/c3/4a6e416f77fc57e6556c2c708304623a0bc72a b/c3/4a6e416f77fc57e6556c2c708304623a0bc72a new file mode 100644 index 000000000..05449c0db --- /dev/null +++ b/c3/4a6e416f77fc57e6556c2c708304623a0bc72a @@ -0,0 +1,99 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1205D431FC0 + for ; Fri, 21 Feb 2014 15:20:50 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id WJPLVM8kKjh6 for ; + Fri, 21 Feb 2014 15:20:46 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 9B6E8431FBC + for ; Fri, 21 Feb 2014 15:20:46 -0800 (PST) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 975381000CA; Sat, 22 Feb 2014 01:20:39 +0200 (EET) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH 2/3] emacs: defconst notmuch-emacs-version to a value during + byte compilation +Date: Sat, 22 Feb 2014 01:20:36 +0200 +Message-Id: <1393024837-30394-2-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 1.8.0 +In-Reply-To: <1393024837-30394-1-git-send-email-tomi.ollila@iki.fi> +References: <1393024837-30394-1-git-send-email-tomi.ollila@iki.fi> +Cc: tomi.ollila@iki.fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 21 Feb 2014 23:20:50 -0000 + +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 42bfbd9..e78699e 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 +@@ -40,7 +42,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.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 + -- 2.26.2