emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/window.el,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/window.el,v
Date: Mon, 18 Aug 2008 03:46:52 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/08/18 03:46:52

Index: window.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/window.el,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -b -r1.145 -r1.146
--- window.el   10 Jul 2008 04:27:32 -0000      1.145
+++ window.el   18 Aug 2008 03:46:51 -0000      1.146
@@ -1436,26 +1436,25 @@
 
 The cycling order is: middle -> top -> bottom.
 
-Top and bottom destinations are actually `scroll-conservatively' lines
-from true window top and bottom."
+Top and bottom destinations are actually `scroll-margin' lines
+the from true window top and bottom."
   (interactive "P")
   (cond
    (arg (recenter arg))                 ; Always respect ARG.
-   ((not (eq this-command last-command))
-    ;; First time - save mode and recenter.
+   ((or (not (eq this-command last-command))
+       (eq recenter-last-op 'bottom))
     (setq recenter-last-op 'middle)
     (recenter))
-   (t ;; repeat: loop through various options.
-    (setq recenter-last-op
+   (t
+    (let ((this-scroll-margin
+          (min (max 0 scroll-margin)
+               (truncate (/ (window-body-height) 4.0)))))
          (cond ((eq recenter-last-op 'middle)
-                (recenter scroll-conservatively)
-                'top)
+            (setq recenter-last-op 'top)
+            (recenter this-scroll-margin))
                ((eq recenter-last-op 'top)
-                (recenter (1- (- scroll-conservatively)))
-                'bottom)
-               ((eq recenter-last-op 'bottom)
-                (recenter)
-                'middle))))))
+            (setq recenter-last-op 'bottom)
+            (recenter (- -1 this-scroll-margin))))))))
 
 (define-key global-map [?\C-l] 'recenter-top-bottom)
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]