aboutsummaryrefslogtreecommitdiff
path: root/emacs/notmuch-lib.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2020-11-16 22:28:25 +0100
committerDavid Bremner <david@tethera.net>2020-12-06 16:18:34 -0400
commitdfd99c7fba16d787cad7f8a6c39d66310b1af909 (patch)
tree1c2b64be7ab6c0bcebddb312990ba51809d487f3 /emacs/notmuch-lib.el
parentff80122972c3ab9882654a0d75698c6692007e15 (diff)
emacs: sanitize function that displays version
Previously it was defined in "notmuch-hello.el" and its name contained "hello" solely because it replaced an anonymous function that was mistakenly only bound in `notmuch-hello-mode-map'. But it makes more sense to bind it in all notmuch modes and even if we did not change that aspect it still would make no sense to have "hello" in its name.
Diffstat (limited to 'emacs/notmuch-lib.el')
-rw-r--r--emacs/notmuch-lib.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index edb40533..8ee3f17f 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -147,6 +147,7 @@ For example, if you wanted to remove an \"inbox\" tag and add an
(defvar notmuch-common-keymap
(let ((map (make-sparse-keymap)))
(define-key map "?" 'notmuch-help)
+ (define-key map "v" 'notmuch-version)
(define-key map "q" 'notmuch-bury-or-kill-this-buffer)
(define-key map "s" 'notmuch-search)
(define-key map "t" 'notmuch-search-by-tag)
@@ -218,6 +219,21 @@ on the command line, and then retry your notmuch command")))
(match-string 2 long-string)
"unknown")))
+(defvar notmuch-emacs-version)
+
+(defun notmuch-version ()
+ "Display the notmuch version.
+The versions of the Emacs package and the `notmuch' executable
+should match, but if and only if they don't, then this command
+displays both values separately."
+ (interactive)
+ (let ((cli-version (notmuch-cli-version)))
+ (message "notmuch version %s"
+ (if (string= notmuch-emacs-version cli-version)
+ cli-version
+ (concat cli-version
+ " (emacs mua version " notmuch-emacs-version ")")))))
+
(defun notmuch-config-get (item)
"Return a value from the notmuch configuration."
(let* ((val (notmuch-command-to-string "config" "get" item))