From: Tomi Ollila Date: Sun, 23 Feb 2014 21:01:48 +0000 (+0200) Subject: [PATCH v3 3/3] emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it X-Git-Url: http://git.tremily.us/?p=notmuch-archives.git;a=commitdiff_plain;h=b70f231e57c5eda43db030dc403c730c97f6b8cc [PATCH v3 3/3] emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it --- diff --git a/52/9b1687f2fffdf899f19ad6f050057bb956e705 b/52/9b1687f2fffdf899f19ad6f050057bb956e705 new file mode 100644 index 000000000..d8cabe267 --- /dev/null +++ b/52/9b1687f2fffdf899f19ad6f050057bb956e705 @@ -0,0 +1,88 @@ +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 D63F1431FCF + for ; Sun, 23 Feb 2014 13:02:14 -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 IGZw04CS-vcF for ; + Sun, 23 Feb 2014 13:02:10 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 16499429E25 + for ; Sun, 23 Feb 2014 13:02:02 -0800 (PST) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id B1EDA1001C6; Sun, 23 Feb 2014 23:01:57 +0200 (EET) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH v3 3/3] emacs: defun notmuch-hello-versions and bind 'v' in + hello mode to it +Date: Sun, 23 Feb 2014 23:01:48 +0200 +Message-Id: <1393189308-20241-4-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:15 -0000 + +If notmuch cli & notmuch emacs MUA versions differ, print also the +emacs MUA version string (along with the cli version) to the +minibuffer. +--- + emacs/notmuch-hello.el | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el +index 7b3d76b..f5e7268 100644 +--- a/emacs/notmuch-hello.el ++++ b/emacs/notmuch-hello.el +@@ -513,6 +513,18 @@ Such a list can be computed with `notmuch-hello-query-counts'." + (remove-hook 'window-configuration-change-hook + #'notmuch-hello-window-configuration-change)))) + ++;; the following variable is defined as being defconst in notmuch.el ++(defvar notmuch-emacs-version) ++ ++(defun notmuch-hello-versions () ++ "Display the notmuch version(s)" ++ (interactive) ++ (let ((notmuch-cli-version (notmuch-version))) ++ (message "notmuch version %s" ++ (if (string= notmuch-emacs-version notmuch-cli-version) ++ notmuch-cli-version ++ (concat notmuch-cli-version ++ " (emacs mua version " notmuch-emacs-version ")"))))) + + (defvar notmuch-hello-mode-map + (let ((map (if (fboundp 'make-composed-keymap) +@@ -523,8 +535,7 @@ Such a list can be computed with `notmuch-hello-query-counts'." + ;; it's unlikely to change. + (copy-keymap widget-keymap)))) + (set-keymap-parent map notmuch-common-keymap) +- (define-key map "v" (lambda () "Display the notmuch version" (interactive) +- (message "notmuch version %s" (notmuch-version)))) ++ (define-key map "v" 'notmuch-hello-versions) + (define-key map (kbd "") 'widget-backward) + map) + "Keymap for \"notmuch hello\" buffers.") +-- +1.8.0 +