summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-11-23 05:37:34 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-11-23 05:37:34 +0000
commit0f202d5d8fa1f0dea9c1e5e52e6ad66e4848aa75 (patch)
treecebdcef654872f0448813243de6ad5dcbd0850ff /lisp/window.el
parent216349f89edbd3476f04fc971ab545cea6239ee6 (diff)
downloademacs-0f202d5d8fa1f0dea9c1e5e52e6ad66e4848aa75.tar.gz
(move-to-window-line-last-op): Remove.
(move-to-window-line-top-bottom): Reuse recenter-last-op instead.
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el20
1 files changed, 8 insertions, 12 deletions
diff --git a/lisp/window.el b/lisp/window.el
index e93d3a55d26..4a226df7b20 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1653,34 +1653,30 @@ Top and bottom destinations are actually `scroll-margin' lines
(define-key global-map [?\C-l] 'recenter-top-bottom)
-(defvar move-to-window-line-last-op nil
- "Indicates the last move-to-window-line operation performed.
-Possible values: `top', `middle', `bottom'.")
-
(defun move-to-window-line-top-bottom (&optional arg)
"Position point relative to window.
-With an argument, acts like `move-to-window-line'.
+With a prefix argument ARG, acts like `move-to-window-line'.
With no argument, positions point at center of window.
-Successive calls positions point at the top, the bottom and again
+Successive calls position point at the top, the bottom and again
at the center of the window."
(interactive "P")
(cond
(arg (move-to-window-line arg)) ; Always respect ARG.
((or (not (eq this-command last-command))
- (eq move-to-window-line-last-op 'bottom))
- (setq move-to-window-line-last-op 'middle)
+ (eq recenter-last-op 'bottom))
+ (setq recenter-last-op 'middle)
(call-interactively 'move-to-window-line))
(t
(let ((this-scroll-margin
(min (max 0 scroll-margin)
(truncate (/ (window-body-height) 4.0)))))
- (cond ((eq move-to-window-line-last-op 'middle)
- (setq move-to-window-line-last-op 'top)
+ (cond ((eq recenter-last-op 'middle)
+ (setq recenter-last-op 'top)
(move-to-window-line this-scroll-margin))
- ((eq move-to-window-line-last-op 'top)
- (setq move-to-window-line-last-op 'bottom)
+ ((eq recenter-last-op 'top)
+ (setq recenter-last-op 'bottom)
(move-to-window-line (- -1 this-scroll-margin))))))))
(define-key global-map [?\M-r] 'move-to-window-line-top-bottom)