* mu4e: auto scroll down in the mail fetch window (thanks to chrisklaiber)

This commit is contained in:
djcb
2013-02-17 17:32:12 +02:00
parent 332554c2b0
commit 6fc99ad495

View File

@ -670,19 +670,23 @@ successful, call FUNC (if non-nil) afterwards."
Currently the filter only checks if the command asks for a password Currently the filter only checks if the command asks for a password
by matching the output against `mu4e~get-mail-password-regexp'. by matching the output against `mu4e~get-mail-password-regexp'.
The messages are inserted into the process buffer." The messages are inserted into the process buffer."
(save-current-buffer (when (string-match mu4e~get-mail-password-regexp msg)
(when (process-buffer proc) (if (process-get proc 'x-interactive)
(set-buffer (process-buffer proc))) (process-send-string proc
(let ((inhibit-read-only t)) (concat (read-passwd mu4e~get-mail-ask-password) "\n"))
;; Check whether process asks for a password and query user ;; TODO kill process?
(when (string-match mu4e~get-mail-password-regexp msg) (mu4e-error "Unrecognized password request")))
(if (process-get proc 'x-interactive) (when (process-buffer proc)
(process-send-string proc (let ((inhibit-read-only t)
(concat (read-passwd mu4e~get-mail-ask-password) "\n")) (process-window (get-buffer-window (process-buffer proc))))
;; TODO kill process? ;; Insert at end of buffer. Leave point alone.
(mu4e-error "Unrecognized password request"))) (with-current-buffer (process-buffer proc)
(when (process-buffer proc) (goto-char (point-max))
(insert msg))))) (insert msg))
;; Auto-scroll unless user is interacting with the window.
(when (not (eq (selected-window) process-window))
(with-selected-window process-window
(goto-char (point-max)))))))
(defun mu4e-update-index () (defun mu4e-update-index ()
"Update the mu4e index." "Update the mu4e index."