]> git.notmuchmail.org Git - notmuch/blobdiff - contrib/notmuch-pick/notmuch-pick.el
pick: contrib: document notmuch-pick-message-window-kill-hook
[notmuch] / contrib / notmuch-pick / notmuch-pick.el
index cce3cb7244a401005016fbed401de70985d2b600..fd68fc65e236e57e5bc253f0d01b42e644d9f394 100644 (file)
@@ -184,11 +184,8 @@ the child show buffer.")
 
 This is used to try and make sure we don't close the message pane
 if the user has loaded a different buffer in that window.")
-(make-variable-buffer-local 'notmuch-pick-message-buffer-name)
-(put 'notmuch-pick-message-buffer-name 'permanent-local t)
-
-(defvar notmuch-pick-process-state nil
-  "Parsing state of the search process filter.")
+(make-variable-buffer-local 'notmuch-pick-message-buffer)
+(put 'notmuch-pick-message-buffer 'permanent-local t)
 
 (defvar notmuch-pick-mode-map
   (let ((map (make-sparse-keymap)))
@@ -217,6 +214,11 @@ if the user has loaded a different buffer in that window.")
 (fset 'notmuch-pick-mode-map notmuch-pick-mode-map)
 
 (defun notmuch-pick-setup-show-out ()
+  "Set up the keymap for showing a thread
+
+This uses the value of the defcustom notmuch-pick-show-out to
+decide whether to show a message in the message pane or in the
+whole window."
   (let ((map notmuch-pick-mode-map))
     (if notmuch-pick-show-out
        (progn
@@ -274,6 +276,11 @@ Some useful entries are:
   (notmuch-pick-get-prop :match))
 
 (defun notmuch-pick-refresh-result ()
+  "Redisplay the current message line.
+
+This redisplays the current line based on the messages
+properties (as they are now). This is used when tags are
+updated."
   (let ((init-point (point))
        (end (line-end-position))
        (msg (notmuch-pick-get-message-properties))
@@ -377,6 +384,7 @@ Does NOT change the database."
                t))
 
 (defun notmuch-pick-message-window-kill-hook ()
+  "Close the message pane when exiting the show buffer."
   (let ((buffer (current-buffer)))
     (when (and (window-live-p notmuch-pick-message-window)
               (eq (window-buffer notmuch-pick-message-window) buffer))
@@ -767,15 +775,6 @@ Complete list of currently available key bindings:
                      (insert (format " (process returned %d)" exit-status)))
                    (insert "\n")))))))))
 
-
-(defun notmuch-pick-show-error (string &rest objects)
-  (save-excursion
-    (goto-char (point-max))
-    (insert "Error: Unexpected output from notmuch search:\n")
-    (insert (apply #'format string objects))
-    (insert "\n")))
-
-
 (defun notmuch-pick-process-filter (proc string)
   "Process and filter the output of \"notmuch show\" (for pick)"
   (let ((results-buf (process-buffer proc))