Mercurial > emacs
changeset 18279:a9c40a80c9b1
(split-window-save-restore-data): New function that
for view mode buffers saves information in view-return-to-alist.
(split-window-vertically, split-window-horizontally):
Call split-window-save-restore-data.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 17 Jun 1997 05:10:06 +0000 |
parents | 4f78346eb734 |
children | f693db11df45 |
files | lisp/window.el |
diffstat | 1 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/window.el Tue Jun 17 04:28:01 1997 +0000 +++ b/lisp/window.el Tue Jun 17 05:10:06 1997 +0000 @@ -196,6 +196,16 @@ (progn (set-window-point new-w old-point) (select-window new-w))))) + (split-window-save-restore-data new-w old-w))) + +(defun split-window-save-restore-data (new-w old-w) + (save-excursion + (set-buffer (window-buffer)) + (if view-mode + (let ((old-info (assq old-w view-return-to-alist))) + (setq view-return-to-alist + (cons (cons new-w (cons (and old-info (car (cdr old-info))) t)) + view-return-to-alist)))) new-w)) (defun split-window-horizontally (&optional arg) @@ -204,10 +214,11 @@ Negative arg means select the size of the rightmost window instead. No arg means split equally." (interactive "P") - (let ((size (and arg (prefix-numeric-value arg)))) + (let ((old-w (selected-window)) + (size (and arg (prefix-numeric-value arg)))) (and size (< size 0) (setq size (+ (window-width) size))) - (split-window nil size t))) + (split-window-save-restore-data (split-window nil size t) old-w))) (defun enlarge-window-horizontally (arg) "Make current window ARG columns wider."