diff options
| author | Stefan Monnier | 2009-11-23 05:32:25 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-11-23 05:32:25 +0000 |
| commit | 216349f89edbd3476f04fc971ab545cea6239ee6 (patch) | |
| tree | 972a3f5b90bbb91e1dc8632dfabfed6ae0526775 | |
| parent | c10e06335efc44a628996547291c7b82b7ffe17a (diff) | |
| download | emacs-216349f89edbd3476f04fc971ab545cea6239ee6.tar.gz emacs-216349f89edbd3476f04fc971ab545cea6239ee6.zip | |
(move-to-window-line-last-op): New var.
(move-to-window-line-top-bottom): New command.
(global-map): Bind M-r move-to-window-line-top-bottom.
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/window.el | 33 |
3 files changed, 42 insertions, 0 deletions
| @@ -150,6 +150,9 @@ For instance, this can complete M-x lch to list-command-history. | |||
| 150 | ** Completions in the *Completions* buffer are sorted vertically | 150 | ** Completions in the *Completions* buffer are sorted vertically |
| 151 | when the value of the new variable `completions-format' is `vertical'. | 151 | when the value of the new variable `completions-format' is `vertical'. |
| 152 | 152 | ||
| 153 | ** M-r is bound to the new `move-to-window-line-top-bottom' | ||
| 154 | to mirror the new behavior of C-l in Emacs-23.1. | ||
| 155 | |||
| 153 | 156 | ||
| 154 | * Changes in Specialized Modes and Packages in Emacs 23.2 | 157 | * Changes in Specialized Modes and Packages in Emacs 23.2 |
| 155 | 158 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 797e258b339..70a183b7764 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-11-23 Deniz Dogan <deniz.a.m.dogan@gmail.com> (tiny change) | ||
| 2 | |||
| 3 | * window.el (move-to-window-line-last-op): New var. | ||
| 4 | (move-to-window-line-top-bottom): New command. | ||
| 5 | (global-map): Bind M-r move-to-window-line-top-bottom. | ||
| 6 | |||
| 1 | 2009-11-23 Sven Joachim <svenjoac@gmx.de> | 7 | 2009-11-23 Sven Joachim <svenjoac@gmx.de> |
| 2 | 8 | ||
| 3 | * dired-x.el (dired-guess-shell-alist-default): | 9 | * dired-x.el (dired-guess-shell-alist-default): |
diff --git a/lisp/window.el b/lisp/window.el index 6d32e42ef1d..e93d3a55d26 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -1652,6 +1652,39 @@ Top and bottom destinations are actually `scroll-margin' lines | |||
| 1652 | (recenter (- -1 this-scroll-margin)))))))) | 1652 | (recenter (- -1 this-scroll-margin)))))))) |
| 1653 | 1653 | ||
| 1654 | (define-key global-map [?\C-l] 'recenter-top-bottom) | 1654 | (define-key global-map [?\C-l] 'recenter-top-bottom) |
| 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) | ||
| 1661 | "Position point relative to window. | ||
| 1662 | |||
| 1663 | With an argument, acts like `move-to-window-line'. | ||
| 1664 | |||
| 1665 | With no argument, positions point at center of window. | ||
| 1666 | Successive calls positions point at the top, the bottom and again | ||
| 1667 | at the center of the window." | ||
| 1668 | (interactive "P") | ||
| 1669 | (cond | ||
| 1670 | (arg (move-to-window-line arg)) ; Always respect ARG. | ||
| 1671 | ((or (not (eq this-command last-command)) | ||
| 1672 | (eq move-to-window-line-last-op 'bottom)) | ||
| 1673 | (setq move-to-window-line-last-op 'middle) | ||
| 1674 | (call-interactively 'move-to-window-line)) | ||
| 1675 | (t | ||
| 1676 | (let ((this-scroll-margin | ||
| 1677 | (min (max 0 scroll-margin) | ||
| 1678 | (truncate (/ (window-body-height) 4.0))))) | ||
| 1679 | (cond ((eq move-to-window-line-last-op 'middle) | ||
| 1680 | (setq move-to-window-line-last-op 'top) | ||
| 1681 | (move-to-window-line this-scroll-margin)) | ||
| 1682 | ((eq move-to-window-line-last-op 'top) | ||
| 1683 | (setq move-to-window-line-last-op 'bottom) | ||
| 1684 | (move-to-window-line (- -1 this-scroll-margin)))))))) | ||
| 1685 | |||
| 1686 | (define-key global-map [?\M-r] 'move-to-window-line-top-bottom) | ||
| 1687 | |||
| 1655 | 1688 | ||
| 1656 | (defvar mouse-autoselect-window-timer nil | 1689 | (defvar mouse-autoselect-window-timer nil |
| 1657 | "Timer used by delayed window autoselection.") | 1690 | "Timer used by delayed window autoselection.") |