aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-11-20 15:01:14 +0000
committerRichard M. Stallman1994-11-20 15:01:14 +0000
commit3753ab6f45c99d39e3bbc3e0bba61db5cf0368c9 (patch)
treeeac80ce73d70383c24b7f503a663a7238a988a8b
parent081bef73a23a1107958a84321fff74359692e229 (diff)
downloademacs-3753ab6f45c99d39e3bbc3e0bba61db5cf0368c9.tar.gz
emacs-3753ab6f45c99d39e3bbc3e0bba61db5cf0368c9.zip
(rmail-summary-scroll-msg-up): If at end of message,
advance to the next message. (rmail-summary-scroll-msg-down): If at beginning of message, advance to the previous message.
-rw-r--r--lisp/mail/rmailsum.el57
1 files changed, 45 insertions, 12 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index c982c058c78..e2c684d85bd 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -864,22 +864,55 @@ Commands for sorting the summary:
864 (set-buffer obuf)))))) 864 (set-buffer obuf))))))
865 865
866(defun rmail-summary-scroll-msg-up (&optional dist) 866(defun rmail-summary-scroll-msg-up (&optional dist)
867 "Scroll the Rmail window forward." 867 "Scroll the Rmail window forward.
868If the Rmail window is displaying the end of a message,
869advance to the next message."
868 (interactive "P") 870 (interactive "P")
869 (let ((other-window-scroll-buffer rmail-buffer)) 871 (if (eq dist '-)
870 (if (get-buffer-window rmail-buffer) 872 (rmail-summary-scroll-msg-down nil)
871 (scroll-other-window dist) 873 (let ((rmail-buffer-window (get-buffer-window rmail-buffer)))
872 ;; This forces rmail-buffer to be sized correctly later. 874 (if rmail-buffer-window
873 (display-buffer rmail-buffer) 875 (if (let ((rmail-summary-window (selected-window)))
874 (setq rmail-current-message nil)))) 876 (select-window rmail-buffer-window)
877 (prog1
878 ;; Is EOB visible in the buffer?
879 (save-excursion
880 (let ((ht (window-height (selected-window))))
881 (move-to-window-line (- ht 2))
882 (end-of-line)
883 (eobp)))
884 (select-window rmail-summary-window)))
885 (rmail-summary-next-msg (or dist 1))
886 (let ((other-window-scroll-buffer rmail-buffer))
887 (scroll-other-window dist)))
888 ;; This forces rmail-buffer to be sized correctly later.
889 (display-buffer rmail-buffer)
890 (setq rmail-current-message nil)))))
875 891
876(defun rmail-summary-scroll-msg-down (&optional dist) 892(defun rmail-summary-scroll-msg-down (&optional dist)
877 "Scroll the Rmail window backward." 893 "Scroll the Rmail window backward.
894If the Rmail window is displaying the beginning of a message,
895advance to the previous message."
878 (interactive "P") 896 (interactive "P")
879 (rmail-summary-scroll-msg-up 897 (if (eq dist '-)
880 (cond ((eq dist '-) nil) 898 (rmail-summary-scroll-msg-up nil)
881 ((null dist) '-) 899 (let ((rmail-buffer-window (get-buffer-window rmail-buffer)))
882 (t (- (prefix-numeric-value dist)))))) 900 (if rmail-buffer-window
901 (if (let ((rmail-summary-window (selected-window)))
902 (select-window rmail-buffer-window)
903 (prog1
904 ;; Is BOB visible in the buffer?
905 (save-excursion
906 (move-to-window-line 0)
907 (beginning-of-line)
908 (bobp))
909 (select-window rmail-summary-window)))
910 (rmail-summary-previous-msg (or dist 1))
911 (let ((other-window-scroll-buffer rmail-buffer))
912 (scroll-other-window-down dist)))
913 ;; This forces rmail-buffer to be sized correctly later.
914 (display-buffer rmail-buffer)
915 (setq rmail-current-message nil)))))
883 916
884(defun rmail-summary-beginning-of-message () 917(defun rmail-summary-beginning-of-message ()
885 "Show current message from the beginning." 918 "Show current message from the beginning."