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 B1DCD431FC0 for ; Sun, 19 Jan 2014 04:52:03 -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 c-q6E-hTQnGe for ; Sun, 19 Jan 2014 04:51:57 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 6269B431FC2 for ; Sun, 19 Jan 2014 04:51:57 -0800 (PST) Received: by guru.guru-group.fi (Postfix, from userid 501) id AABD71000C1; Sun, 19 Jan 2014 14:51:49 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH 2/2] emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it Date: Sun, 19 Jan 2014 14:51:43 +0200 Message-Id: <1390135903-28167-2-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1390135903-28167-1-git-send-email-tomi.ollila@iki.fi> References: <1390135903-28167-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, 19 Jan 2014 12:52:03 -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 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 55c416a..299e35f 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -513,6 +513,15 @@ Such a list can be computed with `notmuch-hello-query-counts'." (remove-hook 'window-configuration-change-hook #'notmuch-hello-window-configuration-change)))) +(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 +532,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.4.2