X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-tree.el;h=13007a134d0a9f4e8cd40a7a57bb2f9663884ee1;hp=1ed3480115a7b625fc23ced2bb2bcae39dbacaa2;hb=4c79a2dabe38ac72eb9eb21620f2ffca5f1885c6;hpb=fc4cda07a9afbbb545dcc6cd835ca697f6ef2a1b diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index 1ed34801..13007a13 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -24,8 +24,6 @@ ;;; Code: -(eval-when-compile (require 'cl-lib)) - (require 'mail-parse) (require 'notmuch-lib) @@ -401,9 +399,8 @@ Some useful entries are: (notmuch-tree-set-message-properties props))) (defun notmuch-tree-get-prop (prop &optional props) - (let ((props (or props - (notmuch-tree-get-message-properties)))) - (plist-get props prop))) + (plist-get (or props (notmuch-tree-get-message-properties)) + prop)) (defun notmuch-tree-set-tags (tags) "Set the tags of the current message." @@ -424,7 +421,6 @@ Some useful entries are: (defun notmuch-tree-get-match () "Return whether the current message is a match." - (interactive) (notmuch-tree-get-prop :match)) ;;; Update display @@ -598,8 +594,7 @@ NOT change the database." "Show the current message (in whole window)." (interactive) (let ((id (notmuch-tree-get-message-id)) - (inhibit-read-only t) - buffer) + (inhibit-read-only t)) (when id ;; We close the window to kill off un-needed buffers. (notmuch-tree-close-message-window) @@ -792,8 +787,7 @@ search results instead." (notmuch-tree-from-search-thread)))) (defun notmuch-tree-next-thread (&optional previous) - "Move to the next thread in the current tree or parent search -results + "Move to the next thread in the current tree or parent search results. If PREVIOUS is non-nil, move to the previous thread in the tree or search results instead." @@ -803,14 +797,13 @@ search results instead." (notmuch-tree-next-thread-from-search previous))) (defun notmuch-tree-prev-thread () - "Move to the previous thread in the current tree or parent search -results" + "Move to the previous thread in the current tree or parent search results." (interactive) (notmuch-tree-next-thread t)) (defun notmuch-tree-thread-mapcar (function) - "Iterate through all messages in the current thread - and call FUNCTION for side effects." + "Call FUNCTION for each message in the current thread. +FUNCTION is called for side effects only." (save-excursion (notmuch-tree-thread-top) (cl-loop collect (funcall function) @@ -1033,19 +1026,17 @@ Complete list of currently available key bindings: (setq buffer-read-only t) (setq truncate-lines t)) -(defun notmuch-tree-process-sentinel (proc msg) +(defun notmuch-tree-process-sentinel (proc _msg) "Add a message to let user know when \"notmuch tree\" exits." (let ((buffer (process-buffer proc)) (status (process-status proc)) - (exit-status (process-exit-status proc)) - (never-found-target-thread nil)) + (exit-status (process-exit-status proc))) (when (memq status '(exit signal)) (kill-buffer (process-get proc 'parse-buf)) (when (buffer-live-p buffer) (with-current-buffer buffer (save-excursion - (let ((inhibit-read-only t) - (atbob (bobp))) + (let ((inhibit-read-only t)) (goto-char (point-max)) (when (eq status 'signal) (insert "Incomplete search results (tree view process was killed).\n")) @@ -1059,8 +1050,7 @@ Complete list of currently available key bindings: "Process and filter the output of \"notmuch show\" for tree view." (let ((results-buf (process-buffer proc)) (parse-buf (process-get proc 'parse-buf)) - (inhibit-read-only t) - done) + (inhibit-read-only t)) (if (not (buffer-live-p results-buf)) (delete-process proc) (with-current-buffer parse-buf