mu4e-utils: In process filter detect if buffer is nil.

If `mu4e-update-mail' is called with BUF set to nil then the messages
should be discarded.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
This commit is contained in:
Rüdiger Sonderfeld
2012-08-27 13:48:25 +02:00
parent 0897246cf6
commit 31db80e487

View File

@ -694,7 +694,8 @@ Currently the filter only checks if the command asks for a password by matching
Currently the filter only checks if the command asks for a password by matching Currently the filter only checks if the command asks for a password by matching
the output against `mu4e~get-mail-password-regexp'. The messages are inserted the output against `mu4e~get-mail-password-regexp'. The messages are inserted
into the process buffer." into the process buffer."
(save-current-buffer (save-current-buffer
(when (process-buffer proc)
(set-buffer (process-buffer proc))) (set-buffer (process-buffer proc)))
(let ((inhibit-read-only t)) (let ((inhibit-read-only t))
;; Check whether process asks for a password and query user ;; Check whether process asks for a password and query user
@ -704,7 +705,8 @@ into the process buffer."
(read-passwd mu4e~get-mail-ask-password) (read-passwd mu4e~get-mail-ask-password)
"\n")) "\n"))
;; TODO kill process? ;; TODO kill process?
(error "Get-mail process requires a password but was not called interactively"))) (error "Get-mail process requires a password but was not called interactively")))
(when (process-buffer proc)
(insert msg))))) (insert msg)))))
(defun mu4e-update-mail (&optional buf interactive) (defun mu4e-update-mail (&optional buf interactive)