From: Tomi Ollila Date: Sun, 23 Feb 2014 21:01:47 +0000 (+0200) Subject: [PATCH v3 2/3] emacs: defconst notmuch-emacs-version to a value during byte compilation X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;ds=sidebyside;h=3bee8e650ec9151c6b76ba6641b580df5f44a368;p=notmuch-archives.git [PATCH v3 2/3] emacs: defconst notmuch-emacs-version to a value during byte compilation --- diff --git a/20/a3f5595015da5b0e81f34c371ef7e57f9aafce b/20/a3f5595015da5b0e81f34c371ef7e57f9aafce new file mode 100644 index 000000000..f98fbb80b --- /dev/null +++ b/20/a3f5595015da5b0e81f34c371ef7e57f9aafce @@ -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 1A96D431FD6 + for ; Sun, 23 Feb 2014 13:02:10 -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 Ugwh1Ey-YG4r for ; + Sun, 23 Feb 2014 13:02:05 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id B09F3431FD9 + for ; Sun, 23 Feb 2014 13:02:01 -0800 (PST) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id F2B771001C7; Sun, 23 Feb 2014 23:01:56 +0200 (EET) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH v3 2/3] emacs: defconst notmuch-emacs-version to a value + during byte compilation +Date: Sun, 23 Feb 2014 23:01:47 +0200 +Message-Id: <1393189308-20241-3-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 1.8.0 +In-Reply-To: <1393189308-20241-1-git-send-email-tomi.ollila@iki.fi> +References: <1393189308-20241-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: Sun, 23 Feb 2014 21:02:10 -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 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 +