1
0
mirror of https://github.com/djcb/mu.git synced 2024-06-25 07:28:02 +02:00

* mu4e: don't try to select nil window when updating mail

This commit is contained in:
djcb 2013-03-05 06:35:29 -08:00
parent 1c98cbbf4e
commit a2fc0a26b9

View File

@ -149,7 +149,7 @@ an absolute path."
(cond (cond
((file-directory-p dir) t) ((file-directory-p dir) t)
((yes-or-no-p (mu4e-format "%s does not exist yes. Create now?" dir)) ((yes-or-no-p (mu4e-format "%s does not exist yes. Create now?" dir))
(mu4e~proc-mkdir dir)) (mu4e~proc-mkdir dir) t)
(t nil))) (t nil)))
(defun mu4e-format (frm &rest args) (defun mu4e-format (frm &rest args)
@ -680,14 +680,15 @@ The messages are inserted into the process buffer."
(mu4e-error "Unrecognized password request"))) (mu4e-error "Unrecognized password request")))
(when (process-buffer proc) (when (process-buffer proc)
(let ((inhibit-read-only t) (let ((inhibit-read-only t)
(process-window (get-buffer-window (process-buffer proc)))) (procwin (get-buffer-window (process-buffer proc))))
;; Insert at end of buffer. Leave point alone. ;; Insert at end of buffer. Leave point alone.
(with-current-buffer (process-buffer proc) (with-current-buffer (process-buffer proc)
(goto-char (point-max)) (goto-char (point-max))
(insert msg)) (insert msg))
;; Auto-scroll unless user is interacting with the window. ;; Auto-scroll unless user is interacting with the window.
(when (not (eq (selected-window) process-window)) (when (and (window-live-p procwin)
(with-selected-window process-window (not (eq (selected-window) procwin)))
(with-selected-window procwin
(goto-char (point-max))))))) (goto-char (point-max)))))))
(defun mu4e-update-index () (defun mu4e-update-index ()