From c7af6159c155c7eaefca82bda59bb6f37bd8b61a Mon Sep 17 00:00:00 2001 From: Timmy Douglas Date: Sun, 27 Aug 2023 15:58:50 -0700 Subject: [PATCH 1/4] notmuch --- contrib/notmuch/README.md | 12 ++++++++ contrib/notmuch/backend.lisp | 38 ++++++++++++++++++++++++ contrib/notmuch/lem-notmuch.asd | 9 ++++++ contrib/notmuch/notmuch-hello.lisp | 46 +++++++++++++++++++++++++++++ contrib/notmuch/notmuch-search.lisp | 13 ++++++++ contrib/notmuch/notmuch.lisp | 35 ++++++++++++++++++++++ contrib/notmuch/package.lisp | 16 ++++++++++ 7 files changed, 169 insertions(+) create mode 100644 contrib/notmuch/README.md create mode 100644 contrib/notmuch/backend.lisp create mode 100644 contrib/notmuch/lem-notmuch.asd create mode 100644 contrib/notmuch/notmuch-hello.lisp create mode 100644 contrib/notmuch/notmuch-search.lisp create mode 100644 contrib/notmuch/notmuch.lisp create mode 100644 contrib/notmuch/package.lisp diff --git a/contrib/notmuch/README.md b/contrib/notmuch/README.md new file mode 100644 index 000000000..b8408471f --- /dev/null +++ b/contrib/notmuch/README.md @@ -0,0 +1,12 @@ +This is a module that adds some notmuch modes for reading email with notmuch. + + +** Installation + +To use: +`M-x site-init-add-dependency` +then type `notmuch` + +this will it to your lem-site-init.asd + + diff --git a/contrib/notmuch/backend.lisp b/contrib/notmuch/backend.lisp new file mode 100644 index 000000000..7b28b9118 --- /dev/null +++ b/contrib/notmuch/backend.lisp @@ -0,0 +1,38 @@ +(in-package :lem-notmuch) + +(defvar *notmuch-executable* "notmuch") + +(defun run-notmuch (query) + (multiple-value-bind (str err retval) + (uiop:run-program (format nil "~A ~A" *notmuch-executable* query) + :output :string + :error-output :string + :ignore-error-status t) + + (if (= retval 0) + str + (editor-error "`notmuch ~A` returned ~A ~A ~A" query retval str err)))) + +;; fixme +(defun parse-notmuch-search (result) + (read-from-string result)) + +;; fixme +(defun parse-notmuch-show (result) + (read-from-string result)) + +(defun notmuch-search (query &key oldest-first) + (parse-notmuch-search + (run-notmuch (format nil "search --format=sexp --format-version=5 --sort=~A ~S" + (if oldest-first "oldest-first" "newest-first") + query)))) + + +(defun notmuch-show (query) + (parse-notmuch-show + (run-notmuch (format nil "show --format=sexp --format-version=5 ~S" query)))) + +(defun notmuch-count (query) + (parse-integer + (run-notmuch (format nil "count ~S" query)))) + diff --git a/contrib/notmuch/lem-notmuch.asd b/contrib/notmuch/lem-notmuch.asd new file mode 100644 index 000000000..a1a7d37d5 --- /dev/null +++ b/contrib/notmuch/lem-notmuch.asd @@ -0,0 +1,9 @@ +(defsystem "lem-notmuch" + :depends-on ("lem") + :serial t + :components ( + (:file "package") + (:file "backend") + (:file "notmuch-search") + (:file "notmuch-hello") + (:file "notmuch"))) diff --git a/contrib/notmuch/notmuch-hello.lisp b/contrib/notmuch/notmuch-hello.lisp new file mode 100644 index 000000000..fba188a81 --- /dev/null +++ b/contrib/notmuch/notmuch-hello.lisp @@ -0,0 +1,46 @@ + +(in-package :lem-notmuch) + +(define-major-mode notmuch-hello-mode () + (:name "notmuch-hello" + :keymap *notmuch-hello-mode-keymap*)) + +(defun find-saved-search (name-to-find) + (dolist (item *notmuch-saved-searches*) + (destructuring-bind (&key name query &allow-other-keys) + item + (when (string-equal name-to-find name) + (return-from find-saved-search query))))) + + +(defun notmuch-run-saved-query (name query) + (let ((buffer (make-buffer (format nil "*notmuch-saved-query-~A%" name))) + (results (notmuch-search query :oldest-first t))) + (switch-to-buffer buffer) + (notmuch-hello-mode) + (erase-buffer buffer) + (let ((point (current-point))) + (dolist (item results) + (destructuring-bind (&key thread date_relative matched total authors query subject query tags &allow-other-keys) + item + #+nil(lem/button:insert-button point (or thread "blah") (lambda () (with-context (notmuch-open-message thread query)))) + + (insert-string point (format nil "~20@A [~A/~A] ~20@A ~A" date_relative matched total authors subject)) + (insert-character point #\newline 1) + ) + ) + (setf (buffer-read-only-p buffer) t) + ))) + + +;; fixme don't use symbol-string-at-point +(define-command notmuch-open-saved-query (&optional (point (current-point))) () + (let* ((name (string (symbol-string-at-point point))) + (query (find-saved-search name))) + (notmuch-run-saved-query name (or query (editor-error "Could not find query for ~S" name))))) + + +(define-key *notmuch-hello-mode-keymap* "Return" 'lem-notmuch:notmuch-open-saved-query) + +(define-key *notmuch-hello-mode-keymap* "q" 'quit-active-window) + diff --git a/contrib/notmuch/notmuch-search.lisp b/contrib/notmuch/notmuch-search.lisp new file mode 100644 index 000000000..a46257727 --- /dev/null +++ b/contrib/notmuch/notmuch-search.lisp @@ -0,0 +1,13 @@ + +(in-package :lem-notmuch) + +(define-major-mode notmuch-search-mode () + (:name "notmuch-search" + :keymap *notmuch-search-mode-keymap*)) + + +; todo +;(define-key *notmuch-search-mode-keymap* "Return" 'lem-notmuch:notmuch-search-show-thread) + +(define-key *notmuch-search-mode-keymap* "q" 'quit-active-window) + diff --git a/contrib/notmuch/notmuch.lisp b/contrib/notmuch/notmuch.lisp new file mode 100644 index 000000000..b93fb7f0f --- /dev/null +++ b/contrib/notmuch/notmuch.lisp @@ -0,0 +1,35 @@ +(in-package :lem-notmuch) + +(defvar *notmuch-saved-searches* + '((:name "inbox" :query "tag:inbox") + (:name "unread" :query "tag:inbox and tag:unread"))) + + +(define-attribute notmuch-saved-search-attribute + (t :bold t)) + + + +(define-command notmuch () () + (let ((buffer (make-buffer "*notmuch-hello*"))) + (switch-to-buffer buffer) + (notmuch-hello-mode) + (erase-buffer buffer) + (let ((point (current-point))) + (insert-string point (format nil "Saved searches:~%~%")) + (dolist (saved-search *notmuch-saved-searches*) + (destructuring-bind (&key name query &allow-other-keys) + saved-search + (let ((count (notmuch-count query))) + + (lem/button:insert-button point name (lambda () (with-context (notmuch-run-saved-query name query))) + :attribute 'notmuch-saved-search-attribute) + + (insert-string point (format nil ": ~A" count)) + (insert-character point #\newline 1) + ) + + + )) + (setf (buffer-read-only-p buffer) t)))) + diff --git a/contrib/notmuch/package.lisp b/contrib/notmuch/package.lisp new file mode 100644 index 000000000..9df4613dd --- /dev/null +++ b/contrib/notmuch/package.lisp @@ -0,0 +1,16 @@ + +(defpackage :lem-notmuch + (:use :cl + :lem) + (:export + :*notmuch-executable* + :*notmuch-saved-searches* + :notmuch-hello-mode + :notmuch-open-saved-query + ; todo: for testing + :notmuch-search + :notmuch-count + :run-notmuch + ; main entrypoint + :notmuch)) + From 4f242fe862efbf0419cb019bb7aa8fbf31e29afe Mon Sep 17 00:00:00 2001 From: Timmy Douglas Date: Fri, 1 Sep 2023 12:08:35 -0700 Subject: [PATCH 2/4] updates --- contrib/notmuch/backend.lisp | 14 +++++---- contrib/notmuch/lem-notmuch.asd | 1 + contrib/notmuch/notmuch-hello.lisp | 43 +++++++++++++++------------- contrib/notmuch/notmuch-message.lisp | 39 +++++++++++++++++++++++++ contrib/notmuch/notmuch-search.lisp | 26 +++++++++++++++++ contrib/notmuch/notmuch.lisp | 19 +----------- 6 files changed, 99 insertions(+), 43 deletions(-) create mode 100644 contrib/notmuch/notmuch-message.lisp diff --git a/contrib/notmuch/backend.lisp b/contrib/notmuch/backend.lisp index 7b28b9118..02a4d7f5a 100644 --- a/contrib/notmuch/backend.lisp +++ b/contrib/notmuch/backend.lisp @@ -13,11 +13,13 @@ str (editor-error "`notmuch ~A` returned ~A ~A ~A" query retval str err)))) -;; fixme +;; fixme-- is this the right serialization format? +(defun parse-notmuch-search (result) + (read-from-string result)) + (defun parse-notmuch-search (result) (read-from-string result)) -;; fixme (defun parse-notmuch-show (result) (read-from-string result)) @@ -27,10 +29,12 @@ (if oldest-first "oldest-first" "newest-first") query)))) - -(defun notmuch-show (query) +(defun notmuch-show (query &key entire-thread decrypt) (parse-notmuch-show - (run-notmuch (format nil "show --format=sexp --format-version=5 ~S" query)))) + (run-notmuch (format nil "show --format=sexp --format-version=5 --entire-thread=~A --decrypt=auto ~S" + (if entire-thread "true" "false") + query)))) + (defun notmuch-count (query) (parse-integer diff --git a/contrib/notmuch/lem-notmuch.asd b/contrib/notmuch/lem-notmuch.asd index a1a7d37d5..d852bc006 100644 --- a/contrib/notmuch/lem-notmuch.asd +++ b/contrib/notmuch/lem-notmuch.asd @@ -4,6 +4,7 @@ :components ( (:file "package") (:file "backend") + (:file "notmuch-message") (:file "notmuch-search") (:file "notmuch-hello") (:file "notmuch"))) diff --git a/contrib/notmuch/notmuch-hello.lisp b/contrib/notmuch/notmuch-hello.lisp index fba188a81..0f54bfe0b 100644 --- a/contrib/notmuch/notmuch-hello.lisp +++ b/contrib/notmuch/notmuch-hello.lisp @@ -5,6 +5,7 @@ (:name "notmuch-hello" :keymap *notmuch-hello-mode-keymap*)) +;; fixme/unused: deprecate for button (defun find-saved-search (name-to-find) (dolist (item *notmuch-saved-searches*) (destructuring-bind (&key name query &allow-other-keys) @@ -12,35 +13,37 @@ (when (string-equal name-to-find name) (return-from find-saved-search query))))) - -(defun notmuch-run-saved-query (name query) - (let ((buffer (make-buffer (format nil "*notmuch-saved-query-~A%" name))) - (results (notmuch-search query :oldest-first t))) - (switch-to-buffer buffer) - (notmuch-hello-mode) - (erase-buffer buffer) - (let ((point (current-point))) - (dolist (item results) - (destructuring-bind (&key thread date_relative matched total authors query subject query tags &allow-other-keys) - item - #+nil(lem/button:insert-button point (or thread "blah") (lambda () (with-context (notmuch-open-message thread query)))) - - (insert-string point (format nil "~20@A [~A/~A] ~20@A ~A" date_relative matched total authors subject)) - (insert-character point #\newline 1) - ) - ) +(defun notmuch-hello (buffer) + (let ((point (current-point))) + (insert-string point (format nil "Saved searches:~%~%")) + (dolist (saved-search *notmuch-saved-searches*) + (destructuring-bind (&key name query &allow-other-keys) + saved-search + (let ((count (notmuch-count query))) + + (lem/button:insert-button point + name + (lambda () (notmuch-run-saved-query name query)) + :attribute 'notmuch-saved-search-attribute) + + (insert-string point (format nil ": ~A" count)) + (insert-character point #\newline 1) + ) + + + )) (setf (buffer-read-only-p buffer) t) - ))) + )) -;; fixme don't use symbol-string-at-point +;; fixme/unused don't use symbol-string-at-point, deprecate for button (define-command notmuch-open-saved-query (&optional (point (current-point))) () (let* ((name (string (symbol-string-at-point point))) (query (find-saved-search name))) (notmuch-run-saved-query name (or query (editor-error "Could not find query for ~S" name))))) -(define-key *notmuch-hello-mode-keymap* "Return" 'lem-notmuch:notmuch-open-saved-query) +;(define-key *notmuch-hello-mode-keymap* "Return" 'lem-notmuch:notmuch-open-saved-query) (define-key *notmuch-hello-mode-keymap* "q" 'quit-active-window) diff --git a/contrib/notmuch/notmuch-message.lisp b/contrib/notmuch/notmuch-message.lisp new file mode 100644 index 000000000..4a1820989 --- /dev/null +++ b/contrib/notmuch/notmuch-message.lisp @@ -0,0 +1,39 @@ + +(in-package :lem-notmuch) + +(define-major-mode notmuch-message-mode () + (:name "notmuch-message" + :keymap *notmuch-message-mode-keymap*)) + +(defun notmuch-print-message (email) + (destructuring-bind (&key id content-type content filename tags body crypto headers &allow-other-keys) + email + (destructuring-bind (&key from subject to date &allow-other-keys) + headers + (let ((point (current-point))) + (insert-string point (format nil "From: ~A~%Subject: ~A~%To: ~A~%Date: ~A~%~%" + from + subject + to + date)) + (insert-string point (format nil "~A" body)) + (insert-character point #\newline 1) + ) + ))) + +(defun notmuch-open-message (subject query) + (let ((buffer (make-buffer (format nil "*~A%*" subject))) + ;; (first query) is the query that matches the message + (results (car (car (notmuch-show (first query) :decrypt t :entire-thread nil))))) + (switch-to-buffer buffer) + (notmuch-message-mode) + (erase-buffer buffer) + (dolist (email-message results) + (when email-message + (notmuch-print-message email-message))) + (setf (buffer-read-only-p buffer) t) + )) + + + (define-key *notmuch-message-mode-keymap* "q" 'quit-active-window) + diff --git a/contrib/notmuch/notmuch-search.lisp b/contrib/notmuch/notmuch-search.lisp index a46257727..9d440e895 100644 --- a/contrib/notmuch/notmuch-search.lisp +++ b/contrib/notmuch/notmuch-search.lisp @@ -6,6 +6,32 @@ :keymap *notmuch-search-mode-keymap*)) + + + +(defun notmuch-run-saved-query (name query) + (let ((buffer (make-buffer (format nil "*notmuch-saved-query-~A%" name))) + (results (notmuch-search query :oldest-first t))) + (switch-to-buffer buffer) + (notmuch-search-mode) + (erase-buffer buffer) + (let ((point (current-point))) + (dolist (item results) + (when item + (destructuring-bind (&key thread date_relative matched total authors query subject query tags &allow-other-keys) + item + (lem/button:insert-button + point + (format nil "~20@A [~A/~A] ~20@A ~A" + date_relative matched total authors subject) + (lambda () (notmuch-open-message subject query))) + (insert-character point #\newline 1) + )) + ) + (setf (buffer-read-only-p buffer) t) + ))) + + ; todo ;(define-key *notmuch-search-mode-keymap* "Return" 'lem-notmuch:notmuch-search-show-thread) diff --git a/contrib/notmuch/notmuch.lisp b/contrib/notmuch/notmuch.lisp index b93fb7f0f..91143a8ca 100644 --- a/contrib/notmuch/notmuch.lisp +++ b/contrib/notmuch/notmuch.lisp @@ -9,27 +9,10 @@ (t :bold t)) - (define-command notmuch () () (let ((buffer (make-buffer "*notmuch-hello*"))) (switch-to-buffer buffer) (notmuch-hello-mode) (erase-buffer buffer) - (let ((point (current-point))) - (insert-string point (format nil "Saved searches:~%~%")) - (dolist (saved-search *notmuch-saved-searches*) - (destructuring-bind (&key name query &allow-other-keys) - saved-search - (let ((count (notmuch-count query))) - - (lem/button:insert-button point name (lambda () (with-context (notmuch-run-saved-query name query))) - :attribute 'notmuch-saved-search-attribute) - - (insert-string point (format nil ": ~A" count)) - (insert-character point #\newline 1) - ) - - - )) - (setf (buffer-read-only-p buffer) t)))) + (notmuch-hello buffer))) From 9a303a0b070b4a7c7a7f6758ab08881c704685ee Mon Sep 17 00:00:00 2001 From: Timmy Douglas Date: Fri, 1 Sep 2023 15:33:45 -0700 Subject: [PATCH 3/4] json --- contrib/notmuch/backend.lisp | 27 ++++++++++---------- contrib/notmuch/lem-notmuch.asd | 2 +- contrib/notmuch/notmuch-message.lisp | 38 +++++++++++++++++++++++----- contrib/notmuch/notmuch-search.lisp | 25 +++++++++++++----- 4 files changed, 65 insertions(+), 27 deletions(-) diff --git a/contrib/notmuch/backend.lisp b/contrib/notmuch/backend.lisp index 02a4d7f5a..208fe19a6 100644 --- a/contrib/notmuch/backend.lisp +++ b/contrib/notmuch/backend.lisp @@ -13,25 +13,15 @@ str (editor-error "`notmuch ~A` returned ~A ~A ~A" query retval str err)))) -;; fixme-- is this the right serialization format? -(defun parse-notmuch-search (result) - (read-from-string result)) - -(defun parse-notmuch-search (result) - (read-from-string result)) - -(defun parse-notmuch-show (result) - (read-from-string result)) - (defun notmuch-search (query &key oldest-first) - (parse-notmuch-search - (run-notmuch (format nil "search --format=sexp --format-version=5 --sort=~A ~S" + (yason:parse + (run-notmuch (format nil "search --format=json --format-version=5 --sort=~A ~S" (if oldest-first "oldest-first" "newest-first") query)))) (defun notmuch-show (query &key entire-thread decrypt) - (parse-notmuch-show - (run-notmuch (format nil "show --format=sexp --format-version=5 --entire-thread=~A --decrypt=auto ~S" + (yason:parse + (run-notmuch (format nil "show --format=json --format-version=5 --entire-thread=~A --decrypt=auto ~S" (if entire-thread "true" "false") query)))) @@ -40,3 +30,12 @@ (parse-integer (run-notmuch (format nil "count ~S" query)))) +(defmacro with-notmuch-props (obj props &body body) + (let ((sym (gensym))) + `(let ((,sym ,obj)) + (let ,(loop for i in props + collect (list (first i) (list 'gethash (second i) sym))) ,@body)) + )) + +; (with-notmuch-props ((a "hi") (b "bye")) (list 'x) (princ 5)) + diff --git a/contrib/notmuch/lem-notmuch.asd b/contrib/notmuch/lem-notmuch.asd index d852bc006..18118f52b 100644 --- a/contrib/notmuch/lem-notmuch.asd +++ b/contrib/notmuch/lem-notmuch.asd @@ -1,5 +1,5 @@ (defsystem "lem-notmuch" - :depends-on ("lem") + :depends-on ("lem" "yason" "alexandria") :serial t :components ( (:file "package") diff --git a/contrib/notmuch/notmuch-message.lisp b/contrib/notmuch/notmuch-message.lisp index 4a1820989..73cf4654f 100644 --- a/contrib/notmuch/notmuch-message.lisp +++ b/contrib/notmuch/notmuch-message.lisp @@ -5,18 +5,44 @@ (:name "notmuch-message" :keymap *notmuch-message-mode-keymap*)) +(defun print-message-body (point body) + (dolist (item (alexandria:flatten body)) + (with-notmuch-props item + ((id "id") + (content-type "content-type") + (content "content")) + (if (equal content-type "text/plain") + (progn + ;; fixme insert link to part + (insert-string point (format nil "~A~%" content))) + (progn + (insert-string point (format nil "[id: ~S, content type ~S]~%" id content-type)) + ) + ) + ) + ) + ) + (defun notmuch-print-message (email) - (destructuring-bind (&key id content-type content filename tags body crypto headers &allow-other-keys) - email - (destructuring-bind (&key from subject to date &allow-other-keys) - headers + (with-notmuch-props email + ((id "id") + (content-type "content-type") + (content "content") + (filename "filename") + (body "body") + (headers "headers")) + (with-notmuch-props headers + ((to "To") + (from "From") + (subject "Subject") + (date "Date")) (let ((point (current-point))) (insert-string point (format nil "From: ~A~%Subject: ~A~%To: ~A~%Date: ~A~%~%" from subject to date)) - (insert-string point (format nil "~A" body)) + (print-message-body point body) (insert-character point #\newline 1) ) ))) @@ -28,7 +54,7 @@ (switch-to-buffer buffer) (notmuch-message-mode) (erase-buffer buffer) - (dolist (email-message results) + (dolist (email-message (alexandria:flatten results)) (when email-message (notmuch-print-message email-message))) (setf (buffer-read-only-p buffer) t) diff --git a/contrib/notmuch/notmuch-search.lisp b/contrib/notmuch/notmuch-search.lisp index 9d440e895..69dc40d70 100644 --- a/contrib/notmuch/notmuch-search.lisp +++ b/contrib/notmuch/notmuch-search.lisp @@ -6,8 +6,10 @@ :keymap *notmuch-search-mode-keymap*)) - - +(defun truncate-field (len str) + (if (< len (length str)) + (concatenate 'string (subseq str 0 (- len 3)) "...") + str)) (defun notmuch-run-saved-query (name query) (let ((buffer (make-buffer (format nil "*notmuch-saved-query-~A%" name))) @@ -18,12 +20,23 @@ (let ((point (current-point))) (dolist (item results) (when item - (destructuring-bind (&key thread date_relative matched total authors query subject query tags &allow-other-keys) - item + (with-notmuch-props item + ((thread "thread") + (date_relative "date_relative") + (matched "matched") + (total "total") + (authors "authors") + (query "query") + (subject "subject") + (tags "tags")) (lem/button:insert-button point - (format nil "~20@A [~A/~A] ~20@A ~A" - date_relative matched total authors subject) + (format nil "~20@A [~A/~A] ~25@A ~A" + date_relative + matched + total + (truncate-field 20 authors) + (truncate-field 60 subject)) (lambda () (notmuch-open-message subject query))) (insert-character point #\newline 1) )) From 8eaa033a106470891c946b838eb9a3ffa1c26aa1 Mon Sep 17 00:00:00 2001 From: Timmy Douglas Date: Fri, 1 Sep 2023 20:45:31 -0700 Subject: [PATCH 4/4] rename --- contrib/notmuch/lem-notmuch.asd | 2 +- contrib/notmuch/notmuch-search.lisp | 9 ++++----- .../notmuch/{notmuch-message.lisp => notmuch-show.lisp} | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) rename contrib/notmuch/{notmuch-message.lisp => notmuch-show.lisp} (97%) diff --git a/contrib/notmuch/lem-notmuch.asd b/contrib/notmuch/lem-notmuch.asd index 18118f52b..ec8d89428 100644 --- a/contrib/notmuch/lem-notmuch.asd +++ b/contrib/notmuch/lem-notmuch.asd @@ -4,7 +4,7 @@ :components ( (:file "package") (:file "backend") - (:file "notmuch-message") + (:file "notmuch-show") (:file "notmuch-search") (:file "notmuch-hello") (:file "notmuch"))) diff --git a/contrib/notmuch/notmuch-search.lisp b/contrib/notmuch/notmuch-search.lisp index 69dc40d70..ba58b8584 100644 --- a/contrib/notmuch/notmuch-search.lisp +++ b/contrib/notmuch/notmuch-search.lisp @@ -31,13 +31,12 @@ (tags "tags")) (lem/button:insert-button point - (format nil "~20@A [~A/~A] ~25@A ~A" - date_relative - matched - total + (format nil "~12@A ~8@A ~25@A ~A" + (truncate-field 12 date_relative) + (format nil "[~A/~A]" matched total) (truncate-field 20 authors) (truncate-field 60 subject)) - (lambda () (notmuch-open-message subject query))) + (lambda () (notmuch-show-message subject query))) (insert-character point #\newline 1) )) ) diff --git a/contrib/notmuch/notmuch-message.lisp b/contrib/notmuch/notmuch-show.lisp similarity index 97% rename from contrib/notmuch/notmuch-message.lisp rename to contrib/notmuch/notmuch-show.lisp index 73cf4654f..5dca78d25 100644 --- a/contrib/notmuch/notmuch-message.lisp +++ b/contrib/notmuch/notmuch-show.lisp @@ -47,7 +47,7 @@ ) ))) -(defun notmuch-open-message (subject query) +(defun notmuch-show-message (subject query) (let ((buffer (make-buffer (format nil "*~A%*" subject))) ;; (first query) is the query that matches the message (results (car (car (notmuch-show (first query) :decrypt t :entire-thread nil)))))