diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-06-25 18:58:42 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-06-25 18:58:42 +0000 |
commit | 3aef9604ce850fbbe44374835ebb4ad05b52a780 (patch) | |
tree | 4386004fe29aeb1a0df8102e0e103cc396c34ca0 /lisp/simple.el | |
parent | 2ffa6186965c268f10f8132423a5c32c06e79b53 (diff) | |
download | emacs-3aef9604ce850fbbe44374835ebb4ad05b52a780.tar.gz |
(beginning-of-buffer-other-window)
(end-of-buffer-other-window): New functions.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r-- | lisp/simple.el | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 65742b68c6f..f87016aa4f7 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1705,6 +1705,39 @@ If this is zero, point is always centered after it moves off frame.") (if (eq lines '-) nil (if (null lines) '- (- (prefix-numeric-value lines)))))) + +(defun beginning-of-buffer-other-window (arg) + "Move point to the beginning of the buffer in the other window. +Leave mark at previous position. +With arg N, put point N/10 of the way from the true beginning." + (interactive "P") + (let ((orig-window (selected-window)) + (window (other-window-for-scrolling))) + ;; We use unwind-protect rather than save-window-excursion + ;; because the latter would preserve the things we want to change. + (unwind-protect + (progn + (select-window window) + ;; Set point and mark in that window's buffer. + (beginning-of-buffer arg) + ;; Set point accordingly. + (recenter '(t))) + (select-window orig-window)))) + +(defun end-of-buffer-other-window (arg) + "Move point to the end of the buffer in the other window. +Leave mark at previous position. +With arg N, put point N/10 of the way from the true end." + (interactive "P") + ;; See beginning-of-buffer-other-window for comments. + (let ((orig-window (selected-window)) + (window (other-window-for-scrolling))) + (unwind-protect + (progn + (select-window window) + (beginning-of-buffer arg) + (recenter '(t))) + (select-window orig-window)))) (defun transpose-chars (arg) "Interchange characters around point, moving forward one character. |