aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Tomi Ollila <tomi.ollila@iki.fi>2014-03-19 22:37:11 +0200
committerGravatar David Bremner <david@tethera.net>2014-04-10 23:28:06 -0300
commit8977b1a25991d91aa5d0466eedd348a2aba50691 (patch)
tree576c3181170dff4caadc8a9b1c1034a48a7b5759 /emacs
parentcab1415a94f09c529ca7323904c5a159c996cbe0 (diff)
emacs: defun notmuch-hello-versions and bind 'v' in hello mode to it
If notmuch cli & notmuch emacs MUA versions differ, print also the emacs MUA version string (along with the cli version) to the minibuffer.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-hello.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index e325cd3b..490e9929 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -515,6 +515,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-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 @@ 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 "<C-tab>") 'widget-backward)
map)
"Keymap for \"notmuch hello\" buffers.")