diff options
| author | Stefan Monnier | 2009-11-23 05:37:34 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-11-23 05:37:34 +0000 |
| commit | 0f202d5d8fa1f0dea9c1e5e52e6ad66e4848aa75 (patch) | |
| tree | cebdcef654872f0448813243de6ad5dcbd0850ff | |
| parent | 216349f89edbd3476f04fc971ab545cea6239ee6 (diff) | |
| download | emacs-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/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/window.el | 20 |
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 @@ | |||
| 1 | 2009-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 | |||
| 1 | 2009-11-23 Deniz Dogan <deniz.a.m.dogan@gmail.com> (tiny change) | 6 | 2009-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. | ||
| 1658 | Possible 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 | ||
| 1663 | With an argument, acts like `move-to-window-line'. | 1659 | With a prefix argument ARG, acts like `move-to-window-line'. |
| 1664 | 1660 | ||
| 1665 | With no argument, positions point at center of window. | 1661 | With no argument, positions point at center of window. |
| 1666 | Successive calls positions point at the top, the bottom and again | 1662 | Successive calls position point at the top, the bottom and again |
| 1667 | at the center of the window." | 1663 | at 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) |