aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-12-02 22:57:02 +0000
committerChong Yidong2008-12-02 22:57:02 +0000
commitd72fb28de766a957045205f44ae12ab20d9dd926 (patch)
treef6422a73eb1b3e2eb9410d2efc775598919e4f04
parent26520ff4da0c82e30974977a9a8db17d770e4785 (diff)
downloademacs-d72fb28de766a957045205f44ae12ab20d9dd926.tar.gz
emacs-d72fb28de766a957045205f44ae12ab20d9dd926.zip
(pmail-new-summary): Check for pmail-summary-mode in the current
buffer, not in the pmail buffer.
-rw-r--r--lisp/mail/pmailsum.el49
1 files changed, 27 insertions, 22 deletions
diff --git a/lisp/mail/pmailsum.el b/lisp/mail/pmailsum.el
index ce72701390e..90a2df8afd9 100644
--- a/lisp/mail/pmailsum.el
+++ b/lisp/mail/pmailsum.el
@@ -77,7 +77,9 @@
77(defun pmail-summary () 77(defun pmail-summary ()
78 "Display a summary of all messages, one line per message." 78 "Display a summary of all messages, one line per message."
79 (interactive) 79 (interactive)
80 (pmail-new-summary "All" '(pmail-summary) nil)) 80 (pmail-new-summary "All" '(pmail-summary) nil)
81 (unless (get-buffer-window pmail-buffer)
82 (pmail-summary-beginning-of-message)))
81 83
82;;;###autoload 84;;;###autoload
83(defun pmail-summary-by-labels (labels) 85(defun pmail-summary-by-labels (labels)
@@ -193,32 +195,35 @@ For each message, FUNC is applied to the message number and ARGS...
193and if the result is non-nil, that message is included. 195and if the result is non-nil, that message is included.
194nil for FUNCTION means all messages." 196nil for FUNCTION means all messages."
195 (message "Computing summary lines...") 197 (message "Computing summary lines...")
198 (unless pmail-buffer
199 (error "No PMAIL buffer found"))
196 (let (mesg was-in-summary) 200 (let (mesg was-in-summary)
201 (if (eq major-mode 'pmail-summary-mode)
202 (setq was-in-summary t))
197 (with-current-buffer pmail-buffer 203 (with-current-buffer pmail-buffer
198 (if (eq major-mode 'pmail-summary-mode)
199 (setq was-in-summary t))
200 (setq mesg pmail-current-message 204 (setq mesg pmail-current-message
201 pmail-summary-buffer (pmail-new-summary-1 desc redo func args))) 205 pmail-summary-buffer (pmail-new-summary-1 desc redo func args)))
202 ;; Now display the summary buffer and go to the right place in it. 206 ;; Now display the summary buffer and go to the right place in it.
203 (or was-in-summary 207 (unless was-in-summary
204 (progn 208 (if (and (one-window-p)
205 (if (and (one-window-p) 209 pop-up-windows
206 pop-up-windows (not pop-up-frames)) 210 (not pop-up-frames))
207 ;; If there is just one window, put the summary on the top. 211 ;; If there is just one window, put the summary on the top.
208 (progn 212 (progn
209 (split-window (selected-window) pmail-summary-window-size) 213 (split-window (selected-window) pmail-summary-window-size)
210 (select-window (next-window (frame-first-window))) 214 (select-window (next-window (frame-first-window)))
211 (pop-to-buffer pmail-summary-buffer) 215 (pop-to-buffer pmail-summary-buffer)
212 ;; If pop-to-buffer did not use that window, delete that 216 ;; If pop-to-buffer did not use that window, delete that
213 ;; window. (This can happen if it uses another frame.) 217 ;; window. (This can happen if it uses another frame.)
214 (if (not (eq pmail-summary-buffer (window-buffer (frame-first-window)))) 218 (if (not (eq pmail-summary-buffer
215 (delete-other-windows))) 219 (window-buffer (frame-first-window))))
216 (pop-to-buffer pmail-summary-buffer)) 220 (delete-other-windows)))
217 (set-buffer pmail-buffer) 221 (pop-to-buffer pmail-summary-buffer))
218 ;; This is how pmail makes the summary buffer reappear. 222 (set-buffer pmail-buffer)
219 ;; We do this here to make the window the proper size. 223 ;; This is how pmail makes the summary buffer reappear.
220 (pmail-select-summary nil) 224 ;; We do this here to make the window the proper size.
221 (set-buffer pmail-summary-buffer))) 225 (pmail-select-summary nil)
226 (set-buffer pmail-summary-buffer))
222 (pmail-summary-goto-msg mesg t t) 227 (pmail-summary-goto-msg mesg t t)
223 (pmail-summary-construct-io-menu) 228 (pmail-summary-construct-io-menu)
224 (message "Computing summary lines...done"))) 229 (message "Computing summary lines...done")))