X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=6907a5f910b4e33b8efc9f6d65bee3708a1a2c82;hb=904a8070889c36b5dc7169a82f20cc354cc0f867;hp=2492b80b060acc032146b2900b92c78fb0705a07;hpb=ee1180018ee3c772d7ac769222ff9c6940f3c838;p=notmuch diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 2492b80b..6907a5f9 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -220,13 +220,13 @@ the given type." ;; Helper for parts which are generally not included in the default ;; JSON output. -(defun notmuch-get-bodypart-internal (message-id part-number process-crypto) +(defun notmuch-get-bodypart-internal (query part-number process-crypto) (let ((args '("show" "--format=raw")) (part-arg (format "--part=%s" part-number))) (setq args (append args (list part-arg))) (if process-crypto (setq args (append args '("--decrypt")))) - (setq args (append args (list message-id))) + (setq args (append args (list query))) (with-temp-buffer (let ((coding-system-for-read 'no-conversion)) (progn @@ -237,9 +237,12 @@ the given type." (or (plist-get part :content) (notmuch-get-bodypart-internal (notmuch-id-to-query (plist-get msg :id)) nth process-crypto))) -(defun notmuch-plist-to-alist (plist) +;; Converts a plist of headers to an alist of headers. The input plist should +;; have symbols of the form :Header as keys, and the resulting alist will have +;; symbols of the form 'Header as keys. +(defun notmuch-headers-plist-to-alist (plist) (loop for (key value . rest) on plist by #'cddr - collect (cons (substring (symbol-name key) 1) value))) + collect (cons (intern (substring (symbol-name key) 1)) value))) ;; Compatibility functions for versions of emacs before emacs 23. ;;