changeset 5275:c2a5a99d89e8

(rmail-summary-goto-msg): Use unwind-protect to go back to summary, and go back to the window that was selected before. (rmail-summary-rmail-update): Special handling for eob.
author Richard M. Stallman <rms@gnu.org>
date Thu, 23 Dec 1993 03:25:40 +0000
parents 89b71a85be3e
children c9578602cc61
files lisp/mail/rmailsum.el
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmailsum.el	Thu Dec 23 03:24:31 1993 +0000
+++ b/lisp/mail/rmailsum.el	Thu Dec 23 03:25:40 1993 +0000
@@ -528,6 +528,9 @@
   (if (get-buffer-window rmail-buffer)
       (let (buffer-read-only)
 	(save-excursion
+	  ;; If at end of buffer, pretend we are on the last text line.
+	  (if (eobp)
+	      (forward-line -1))
 	  (beginning-of-line)
 	  (skip-chars-forward " ")
 	  (let ((beg (point))
@@ -744,9 +747,11 @@
     (beginning-of-line)
     (if skip-rmail
 	nil
-      (pop-to-buffer buf)
-      (rmail-show-message n)
-      (pop-to-buffer rmail-summary-buffer))))
+      (let ((selwin (selected-window)))
+	(unwind-protect
+	    (progn (pop-to-buffer buf)
+		   (rmail-show-message n))
+	  (select-window selwin))))))
 
 (defun rmail-summary-scroll-msg-up (&optional dist)
   "Scroll other window forward."