From 0e13e664de364d81ce6ba9b8215f44576c351638 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Sat, 22 Feb 2014 01:20:37 +0200 Subject: [PATCH] [PATCH 3/3] emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it --- ba/10d9223e0eb5ee49f8153b9381cfa10ff21f73 | 88 +++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 ba/10d9223e0eb5ee49f8153b9381cfa10ff21f73 diff --git a/ba/10d9223e0eb5ee49f8153b9381cfa10ff21f73 b/ba/10d9223e0eb5ee49f8153b9381cfa10ff21f73 new file mode 100644 index 000000000..7a4222b0f --- /dev/null +++ b/ba/10d9223e0eb5ee49f8153b9381cfa10ff21f73 @@ -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 6457B431FC4 + for ; Fri, 21 Feb 2014 15:20:52 -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 QICbreNdWKuZ for ; + Fri, 21 Feb 2014 15:20:50 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 94568431FBF + for ; Fri, 21 Feb 2014 15:20:48 -0800 (PST) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 176F110019C; Sat, 22 Feb 2014 01:20:40 +0200 (EET) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH 3/3] emacs: defun notmuch-hello-versions and bind 'v' in hello + mode to it +Date: Sat, 22 Feb 2014 01:20:37 +0200 +Message-Id: <1393024837-30394-3-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 1.8.0 +In-Reply-To: <1393024837-30394-1-git-send-email-tomi.ollila@iki.fi> +References: <1393024837-30394-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: Fri, 21 Feb 2014 23:20:52 -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 + -- 2.26.2