aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-05-08 11:18:48 +0000
committerGerd Moellmann2001-05-08 11:18:48 +0000
commit67f2e119e3c9fcc9bfc1341d08a12220f737382c (patch)
treed1dc0d8d7d3701e16a35ce5ebba80d737943e887
parentc96b208d6dd74a7d4011aae1b3e4881b74ca0842 (diff)
downloademacs-67f2e119e3c9fcc9bfc1341d08a12220f737382c.tar.gz
emacs-67f2e119e3c9fcc9bfc1341d08a12220f737382c.zip
(rmail-message-subject-p): Process the result
of mail-fetch-field by rmail-summary-line-decoder. (rmail-new-summary): Be sure to go to the Rmail buffer. If rmail-enable-mime is non-nil, set rmail-summary-buffer of rmail-view-buffer to nil. (rmail-summary-undelete): If rmail-enable-mime is non-nil, pop to rmail-view-buffer. (rmail-summary-scroll-msg-up): Handle rmail-view-buffer, not rmail-buffer. (rmail-summary-scroll-msg-down): Likewise. (rmail-summary-beginning-of-message): Likewise. (rmail-summary-wipe): Likewise. (rmail-summary-toggle-header): Use save-window-excursion, not save-excursion. Update point in rmail-view-buffer, not in rmail-buffer. (rmail-summary-reply): Before calling rmail-reply, set buffer to rmail-view-buffer, not rmail-buffer.
-rw-r--r--lisp/mail/rmailsum.el37
1 files changed, 22 insertions, 15 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index cf1d313b7f5..b9578c8ec65 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -138,7 +138,8 @@ SUBJECT is a string of regexps separated by commas."
138 (progn (search-forward (if whole-message "\^_" "\n\n")) (point))) 138 (progn (search-forward (if whole-message "\^_" "\n\n")) (point)))
139 (goto-char (point-min)) 139 (goto-char (point-min))
140 (if whole-message (re-search-forward subject nil t) 140 (if whole-message (re-search-forward subject nil t)
141 (string-match subject (or (mail-fetch-field "Subject") "")) ))) 141 (string-match subject (or (funcall rmail-summary-line-decoder
142 (mail-fetch-field "Subject")) "")) )))
142 143
143;;;###autoload 144;;;###autoload
144(defun rmail-summary-by-senders (senders) 145(defun rmail-summary-by-senders (senders)
@@ -173,9 +174,8 @@ nil for FUNCTION means all messages."
173 (save-excursion 174 (save-excursion
174 ;; Go to the Rmail buffer. 175 ;; Go to the Rmail buffer.
175 (if (eq major-mode 'rmail-summary-mode) 176 (if (eq major-mode 'rmail-summary-mode)
176 (progn 177 (setq was-in-summary t))
177 (setq was-in-summary t) 178 (set-buffer rmail-buffer)
178 (set-buffer rmail-buffer)))
179 ;; Find its summary buffer, or make one. 179 ;; Find its summary buffer, or make one.
180 (setq sumbuf 180 (setq sumbuf
181 (if (and rmail-summary-buffer 181 (if (and rmail-summary-buffer
@@ -207,6 +207,9 @@ nil for FUNCTION means all messages."
207 ;; Temporarily, while summary buffer is unfinished, 207 ;; Temporarily, while summary buffer is unfinished,
208 ;; we "don't have" a summary. 208 ;; we "don't have" a summary.
209 (setq rmail-summary-buffer nil) 209 (setq rmail-summary-buffer nil)
210 (if rmail-enable-mime
211 (with-current-buffer rmail-view-buffer
212 (setq rmail-summary-buffer nil)))
210 (save-excursion 213 (save-excursion
211 (let ((rbuf (current-buffer)) 214 (let ((rbuf (current-buffer))
212 (vbuf rmail-view-buffer) 215 (vbuf rmail-view-buffer)
@@ -667,9 +670,13 @@ Optional prefix ARG means undelete ARG previous messages."
667 (cond ((re-search-backward "\\(^ *[0-9]*\\)\\(D\\)" nil t) 670 (cond ((re-search-backward "\\(^ *[0-9]*\\)\\(D\\)" nil t)
668 (replace-match "\\1 ") 671 (replace-match "\\1 ")
669 (rmail-summary-goto-msg) 672 (rmail-summary-goto-msg)
670 (pop-to-buffer rmail-buffer) 673 (if rmail-enable-mime
674 (set-buffer rmail-buffer)
675 (pop-to-buffer rmail-buffer))
671 (and (rmail-message-deleted-p rmail-current-message) 676 (and (rmail-message-deleted-p rmail-current-message)
672 (rmail-undelete-previous-message)) 677 (rmail-undelete-previous-message))
678 (if rmail-enable-mime
679 (pop-to-buffer rmail-view-buffer))
673 (pop-to-buffer rmail-summary-buffer)) 680 (pop-to-buffer rmail-summary-buffer))
674 (t (goto-char opoint)))))) 681 (t (goto-char opoint))))))
675 682
@@ -1140,7 +1147,7 @@ move to the previous message."
1140 (interactive "P") 1147 (interactive "P")
1141 (if (eq dist '-) 1148 (if (eq dist '-)
1142 (rmail-summary-scroll-msg-up nil) 1149 (rmail-summary-scroll-msg-up nil)
1143 (let ((rmail-buffer-window (get-buffer-window rmail-buffer))) 1150 (let ((rmail-buffer-window (get-buffer-window rmail-view-buffer)))
1144 (if rmail-buffer-window 1151 (if rmail-buffer-window
1145 (if (let ((rmail-summary-window (selected-window))) 1152 (if (let ((rmail-summary-window (selected-window)))
1146 (select-window rmail-buffer-window) 1153 (select-window rmail-buffer-window)
@@ -1154,7 +1161,7 @@ move to the previous message."
1154 (if (not rmail-summary-scroll-between-messages) 1161 (if (not rmail-summary-scroll-between-messages)
1155 (error "Beginning of buffer") 1162 (error "Beginning of buffer")
1156 (rmail-summary-previous-msg (or dist 1))) 1163 (rmail-summary-previous-msg (or dist 1)))
1157 (let ((other-window-scroll-buffer rmail-buffer)) 1164 (let ((other-window-scroll-buffer rmail-view-buffer))
1158 (scroll-other-window-down dist))) 1165 (scroll-other-window-down dist)))
1159 ;; If it isn't visible at all, show the beginning. 1166 ;; If it isn't visible at all, show the beginning.
1160 (rmail-summary-beginning-of-message))))) 1167 (rmail-summary-beginning-of-message)))))
@@ -1164,15 +1171,15 @@ move to the previous message."
1164 (interactive) 1171 (interactive)
1165 (if (and (one-window-p) (not pop-up-frames)) 1172 (if (and (one-window-p) (not pop-up-frames))
1166 ;; If there is just one window, put the summary on the top. 1173 ;; If there is just one window, put the summary on the top.
1167 (let ((buffer rmail-buffer)) 1174 (let ((buffer rmail-view-buffer))
1168 (split-window (selected-window) rmail-summary-window-size) 1175 (split-window (selected-window) rmail-summary-window-size)
1169 (select-window (frame-first-window)) 1176 (select-window (frame-first-window))
1170 (pop-to-buffer rmail-buffer) 1177 (pop-to-buffer rmail-view-buffer)
1171 ;; If pop-to-buffer did not use that window, delete that 1178 ;; If pop-to-buffer did not use that window, delete that
1172 ;; window. (This can happen if it uses another frame.) 1179 ;; window. (This can happen if it uses another frame.)
1173 (or (eq buffer (window-buffer (next-window (frame-first-window)))) 1180 (or (eq buffer (window-buffer (next-window (frame-first-window))))
1174 (delete-other-windows))) 1181 (delete-other-windows)))
1175 (pop-to-buffer rmail-buffer)) 1182 (pop-to-buffer rmail-view-buffer))
1176 (beginning-of-buffer) 1183 (beginning-of-buffer)
1177 (pop-to-buffer rmail-summary-buffer)) 1184 (pop-to-buffer rmail-summary-buffer))
1178 1185
@@ -1197,7 +1204,7 @@ move to the previous message."
1197 "Kill and wipe away Rmail summary, remaining within Rmail." 1204 "Kill and wipe away Rmail summary, remaining within Rmail."
1198 (interactive) 1205 (interactive)
1199 (save-excursion (set-buffer rmail-buffer) (setq rmail-summary-buffer nil)) 1206 (save-excursion (set-buffer rmail-buffer) (setq rmail-summary-buffer nil))
1200 (let ((local-rmail-buffer rmail-buffer)) 1207 (let ((local-rmail-buffer rmail-view-buffer))
1201 (kill-buffer (current-buffer)) 1208 (kill-buffer (current-buffer))
1202 ;; Delete window if not only one. 1209 ;; Delete window if not only one.
1203 (if (not (eq (selected-window) (next-window nil 'no-minibuf))) 1210 (if (not (eq (selected-window) (next-window nil 'no-minibuf)))
@@ -1358,12 +1365,12 @@ Interactively, empty argument means use same regexp used last time."
1358(defun rmail-summary-toggle-header () 1365(defun rmail-summary-toggle-header ()
1359 "Show original message header if pruned header currently shown, or vice versa." 1366 "Show original message header if pruned header currently shown, or vice versa."
1360 (interactive) 1367 (interactive)
1361 (save-excursion 1368 (save-window-excursion
1362 (set-buffer rmail-buffer) 1369 (set-buffer rmail-buffer)
1363 (rmail-toggle-header)) 1370 (rmail-toggle-header))
1364 ;; Inside save-excursion, some changes to point in the RMAIL buffer are lost. 1371 ;; Inside save-excursion, some changes to point in the RMAIL buffer are lost.
1365 ;; Set point to point-min in the RMAIL buffer, if it is visible. 1372 ;; Set point to point-min in the RMAIL buffer, if it is visible.
1366 (let ((window (get-buffer-window rmail-buffer))) 1373 (let ((window (get-buffer-window rmail-view-buffer)))
1367 (if window 1374 (if window
1368 ;; Using save-window-excursion would lose the new value of point. 1375 ;; Using save-window-excursion would lose the new value of point.
1369 (let ((owin (selected-window))) 1376 (let ((owin (selected-window)))
@@ -1429,10 +1436,10 @@ Normally include CC: to all other recipients of original message;
1429prefix argument means ignore them. While composing the reply, 1436prefix argument means ignore them. While composing the reply,
1430use \\[mail-yank-original] to yank the original message into it." 1437use \\[mail-yank-original] to yank the original message into it."
1431 (interactive "P") 1438 (interactive "P")
1432 (let ((window (get-buffer-window rmail-buffer))) 1439 (let ((window (get-buffer-window rmail-view-buffer)))
1433 (if window 1440 (if window
1434 (select-window window) 1441 (select-window window)
1435 (set-buffer rmail-buffer))) 1442 (set-buffer rmail-view-buffer)))
1436 (rmail-reply just-sender) 1443 (rmail-reply just-sender)
1437 (rmail-summary-override-mail-send-and-exit)) 1444 (rmail-summary-override-mail-send-and-exit))
1438 1445