From: Mark Walters <markwalters1009@gmail.com>
To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: Re: [DRAFT PATCH] emacs: notmuch-version and version comparison with CLI
Date: Sun, 21 Jul 2013 09:28:24 +0100 [thread overview]
Message-ID: <87li508ggn.fsf@qmul.ac.uk> (raw)
In-Reply-To: <1374090782-10273-1-git-send-email-tomi.ollila@iki.fi>
Hi
I think I would prefer some more specific versioning so that we don't
have the warning unless we think we might need it. I often run notmuch
over ssh and the two sides are often minorly out of sync so I think I
would find a warning each time irritating.
Maybe basing the message on "version + commits since last release" with
emacs knowing some minimum acceptable version?
Best wishes
Mark
Tomi Ollila <tomi.ollila@iki.fi> writes:
> ---
>
> This is continuation of id:m2y59ag9yj.fsf@guru.guru-group.fi
>
> This is draft of code which could be used to do exact version comparison
> between notmuch cli and notmuch Emacs MUA.
>
> In case the versions aren't exactly same a warning message is shown
> to the user before notmuch-hello window is filled the first time.
>
> If this approach gets support I'll write more prepared patches
> (in addition to make fully working patch...).
>
> Tomi
>
> emacs/Makefile.local | 4 +++-
> emacs/notmuch-hello.el | 26 +++++++++++++++++++++++++-
> 2 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/emacs/Makefile.local b/emacs/Makefile.local
> index a910aff..fd45d4a 100644
> --- a/emacs/Makefile.local
> +++ b/emacs/Makefile.local
> @@ -36,7 +36,9 @@ $(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources)
> CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp
>
> %.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 $<
>
> ifeq ($(WITH_EMACS),1)
> ifeq ($(HAVE_EMACS),1)
> diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
> index 147c08c..d97aee3 100644
> --- a/emacs/notmuch-hello.el
> +++ b/emacs/notmuch-hello.el
> @@ -29,6 +29,18 @@
> (declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line continuation))
> (declare-function notmuch-poll "notmuch" ())
>
> +;; defconst notmuch-version to a value during build-time byte compilation...
> +;; the compiled output will only contain the defconst definition
> +(eval-when-compile
> + (defmacro expand-defconst-notmuch-version ()
> + `(if ,(boundp 'notmuch--version)
> + (defconst notmuch-version ,notmuch--version
> + "Version string for this version of Notmuch.")
> + (defconst notmuch-version "unknown"
> + "Placeholder for Notmuch version string. Set during build process.")))
> +)
> +(expand-defconst-notmuch-version)
> +
> (defcustom notmuch-hello-recent-searches-max 10
> "The number of recent searches to display."
> :type 'integer
> @@ -762,7 +774,19 @@ following:
>
> (if no-display
> (set-buffer "*notmuch-hello*")
> - (switch-to-buffer "*notmuch-hello*"))
> + (switch-to-buffer "*notmuch-hello*")
> + (if notmuch-hello-first-run
> + (let ((v (replace-regexp-in-string "^notmuch " ""
> + (car (process-lines notmuch-command
> + "--version")))))
> + (unless (string= v notmuch-version)
> + (save-excursion
> + (erase-buffer)
> + (insert "
> +Notmuch CLI version: " v "
> +Notmuch Emacs version: " notmuch-version "
> +
> +XXX") (y-or-n-p "Press y or n to continue"))))))
>
> (let ((target-line (line-number-at-pos))
> (target-column (current-column))
> --
> 1.8.1.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
next prev parent reply other threads:[~2013-07-21 8:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-17 19:53 [DRAFT PATCH] emacs: notmuch-version and version comparison with CLI Tomi Ollila
2013-07-21 8:28 ` Mark Walters [this message]
2013-07-21 8:49 ` Tomi Ollila
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87li508ggn.fsf@qmul.ac.uk \
--to=markwalters1009@gmail.com \
--cc=notmuch@notmuchmail.org \
--cc=tomi.ollila@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).