emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/window.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/window.el
Date: Mon, 23 Nov 2009 05:32:33 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/11/23 05:32:32

Modified files:
        etc            : NEWS 
        lisp           : ChangeLog window.el 

Log message:
        (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.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/etc/NEWS?cvsroot=emacs&r1=1.2120&r2=1.2121
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16704&r2=1.16705
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/window.el?cvsroot=emacs&r1=1.186&r2=1.187

Patches:
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.2120
retrieving revision 1.2121
diff -u -b -r1.2120 -r1.2121
--- etc/NEWS    20 Nov 2009 15:47:26 -0000      1.2120
+++ etc/NEWS    23 Nov 2009 05:32:25 -0000      1.2121
@@ -150,6 +150,9 @@
 ** Completions in the *Completions* buffer are sorted vertically
 when the value of the new variable `completions-format' is `vertical'.
 
+** M-r is bound to the new `move-to-window-line-top-bottom'
+to mirror the new behavior of C-l in Emacs-23.1.
+
 
 * Changes in Specialized Modes and Packages in Emacs 23.2
 

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16704
retrieving revision 1.16705
diff -u -b -r1.16704 -r1.16705
--- lisp/ChangeLog      23 Nov 2009 00:32:37 -0000      1.16704
+++ lisp/ChangeLog      23 Nov 2009 05:32:26 -0000      1.16705
@@ -1,3 +1,9 @@
+2009-11-23  Deniz Dogan  <address@hidden>  (tiny change)
+
+       * window.el (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.
+
 2009-11-23  Sven Joachim  <address@hidden>
 
        * dired-x.el (dired-guess-shell-alist-default):

Index: lisp/window.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/window.el,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -b -r1.186 -r1.187
--- lisp/window.el      19 Nov 2009 22:05:43 -0000      1.186
+++ lisp/window.el      23 Nov 2009 05:32:31 -0000      1.187
@@ -1653,6 +1653,39 @@
 
 (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 no argument, positions point at center of window.
+Successive calls positions 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)
+    (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)
+            (move-to-window-line this-scroll-margin))
+           ((eq move-to-window-line-last-op 'top)
+            (setq move-to-window-line-last-op 'bottom)
+            (move-to-window-line (- -1 this-scroll-margin))))))))
+
+(define-key global-map [?\M-r] 'move-to-window-line-top-bottom)
+
+
 (defvar mouse-autoselect-window-timer nil
   "Timer used by delayed window autoselection.")
 




reply via email to

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