aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-11-23 05:37:34 +0000
committerStefan Monnier2009-11-23 05:37:34 +0000
commit0f202d5d8fa1f0dea9c1e5e52e6ad66e4848aa75 (patch)
treecebdcef654872f0448813243de6ad5dcbd0850ff
parent216349f89edbd3476f04fc971ab545cea6239ee6 (diff)
downloademacs-0f202d5d8fa1f0dea9c1e5e52e6ad66e4848aa75.tar.gz
emacs-0f202d5d8fa1f0dea9c1e5e52e6ad66e4848aa75.zip
(move-to-window-line-last-op): Remove.
(move-to-window-line-top-bottom): Reuse recenter-last-op instead.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/window.el20
2 files changed, 14 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 70a183b7764..e4b109fc650 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,11 @@
12009-11-23 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * window.el (move-to-window-line-last-op): Remove.
4 (move-to-window-line-top-bottom): Reuse recenter-last-op instead.
5
12009-11-23 Deniz Dogan <deniz.a.m.dogan@gmail.com> (tiny change) 62009-11-23 Deniz Dogan <deniz.a.m.dogan@gmail.com> (tiny change)
2 7
8 Make M-r mirror the new cycling behavior of C-l.
3 * window.el (move-to-window-line-last-op): New var. 9 * window.el (move-to-window-line-last-op): New var.
4 (move-to-window-line-top-bottom): New command. 10 (move-to-window-line-top-bottom): New command.
5 (global-map): Bind M-r move-to-window-line-top-bottom. 11 (global-map): Bind M-r move-to-window-line-top-bottom.
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
1653 1653
1654(define-key global-map [?\C-l] 'recenter-top-bottom) 1654(define-key global-map [?\C-l] 'recenter-top-bottom)
1655 1655
1656(defvar move-to-window-line-last-op nil
1657 "Indicates the last move-to-window-line operation performed.
1658Possible values: `top', `middle', `bottom'.")
1659
1660(defun move-to-window-line-top-bottom (&optional arg) 1656(defun move-to-window-line-top-bottom (&optional arg)
1661 "Position point relative to window. 1657 "Position point relative to window.
1662 1658
1663With an argument, acts like `move-to-window-line'. 1659With a prefix argument ARG, acts like `move-to-window-line'.
1664 1660
1665With no argument, positions point at center of window. 1661With no argument, positions point at center of window.
1666Successive calls positions point at the top, the bottom and again 1662Successive calls position point at the top, the bottom and again
1667at the center of the window." 1663at the center of the window."
1668 (interactive "P") 1664 (interactive "P")
1669 (cond 1665 (cond
1670 (arg (move-to-window-line arg)) ; Always respect ARG. 1666 (arg (move-to-window-line arg)) ; Always respect ARG.
1671 ((or (not (eq this-command last-command)) 1667 ((or (not (eq this-command last-command))
1672 (eq move-to-window-line-last-op 'bottom)) 1668 (eq recenter-last-op 'bottom))
1673 (setq move-to-window-line-last-op 'middle) 1669 (setq recenter-last-op 'middle)
1674 (call-interactively 'move-to-window-line)) 1670 (call-interactively 'move-to-window-line))
1675 (t 1671 (t
1676 (let ((this-scroll-margin 1672 (let ((this-scroll-margin
1677 (min (max 0 scroll-margin) 1673 (min (max 0 scroll-margin)
1678 (truncate (/ (window-body-height) 4.0))))) 1674 (truncate (/ (window-body-height) 4.0)))))
1679 (cond ((eq move-to-window-line-last-op 'middle) 1675 (cond ((eq recenter-last-op 'middle)
1680 (setq move-to-window-line-last-op 'top) 1676 (setq recenter-last-op 'top)
1681 (move-to-window-line this-scroll-margin)) 1677 (move-to-window-line this-scroll-margin))
1682 ((eq move-to-window-line-last-op 'top) 1678 ((eq recenter-last-op 'top)
1683 (setq move-to-window-line-last-op 'bottom) 1679 (setq recenter-last-op 'bottom)
1684 (move-to-window-line (- -1 this-scroll-margin)))))))) 1680 (move-to-window-line (- -1 this-scroll-margin))))))))
1685 1681
1686(define-key global-map [?\M-r] 'move-to-window-line-top-bottom) 1682(define-key global-map [?\M-r] 'move-to-window-line-top-bottom)