Sync up with semi-1_13.
authoryamaoka <yamaoka>
Tue, 5 Oct 1999 04:25:01 +0000 (04:25 +0000)
committeryamaoka <yamaoka>
Tue, 5 Oct 1999 04:25:01 +0000 (04:25 +0000)
ChangeLog
mime-view.el

index f2766a3..b506a49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+1999-10-05  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+       * mime-view.el (mime-preview-scroll-down-entity,
+       mime-preview-scroll-up-entity): Recenter when moving to
+       a next entity.
+       (mime-preview-move-scroll): New variable.
+       (mime-preview-move-to-previous, mime-preview-move-to-next):
+       Recenter according to the variable mime-preview-move-scroll.
+
 1999-10-04  Katsumi Yamaoka   <yamaoka@jpl.org>
 
        * mime-view.el (mime-preview-move-to-next): Attempt to go to the
index 8e8a1c6..bc6dc7a 100644 (file)
   :group 'mime-view
   :type 'file)
 
+(defcustom mime-preview-move-scroll nil
+  "*Decides whether to scroll when moving to next entity.
+When t, scroll the buffer. Non-nil but not t means scroll when
+the next entity is within next-screen-context-lines from top or
+buttom. Nil means don't scroll at all."
+  :group 'mime-view
+  :type '(choice (const :tag "Off" nil)
+                (const :tag "On" t)
+                (sexp :tag "Situation" 1)))
 
 ;;; @ in raw-buffer (representation space)
 ;;;
@@ -1299,7 +1308,17 @@ variable `mime-preview-over-to-previous-method-alist'."
     (if (and point
             (>= point (point-min)))
        (if (get-text-property (1- point) 'mime-view-entity)
-           (goto-char point)
+           (progn (goto-char point)
+                  (if
+                   (or (eq mime-preview-move-scroll t)
+                       (and mime-preview-move-scroll
+                            (<= point
+                               (save-excursion
+                                 (move-to-window-line 0)
+                                 (forward-line next-screen-context-lines)
+                                 (end-of-line)
+                                 (point)))))
+                       (recenter (* -1 next-screen-context-lines))))
          (goto-char (1- point))
          (mime-preview-move-to-previous)
          )
@@ -1326,6 +1345,17 @@ variable `mime-preview-over-to-next-method-alist'."
          (goto-char point)
          (if (null (get-text-property point 'mime-view-entity))
              (mime-preview-move-to-next)
+           (and
+            (or (eq mime-preview-move-scroll t)
+                (and mime-preview-move-scroll
+                     (>= point
+                        (save-excursion
+                          (move-to-window-line -1)
+                          (forward-line
+                           (* -1 next-screen-context-lines))
+                          (beginning-of-line)
+                          (point)))))
+                (recenter next-screen-context-lines))
            ))
       (let ((f (assq (mime-preview-original-major-mode)
                     mime-preview-over-to-next-method-alist)))
@@ -1351,7 +1381,8 @@ If reached to (point-max), it calls function registered in variable
          (bottom (window-end (selected-window))))
       (if (and (not h)
               (> bottom point))
-         (goto-char point)
+         (progn (goto-char point)
+                (recenter next-screen-context-lines))
        (condition-case nil
            (scroll-up h)
          (end-of-buffer
@@ -1375,7 +1406,8 @@ If reached to (point-min), it calls function registered in variable
          (top (window-start (selected-window))))
       (if (and (not h)
               (< top point))
-         (goto-char point)
+         (progn (goto-char point)
+                (recenter (* -1 next-screen-context-lines)))
        (condition-case nil
            (scroll-down h)
          (beginning-of-buffer