]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-summary-rmail-update): Update rmail buffer even if it isn't displayed.
authorKarl Heuer <kwzh@gnu.org>
Tue, 19 Apr 1994 03:41:23 +0000 (03:41 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 19 Apr 1994 03:41:23 +0000 (03:41 +0000)
lisp/mail/rmailsum.el

index 19f72b00a1f30f1b5c13e6313cbe03292dab3430..2a80ff4469cfa4e43d0e749df8781e8a6d3afe11 100644 (file)
@@ -548,34 +548,36 @@ Commands for sorting the summary:
 ;; but only if the Rmail buffer is already visible.
 ;; This is a post-command-hook in summary buffers.
 (defun rmail-summary-rmail-update ()
-  (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))
-               msg-num
-               (buf rmail-buffer))
-           (skip-chars-forward "0-9")
-           (setq msg-num (string-to-int (buffer-substring beg (point))))
-           (or (eq rmail-current-message msg-num)
-               (let (go-where window (owin (selected-window)))
-                 (setq rmail-current-message msg-num)
-                 (if (= (following-char) ?-)
-                     (progn
-                       (delete-char 1)
-                       (insert " ")))
-                 (setq window (display-buffer rmail-buffer))
-                 ;; Using save-window-excursion caused the new value
+  (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 ((msg-num (string-to-int (buffer-substring
+                                    (point)
+                                    (progn (skip-chars-forward "0-9")
+                                           (point))))))
+       (or (eq rmail-current-message msg-num)
+           (let ((window (get-buffer-window rmail-buffer))
+                 (owin (selected-window)))
+             (setq rmail-current-message msg-num)
+             (if (= (following-char) ?-)
+                 (progn
+                   (delete-char 1)
+                   (insert " ")))
+             (if window
+                 ;; Using save-window-excursion would cause the new value
                  ;; of point to get lost.
                  (unwind-protect
                      (progn
                        (select-window window)
                        (rmail-show-message msg-num))
-                   (select-window owin)))))))))
+                   (select-window owin))
+               (save-excursion
+                 (set-buffer rmail-buffer)
+                 (rmail-show-message msg-num)))))))))
 \f
 (defvar rmail-summary-mode-map nil)