changeset 9352:f10a1492ecfa

(rmail-summary-goto-msg): Get rmail-total-messages from the rmail buffer.
author Richard M. Stallman <rms@gnu.org>
date Thu, 06 Oct 1994 07:05:09 +0000
parents e3303c64b684
children 30659ed71a1b
files lisp/mail/rmailsum.el
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmailsum.el	Thu Oct 06 03:25:51 1994 +0000
+++ b/lisp/mail/rmailsum.el	Thu Oct 06 07:05:09 1994 +0000
@@ -786,13 +786,14 @@
   (if (consp n) (setq n (prefix-numeric-value n)))
   (if (eobp) (forward-line -1))
   (beginning-of-line)
-  (let ((obuf (current-buffer))
-	(buf rmail-buffer)
-	(cur (point))
-	message-not-found
-	(curmsg (string-to-int
-		 (buffer-substring (point)
-				   (min (point-max) (+ 5 (point)))))))
+  (let* ((obuf (current-buffer))
+	 (buf rmail-buffer)
+	 (cur (point))
+	 message-not-found
+	 (curmsg (string-to-int
+		  (buffer-substring (point)
+				    (min (point-max) (+ 5 (point))))))
+	 (total (save-excursion (set-buffer buf) rmail-total-messages)))
     ;; If message number N was specified, find that message's line
     ;; or set message-not-found.
     ;; If N wasn't specified or that message can't be found.
@@ -802,7 +803,7 @@
       (if (< n 1)
 	  (progn (message "No preceding message")
 		 (setq n 1)))
-      (if (> n rmail-total-messages)
+      (if (> n total)
 	  (progn (message "No following message")
 		 (goto-char (point-max))
 		 (rmail-summary-goto-msg)))