comparison lisp/mail/rmailsum.el @ 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 02bee4d2de9a
children 138d99e53e94
comparison
equal deleted inserted replaced
9351:e3303c64b684 9352:f10a1492ecfa
784 (defun rmail-summary-goto-msg (&optional n nowarn skip-rmail) 784 (defun rmail-summary-goto-msg (&optional n nowarn skip-rmail)
785 (interactive "P") 785 (interactive "P")
786 (if (consp n) (setq n (prefix-numeric-value n))) 786 (if (consp n) (setq n (prefix-numeric-value n)))
787 (if (eobp) (forward-line -1)) 787 (if (eobp) (forward-line -1))
788 (beginning-of-line) 788 (beginning-of-line)
789 (let ((obuf (current-buffer)) 789 (let* ((obuf (current-buffer))
790 (buf rmail-buffer) 790 (buf rmail-buffer)
791 (cur (point)) 791 (cur (point))
792 message-not-found 792 message-not-found
793 (curmsg (string-to-int 793 (curmsg (string-to-int
794 (buffer-substring (point) 794 (buffer-substring (point)
795 (min (point-max) (+ 5 (point))))))) 795 (min (point-max) (+ 5 (point))))))
796 (total (save-excursion (set-buffer buf) rmail-total-messages)))
796 ;; If message number N was specified, find that message's line 797 ;; If message number N was specified, find that message's line
797 ;; or set message-not-found. 798 ;; or set message-not-found.
798 ;; If N wasn't specified or that message can't be found. 799 ;; If N wasn't specified or that message can't be found.
799 ;; set N by default. 800 ;; set N by default.
800 (if (not n) 801 (if (not n)
801 (setq n curmsg) 802 (setq n curmsg)
802 (if (< n 1) 803 (if (< n 1)
803 (progn (message "No preceding message") 804 (progn (message "No preceding message")
804 (setq n 1))) 805 (setq n 1)))
805 (if (> n rmail-total-messages) 806 (if (> n total)
806 (progn (message "No following message") 807 (progn (message "No following message")
807 (goto-char (point-max)) 808 (goto-char (point-max))
808 (rmail-summary-goto-msg))) 809 (rmail-summary-goto-msg)))
809 (goto-char (point-min)) 810 (goto-char (point-min))
810 (if (not (re-search-forward (format "^%4d[^0-9]" n) nil t)) 811 (if (not (re-search-forward (format "^%4d[^0-9]" n) nil t))