]> git.eshelyaron.com Git - emacs.git/commitdiff
(rmail-toggle-header): Use a window which is showing the Rmail buffer,
authorRichard M. Stallman <rms@gnu.org>
Wed, 7 Mar 2001 23:05:02 +0000 (23:05 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 7 Mar 2001 23:05:02 +0000 (23:05 +0000)
rather than the selected window.

lisp/ChangeLog
lisp/mail/rmail.el

index d31f04579ff0e0ee7ae12fff1c3590603aec90c3..7769ad1a7015c22f39b8e662705b796108d6e1c2 100644 (file)
@@ -1,5 +1,7 @@
 2001-03-07  Richard M. Stallman  <rms@gnu.org>
 
+       * info.el (Info-scroll-down): Fix previous change.
+
        * mail/rmail.el (rmail-toggle-header): Use a window which
        is showing the Rmail buffer, rather than the selected window.
 
index 4909a4cb956d7152965662f148a08eecb4cb4fc0..36a957e36371d8ce8c5d53c4ca0b9f0bb6cc94d5 100644 (file)
@@ -1883,15 +1883,17 @@ otherwise, show it in full."
     (if (eq pruned prune)
        t
       (rmail-maybe-set-message-counters)
-      (let ((at-point-min (= (point) (point-min)))
-            (all-headers-visible (= (window-start) (point-min)))
-            (on-header (save-excursion
-                         (and (not (search-backward "\n\n" nil t))
-                              (progn
-                                (end-of-line)
-                                (re-search-backward "^[-A-Za-z0-9]+:" nil t))
-                              (match-string 0))))
-            (old-screen-line (rmail-count-screen-lines (window-start) (point))))
+      (let* ((window (get-buffer-window (current-buffer)))
+            (at-point-min (= (point) (point-min)))
+            (all-headers-visible (= (window-start window) (point-min)))
+            (on-header (save-excursion
+                         (and (not (search-backward "\n\n" nil t))
+                              (progn
+                                (end-of-line)
+                                (re-search-backward "^[-A-Za-z0-9]+:" nil t))
+                              (match-string 0))))
+            (old-screen-line
+             (rmail-count-screen-lines (window-start window) (point))))
         (save-excursion
          (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max))
          (if pruned
@@ -1926,14 +1928,17 @@ otherwise, show it in full."
               (or (re-search-backward (concat "^" (regexp-quote on-header)) nil t)
                   (goto-char (point-min))))
              (t
-              (recenter old-screen-line)
-              (if (and all-headers-visible
-                       (not (= (window-start) (point-min))))
-                  (let ((lines-offscreen (rmail-count-screen-lines
-                                          (point-min) (window-start))))
-                    (recenter (min (+ old-screen-line lines-offscreen)
-                                   ;; last line of window
-                                   (- (window-height) 2))))))))
+              (save-selected-window
+                (select-window window)
+                (recenter old-screen-line)
+                (if (and all-headers-visible
+                         (not (= (window-start) (point-min))))
+                    (let ((lines-offscreen (rmail-count-screen-lines
+                                            (point-min)
+                                            (window-start window))))
+                      (recenter (min (+ old-screen-line lines-offscreen)
+                                     ;; last line of window
+                                     (- (window-height) 2))))))))))
       (rmail-highlight-headers))))
 
 ;; Lifted from repos-count-screen-lines.