* mu4e: when erasing buffer, nullify view-message too; fixes #395

This commit is contained in:
djcb 2014-03-21 07:22:54 +02:00
parent c7b28419ab
commit e55840a917
1 changed files with 16 additions and 18 deletions

View File

@ -249,8 +249,9 @@ In the format needed for `mu4e-read-option'.")
(when (buffer-live-p mu4e~headers-buffer) (when (buffer-live-p mu4e~headers-buffer)
(let ((inhibit-read-only t)) (let ((inhibit-read-only t))
(with-current-buffer mu4e~headers-buffer (with-current-buffer mu4e~headers-buffer
(erase-buffer) (setq mu4e~view-msg nil)
(mu4e~mark-clear))))) (mu4e~mark-clear)
(erase-buffer)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; handler functions ;; handler functions
@ -436,7 +437,6 @@ found."
(mu4e-error "no :function defined for field %S %S" field (cdr item))))) (mu4e-error "no :function defined for field %S %S" field (cdr item)))))
(funcall func msg))) (funcall func msg)))
;; note: this function is very performance-sensitive ;; note: this function is very performance-sensitive
(defun mu4e~headers-header-handler (msg &optional point) (defun mu4e~headers-header-handler (msg &optional point)
"Create a one line description of MSG in this buffer, at POINT, "Create a one line description of MSG in this buffer, at POINT,
@ -497,21 +497,19 @@ if provided, or at the end of the buffer otherwise."
"Create a one line description of the number of headers found "Create a one line description of the number of headers found
after the end of the search results." after the end of the search results."
(when (buffer-live-p mu4e~headers-buffer) (when (buffer-live-p mu4e~headers-buffer)
(with-current-buffer mu4e~headers-buffer (with-current-buffer mu4e~headers-buffer
(save-excursion (save-excursion
(goto-char (point-max)) (goto-char (point-max))
(let ((inhibit-read-only t) (let ((inhibit-read-only t)
(str (if (= 0 count) (str (if (zerop count) mu4e~no-matches mu4e~end-of-results)))
mu4e~no-matches (insert (propertize str 'face 'mu4e-system-face 'intangible t))
mu4e~end-of-results))) (unless (zerop count)
(insert (propertize str 'face 'mu4e-system-face 'intangible t)) (mu4e-message "Found %d matching message%s"
(unless (zerop count) count (if (= 1 count) "" "s"))
(mu4e-message "Found %d matching message%s" ;; highlight the first message
count (if (= 1 count) "" "s")) (mu4e~headers-highlight (mu4e~headers-docid-at-point (point-min)))))
;; highlight the first message ;; run-hooks
(mu4e~headers-highlight (mu4e~headers-docid-at-point (point-min))))) (run-hooks 'mu4e-headers-found-hook)))))
;; run-hooks
(run-hooks 'mu4e-headers-found-hook)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;