diff lisp/mail/rmail.el @ 10103:efb97e6ec979

(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.
author Richard M. Stallman <rms@gnu.org>
date Sat, 03 Dec 1994 18:29:24 +0000
parents 3c1d373d9125
children 29c400c63312
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Sat Dec 03 14:59:40 1994 +0000
+++ b/lisp/mail/rmail.el	Sat Dec 03 18:29:24 1994 +0000
@@ -281,14 +281,9 @@
 	  (progn
 	    (rmail-set-message-counters)
 	    (rmail-show-message))))
-    (let ((existing-unseen (rmail-first-unseen-message)))
-      (or file-name-arg
-	  (rmail-get-new-mail))
-      ;; Show the first unseen message, which might be from a previous session
-      ;; or might have been just read in by rmail-get-new-mail.  Must
-      ;; determine already unseen messages first, as rmail-get-new-mail
-      ;; positions on the first new message, thus marking it as seen.
-      (rmail-show-message existing-unseen))
+    (or (and (null file-name-arg)
+	     (rmail-get-new-mail))
+	(rmail-show-message (rmail-first-unseen-message)))
     (if rmail-display-summary (rmail-summary))
     (rmail-construct-io-menu)))
 
@@ -800,7 +795,8 @@
 pass the inbox file name as an argument.  Interactively, a prefix
 argument causes us to read a file name and use that file as the inbox.
 
-This function runs `rmail-get-new-mail-hook' before saving the updated file."
+This function runs `rmail-get-new-mail-hook' before saving the updated file.
+It returns t if it got any new messages."
   (interactive
    (list (if current-prefix-arg
 	     (read-file-name "Get new mail from file: "))))
@@ -864,16 +860,21 @@
 	(if (= new-messages 0)
 	    (progn (goto-char opoint)
 		   (if (or file-name rmail-inbox-list)
-		       (message "(No new mail has arrived)")))
+		       (message "(No new mail has arrived)"))
+		   nil)
 	  (if (rmail-summary-exists)
 	      (rmail-select-summary
 		(rmail-update-summary)))
 	  (message "%d new message%s read"
 		   new-messages (if (= 1 new-messages) "" "s"))
+	  ;; Move to the first new message
+	  ;; unless we have other unseen messages before it.
+	  (rmail-show-message (rmail-first-unseen-message))
 	  ;; Update the displayed time, since that will clear out
 	  ;; the flag that says you have mail.
 	  (if (eq (process-status "display-time") 'run)
-	      (display-time-filter display-time-process ""))))
+	      (display-time-filter display-time-process ""))
+	  t))
     ;; Don't leave the buffer screwed up if we get a disk-full error.
     (rmail-show-message)))