When using imail-summary-scroll-msg-* commands, if the message buffer
authorChris Hanson <org/chris-hanson/cph>
Sat, 30 Sep 2000 00:29:44 +0000 (00:29 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 30 Sep 2000 00:29:44 +0000 (00:29 +0000)
and summary buffer have different messages selected, change the
message buffer to match the summary buffer.

v7/src/imail/imail-summary.scm

index 23072dab753cfd23a85c967d2aedaf93ac35d525..ffc8134d3b08805aa2f86d475f02b201097e6e8d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-summary.scm,v 1.26 2000/08/07 01:32:25 cph Exp $
+;;; $Id: imail-summary.scm,v 1.27 2000/09/30 00:29:44 cph Exp $
 ;;;
 ;;; Copyright (c) 2000 Massachusetts Institute of Technology
 ;;;
@@ -623,18 +623,22 @@ advance to the next message."
     (if (command-argument-negative-only? argument)
        ((ref-command imail-summary-scroll-msg-down) #f)
        (let ((buffer (imail-folder->buffer (selected-folder) #t)))
-         (let ((windows (buffer-windows buffer)))
-           (if (pair? windows)
-               (let ((window (car windows)))
-                 (if (window-mark-visible? window (buffer-end buffer))
-                     ((ref-command imail-next-message)
-                      (if argument
-                          (command-argument-numeric-value argument)
-                          1))
-                     (scroll-window
-                      window
-                      (standard-scroll-window-argument window argument 1))))
-               ((ref-command imail-summary-beginning-of-message))))))))
+         (if (eq? (selected-message #f) (selected-message #f buffer))
+             (let ((windows (buffer-windows buffer)))
+               (if (pair? windows)
+                   (let ((window (car windows)))
+                     (if (window-mark-visible? window (buffer-end buffer))
+                         ((ref-command imail-next-message)
+                          (if argument
+                              (command-argument-numeric-value argument)
+                              1))
+                         (scroll-window
+                          window
+                          (standard-scroll-window-argument window
+                                                           argument
+                                                           1))))
+                   ((ref-command imail-summary-beginning-of-message))))
+             ((ref-command imail-summary-select-message)))))))
 
 (define-command imail-summary-scroll-msg-down
   "Scroll the IMAIL window backward.
@@ -645,15 +649,19 @@ advance to the previous message."
     (if (command-argument-negative-only? argument)
        ((ref-command imail-summary-scroll-msg-up) #f)
        (let ((buffer (imail-folder->buffer (selected-folder) #t)))
-         (let ((windows (buffer-windows buffer)))
-           (if (pair? windows)
-               (let ((window (car windows)))
-                 (if (window-mark-visible? window (buffer-start buffer))
-                     ((ref-command imail-previous-message)
-                      (if argument
-                          (command-argument-numeric-value argument)
-                          1))
-                     (scroll-window
-                      window
-                      (standard-scroll-window-argument window argument -1))))
-               ((ref-command imail-summary-beginning-of-message))))))))
\ No newline at end of file
+         (if (eq? (selected-message #f) (selected-message #f buffer))
+             (let ((windows (buffer-windows buffer)))
+               (if (pair? windows)
+                   (let ((window (car windows)))
+                     (if (window-mark-visible? window (buffer-start buffer))
+                         ((ref-command imail-previous-message)
+                          (if argument
+                              (command-argument-numeric-value argument)
+                              1))
+                         (scroll-window
+                          window
+                          (standard-scroll-window-argument window
+                                                           argument
+                                                           -1))))
+                   ((ref-command imail-summary-beginning-of-message))))
+             ((ref-command imail-summary-select-message)))))))
\ No newline at end of file