From: Tomi Ollila Date: Wed, 19 Mar 2014 20:37:11 +0000 (+0200) Subject: [PATCH v4 3/3] emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dd048f7f491f268e3082cc25459b77b0c38845ea;p=notmuch-archives.git [PATCH v4 3/3] emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it --- diff --git a/89/be7ae85c7553bb341c97a7aa9b6b3883b2a41f b/89/be7ae85c7553bb341c97a7aa9b6b3883b2a41f new file mode 100644 index 000000000..4d0f32ef5 --- /dev/null +++ b/89/be7ae85c7553bb341c97a7aa9b6b3883b2a41f @@ -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 B98C9431FC0 + for ; Wed, 19 Mar 2014 13:37:25 -0700 (PDT) +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 f7BvZwQ0MFSG for ; + Wed, 19 Mar 2014 13:37:21 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id CCA38431FAF + for ; Wed, 19 Mar 2014 13:37:20 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 760151000E7; Wed, 19 Mar 2014 22:37:16 +0200 (EET) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH v4 3/3] emacs: defun notmuch-hello-versions and bind 'v' in + hello mode to it +Date: Wed, 19 Mar 2014 22:37:11 +0200 +Message-Id: <1395261431-24668-3-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 1.8.0 +In-Reply-To: <1395261431-24668-1-git-send-email-tomi.ollila@iki.fi> +References: <1395261431-24668-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: Wed, 19 Mar 2014 20:37:25 -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 e325cd3..e3a80f1 100644 +--- a/emacs/notmuch-hello.el ++++ b/emacs/notmuch-hello.el +@@ -515,6 +515,18 @@ (defun notmuch-hello-window-configuration-change () + (remove-hook 'window-configuration-change-hook + #'notmuch-hello-window-configuration-change)))) + ++;; the following variable is defined as being defconst in notmuch-version.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) +@@ -525,8 +537,7 @@ (defvar notmuch-hello-mode-map + ;; 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 +