[PATCH 1/2] emacs: defconst notmuch-emacs-version to a value during byte compilation

Mark Walters markwalters1009 at gmail.com
Thu Jan 23 10:12:49 PST 2014


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 <tomi.ollila at iki.fi> 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 at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list