Mercurial > emacs
comparison lisp/mail/rmailsum.el @ 17096:4a2d9b3990e3
(rmail-new-summary): Setup rmail-view-buffer.
(rmail-summary-line-decoder): New variable.
(rmail-make-summary-line-1): Use a function set in
rmail-summary-line-decoder.
(rmail-summary-next-msg): Display rmail-view-buffer.
(rmail-summary-mode): Make rmail-view-buffer buffer local.
(rmail-summary-rmail-update, rmail-summary-scroll-msg-up): Use
rmail-view-buffer instead of rmail-buffer.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Wed, 26 Feb 1997 13:05:13 +0000 |
parents | 82e54a854639 |
children | 3303fa112347 |
comparison
equal
deleted
inserted
replaced
17095:b57415dcc114 | 17096:4a2d9b3990e3 |
---|---|
202 ;; Temporarily, while summary buffer is unfinished, | 202 ;; Temporarily, while summary buffer is unfinished, |
203 ;; we "don't have" a summary. | 203 ;; we "don't have" a summary. |
204 (setq rmail-summary-buffer nil) | 204 (setq rmail-summary-buffer nil) |
205 (save-excursion | 205 (save-excursion |
206 (let ((rbuf (current-buffer)) | 206 (let ((rbuf (current-buffer)) |
207 (vbuf rmail-view-buffer) | |
207 (total rmail-total-messages)) | 208 (total rmail-total-messages)) |
208 (set-buffer sumbuf) | 209 (set-buffer sumbuf) |
209 ;; Set up the summary buffer's contents. | 210 ;; Set up the summary buffer's contents. |
210 (let ((buffer-read-only nil)) | 211 (let ((buffer-read-only nil)) |
211 (erase-buffer) | 212 (erase-buffer) |
217 (setq buffer-read-only t) | 218 (setq buffer-read-only t) |
218 (rmail-summary-mode) | 219 (rmail-summary-mode) |
219 (make-local-variable 'minor-mode-alist) | 220 (make-local-variable 'minor-mode-alist) |
220 (setq minor-mode-alist (list (list t (concat ": " description)))) | 221 (setq minor-mode-alist (list (list t (concat ": " description)))) |
221 (setq rmail-buffer rbuf | 222 (setq rmail-buffer rbuf |
223 rmail-view-buffer vbuf | |
222 rmail-summary-redo redo-form | 224 rmail-summary-redo redo-form |
223 rmail-total-messages total)))) | 225 rmail-total-messages total)))) |
224 (setq rmail-summary-buffer sumbuf)) | 226 (setq rmail-summary-buffer sumbuf)) |
225 ;; Now display the summary buffer and go to the right place in it. | 227 ;; Now display the summary buffer and go to the right place in it. |
226 (or was-in-summary | 228 (or was-in-summary |
261 (aset line 4 | 263 (aset line 4 |
262 (if (rmail-message-deleted-p msg) ?\D | 264 (if (rmail-message-deleted-p msg) ?\D |
263 (if (= ?0 (char-after (+ 3 (rmail-msgbeg msg)))) | 265 (if (= ?0 (char-after (+ 3 (rmail-msgbeg msg)))) |
264 ?\- ?\ ))) | 266 ?\- ?\ ))) |
265 line)) | 267 line)) |
268 | |
269 ;;;###autoload | |
270 (defvar rmail-summary-line-decoder (function identity) | |
271 "*Function to decode summary-line. | |
272 | |
273 By default, `identity' is set.") | |
266 | 274 |
267 (defun rmail-make-summary-line-1 (msg) | 275 (defun rmail-make-summary-line-1 (msg) |
268 (goto-char (rmail-msgbeg msg)) | 276 (goto-char (rmail-msgbeg msg)) |
269 (let* ((lim (save-excursion (forward-line 2) (point))) | 277 (let* ((lim (save-excursion (forward-line 2) (point))) |
270 pos | 278 pos |
316 (goto-char (rmail-msgbeg msg)) | 324 (goto-char (rmail-msgbeg msg)) |
317 (forward-line 2) | 325 (forward-line 2) |
318 (insert "Summary-line: " line))) | 326 (insert "Summary-line: " line))) |
319 (setq pos (string-match "#" line)) | 327 (setq pos (string-match "#" line)) |
320 (aset rmail-summary-vector (1- msg) | 328 (aset rmail-summary-vector (1- msg) |
321 (concat (format "%4d " msg) | 329 (funcall rmail-summary-line-decoder |
322 (substring line 0 pos) | 330 (concat (format "%4d " msg) |
323 labels | 331 (substring line 0 pos) |
324 (substring line (1+ pos)))))) | 332 labels |
333 (substring line (1+ pos))))) | |
334 )) | |
325 | 335 |
326 (defun rmail-make-basic-summary-line () | 336 (defun rmail-make-basic-summary-line () |
327 (goto-char (point-min)) | 337 (goto-char (point-min)) |
328 (concat (save-excursion | 338 (concat (save-excursion |
329 (if (not (re-search-forward "^Date:" nil t)) | 339 (if (not (re-search-forward "^Date:" nil t)) |
469 (while (and (> count 0) (setq non-del-msg-found | 479 (while (and (> count 0) (setq non-del-msg-found |
470 (or (funcall search "^....[^D]" nil t) | 480 (or (funcall search "^....[^D]" nil t) |
471 non-del-msg-found))) | 481 non-del-msg-found))) |
472 (setq count (1- count)))) | 482 (setq count (1- count)))) |
473 (beginning-of-line) | 483 (beginning-of-line) |
474 (display-buffer rmail-buffer)) | 484 (display-buffer rmail-view-buffer) |
485 ) | |
475 | 486 |
476 (defun rmail-summary-previous-msg (&optional number) | 487 (defun rmail-summary-previous-msg (&optional number) |
477 (interactive "p") | 488 (interactive "p") |
478 (rmail-summary-next-msg (- (if number number 1)))) | 489 (rmail-summary-next-msg (- (if number number 1)))) |
479 | 490 |
685 (setq mode-name "RMAIL Summary") | 696 (setq mode-name "RMAIL Summary") |
686 (setq truncate-lines t) | 697 (setq truncate-lines t) |
687 (setq buffer-read-only t) | 698 (setq buffer-read-only t) |
688 (set-syntax-table text-mode-syntax-table) | 699 (set-syntax-table text-mode-syntax-table) |
689 (make-local-variable 'rmail-buffer) | 700 (make-local-variable 'rmail-buffer) |
701 (make-local-variable 'rmail-view-buffer) | |
690 (make-local-variable 'rmail-total-messages) | 702 (make-local-variable 'rmail-total-messages) |
691 (make-local-variable 'rmail-current-message) | 703 (make-local-variable 'rmail-current-message) |
692 (setq rmail-current-message nil) | 704 (setq rmail-current-message nil) |
693 (make-local-variable 'rmail-summary-redo) | 705 (make-local-variable 'rmail-summary-redo) |
694 (setq rmail-summary-redo nil) | 706 (setq rmail-summary-redo nil) |
737 ;; Don't let a subsequent isearch restore that `unseen'. | 749 ;; Don't let a subsequent isearch restore that `unseen'. |
738 (if (not isearch-mode) | 750 (if (not isearch-mode) |
739 (setq rmail-summary-put-back-unseen nil)) | 751 (setq rmail-summary-put-back-unseen nil)) |
740 | 752 |
741 (or (eq rmail-current-message msg-num) | 753 (or (eq rmail-current-message msg-num) |
742 (let ((window (get-buffer-window rmail-buffer)) | 754 (let ((window (get-buffer-window rmail-view-buffer)) |
743 (owin (selected-window))) | 755 (owin (selected-window))) |
744 (if isearch-mode | 756 (if isearch-mode |
745 (save-excursion | 757 (save-excursion |
746 (set-buffer rmail-buffer) | 758 (set-buffer rmail-buffer) |
747 ;; If we first saw the previous message in this search, | 759 ;; If we first saw the previous message in this search, |
1053 If the Rmail window is displaying the end of a message, | 1065 If the Rmail window is displaying the end of a message, |
1054 advance to the next message." | 1066 advance to the next message." |
1055 (interactive "P") | 1067 (interactive "P") |
1056 (if (eq dist '-) | 1068 (if (eq dist '-) |
1057 (rmail-summary-scroll-msg-down nil) | 1069 (rmail-summary-scroll-msg-down nil) |
1058 (let ((rmail-buffer-window (get-buffer-window rmail-buffer))) | 1070 (let ((rmail-buffer-window (get-buffer-window rmail-view-buffer))) |
1059 (if rmail-buffer-window | 1071 (if rmail-buffer-window |
1060 (if (let ((rmail-summary-window (selected-window))) | 1072 (if (let ((rmail-summary-window (selected-window))) |
1061 (select-window rmail-buffer-window) | 1073 (select-window rmail-buffer-window) |
1062 (prog1 | 1074 (prog1 |
1063 ;; Is EOB visible in the buffer? | 1075 ;; Is EOB visible in the buffer? |
1068 (eobp))) | 1080 (eobp))) |
1069 (select-window rmail-summary-window))) | 1081 (select-window rmail-summary-window))) |
1070 (if (not rmail-summary-scroll-between-messages) | 1082 (if (not rmail-summary-scroll-between-messages) |
1071 (error "End of buffer") | 1083 (error "End of buffer") |
1072 (rmail-summary-next-msg (or dist 1))) | 1084 (rmail-summary-next-msg (or dist 1))) |
1073 (let ((other-window-scroll-buffer rmail-buffer)) | 1085 (let ((other-window-scroll-buffer rmail-view-buffer)) |
1074 (scroll-other-window dist))) | 1086 (scroll-other-window dist))) |
1075 ;; If it isn't visible at all, show the beginning. | 1087 ;; If it isn't visible at all, show the beginning. |
1076 (rmail-summary-beginning-of-message))))) | 1088 (rmail-summary-beginning-of-message))))) |
1077 | 1089 |
1078 (defun rmail-summary-scroll-msg-down (&optional dist) | 1090 (defun rmail-summary-scroll-msg-down (&optional dist) |