diff options
| author | Richard M. Stallman | 1994-12-03 18:29:24 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-12-03 18:29:24 +0000 |
| commit | bcddd52e8c01622559ba8fdddc8504f78a8a02d6 (patch) | |
| tree | bfe7206cb712c20e08d3737affe1848932487186 /lisp | |
| parent | c03e1113ab9f95c5aca4f573e79e8c80ba63a0f0 (diff) | |
| download | emacs-bcddd52e8c01622559ba8fdddc8504f78a8a02d6.tar.gz emacs-bcddd52e8c01622559ba8fdddc8504f78a8a02d6.zip | |
(rmail-get-new-mail): Position on first unseen message.
Return t if actually got new mail.
(rmail): Show rmail-first-unseen-message if got no new mail.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/mail/rmail.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 6a3a1886e59..3f251e6892c 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -281,14 +281,9 @@ If `rmail-display-summary' is non-nil, make a summary for this RMAIL file." | |||
| 281 | (progn | 281 | (progn |
| 282 | (rmail-set-message-counters) | 282 | (rmail-set-message-counters) |
| 283 | (rmail-show-message)))) | 283 | (rmail-show-message)))) |
| 284 | (let ((existing-unseen (rmail-first-unseen-message))) | 284 | (or (and (null file-name-arg) |
| 285 | (or file-name-arg | 285 | (rmail-get-new-mail)) |
| 286 | (rmail-get-new-mail)) | 286 | (rmail-show-message (rmail-first-unseen-message))) |
| 287 | ;; Show the first unseen message, which might be from a previous session | ||
| 288 | ;; or might have been just read in by rmail-get-new-mail. Must | ||
| 289 | ;; determine already unseen messages first, as rmail-get-new-mail | ||
| 290 | ;; positions on the first new message, thus marking it as seen. | ||
| 291 | (rmail-show-message existing-unseen)) | ||
| 292 | (if rmail-display-summary (rmail-summary)) | 287 | (if rmail-display-summary (rmail-summary)) |
| 293 | (rmail-construct-io-menu))) | 288 | (rmail-construct-io-menu))) |
| 294 | 289 | ||
| @@ -800,7 +795,8 @@ file of new mail is not changed or deleted. Noninteractively, you can | |||
| 800 | pass the inbox file name as an argument. Interactively, a prefix | 795 | pass the inbox file name as an argument. Interactively, a prefix |
| 801 | argument causes us to read a file name and use that file as the inbox. | 796 | argument causes us to read a file name and use that file as the inbox. |
| 802 | 797 | ||
| 803 | This function runs `rmail-get-new-mail-hook' before saving the updated file." | 798 | This function runs `rmail-get-new-mail-hook' before saving the updated file. |
| 799 | It returns t if it got any new messages." | ||
| 804 | (interactive | 800 | (interactive |
| 805 | (list (if current-prefix-arg | 801 | (list (if current-prefix-arg |
| 806 | (read-file-name "Get new mail from file: ")))) | 802 | (read-file-name "Get new mail from file: ")))) |
| @@ -864,16 +860,21 @@ This function runs `rmail-get-new-mail-hook' before saving the updated file." | |||
| 864 | (if (= new-messages 0) | 860 | (if (= new-messages 0) |
| 865 | (progn (goto-char opoint) | 861 | (progn (goto-char opoint) |
| 866 | (if (or file-name rmail-inbox-list) | 862 | (if (or file-name rmail-inbox-list) |
| 867 | (message "(No new mail has arrived)"))) | 863 | (message "(No new mail has arrived)")) |
| 864 | nil) | ||
| 868 | (if (rmail-summary-exists) | 865 | (if (rmail-summary-exists) |
| 869 | (rmail-select-summary | 866 | (rmail-select-summary |
| 870 | (rmail-update-summary))) | 867 | (rmail-update-summary))) |
| 871 | (message "%d new message%s read" | 868 | (message "%d new message%s read" |
| 872 | new-messages (if (= 1 new-messages) "" "s")) | 869 | new-messages (if (= 1 new-messages) "" "s")) |
| 870 | ;; Move to the first new message | ||
| 871 | ;; unless we have other unseen messages before it. | ||
| 872 | (rmail-show-message (rmail-first-unseen-message)) | ||
| 873 | ;; Update the displayed time, since that will clear out | 873 | ;; Update the displayed time, since that will clear out |
| 874 | ;; the flag that says you have mail. | 874 | ;; the flag that says you have mail. |
| 875 | (if (eq (process-status "display-time") 'run) | 875 | (if (eq (process-status "display-time") 'run) |
| 876 | (display-time-filter display-time-process "")))) | 876 | (display-time-filter display-time-process "")) |
| 877 | t)) | ||
| 877 | ;; Don't leave the buffer screwed up if we get a disk-full error. | 878 | ;; Don't leave the buffer screwed up if we get a disk-full error. |
| 878 | (rmail-show-message))) | 879 | (rmail-show-message))) |
| 879 | 880 | ||