From 6a743b34e95646ad2925e8a0a713f776fc4c214a Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Thu, 23 Jan 2014 18:12:49 +0000 Subject: [PATCH] Re: [PATCH 1/2] emacs: defconst notmuch-emacs-version to a value during byte compilation --- 57/528823b7bca6cf9fa9074612ddb2202b8a84e9 | 142 ++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 57/528823b7bca6cf9fa9074612ddb2202b8a84e9 diff --git a/57/528823b7bca6cf9fa9074612ddb2202b8a84e9 b/57/528823b7bca6cf9fa9074612ddb2202b8a84e9 new file mode 100644 index 000000000..2a27cca2e --- /dev/null +++ b/57/528823b7bca6cf9fa9074612ddb2202b8a84e9 @@ -0,0 +1,142 @@ +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 D893C431FB6 + for ; Thu, 23 Jan 2014 10:15:59 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 Mkl3i3E8vpRw for ; + Thu, 23 Jan 2014 10:15:53 -0800 (PST) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 7CE89431FAF + for ; Thu, 23 Jan 2014 10:15:53 -0800 (PST) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1W6OoZ-00067U-CG; Thu, 23 Jan 2014 18:15:48 +0000 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1W6OnO-0008LB-Ph; Thu, 23 Jan 2014 18:14:33 +0000 +From: Mark Walters +To: Tomi Ollila , notmuch@notmuchmail.org +Subject: Re: [PATCH 1/2] emacs: defconst notmuch-emacs-version to a value + during byte compilation +In-Reply-To: <1390135903-28167-1-git-send-email-tomi.ollila@iki.fi> +References: <1390135903-28167-1-git-send-email-tomi.ollila@iki.fi> +User-Agent: Notmuch/0.15.2+484~gfb59956 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Thu, 23 Jan 2014 18:12:49 +0000 +Message-ID: <8738kezhwe.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-Geographic: According to ripencc, + this message was delivered by a machine in Britain (UK) (GB). +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: cb9a0b326e2b7d3a3b02a7a069e9b3e5 (of first 20000 bytes) +X-SpamAssassin-Score: 0.0 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored 0.0 points. Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.0 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Thu, 23 Jan 2014 18:16:00 -0000 + + +Hi + +I like this. However, something odd seems to happen with version. + +If I make and then commit a small change to emacs/notmuch-tree.el and then +remake then version string in the cli nor in emacs seems to be +updated. If I make clean and then make it is updated. + +OTOH if i make then commit a small change to notmuch.c then make again +then the cli seems to get a new version but emacs doesn't. + +I think that this problem (if it's not just stupidity on my part) is +orthogonal to this patch but thought it worth mentioning. + +Best wishes + +Mark + + +On Sun, 19 Jan 2014, Tomi Ollila wrote: +> 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 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2