diff options
| author | Richard M. Stallman | 1997-06-17 05:10:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-17 05:10:06 +0000 |
| commit | c361280d2cf113f957d42044fd6c5be93b14f5ec (patch) | |
| tree | d214190a9dbc568fca4f5c796e20345d0113df2d /lisp | |
| parent | 36570c928fef3913e524f2ff0899d244ed7ca0ea (diff) | |
| download | emacs-c361280d2cf113f957d42044fd6c5be93b14f5ec.tar.gz emacs-c361280d2cf113f957d42044fd6c5be93b14f5ec.zip | |
(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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/window.el | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/window.el b/lisp/window.el index 5be9f870b9d..a47a1eaac0b 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -196,6 +196,16 @@ new mode line." | |||
| 196 | (progn | 196 | (progn |
| 197 | (set-window-point new-w old-point) | 197 | (set-window-point new-w old-point) |
| 198 | (select-window new-w))))) | 198 | (select-window new-w))))) |
| 199 | (split-window-save-restore-data new-w old-w))) | ||
| 200 | |||
| 201 | (defun split-window-save-restore-data (new-w old-w) | ||
| 202 | (save-excursion | ||
| 203 | (set-buffer (window-buffer)) | ||
| 204 | (if view-mode | ||
| 205 | (let ((old-info (assq old-w view-return-to-alist))) | ||
| 206 | (setq view-return-to-alist | ||
| 207 | (cons (cons new-w (cons (and old-info (car (cdr old-info))) t)) | ||
| 208 | view-return-to-alist)))) | ||
| 199 | new-w)) | 209 | new-w)) |
| 200 | 210 | ||
| 201 | (defun split-window-horizontally (&optional arg) | 211 | (defun split-window-horizontally (&optional arg) |
| @@ -204,10 +214,11 @@ This window becomes the leftmost of the two, and gets ARG columns. | |||
| 204 | Negative arg means select the size of the rightmost window instead. | 214 | Negative arg means select the size of the rightmost window instead. |
| 205 | No arg means split equally." | 215 | No arg means split equally." |
| 206 | (interactive "P") | 216 | (interactive "P") |
| 207 | (let ((size (and arg (prefix-numeric-value arg)))) | 217 | (let ((old-w (selected-window)) |
| 218 | (size (and arg (prefix-numeric-value arg)))) | ||
| 208 | (and size (< size 0) | 219 | (and size (< size 0) |
| 209 | (setq size (+ (window-width) size))) | 220 | (setq size (+ (window-width) size))) |
| 210 | (split-window nil size t))) | 221 | (split-window-save-restore-data (split-window nil size t) old-w))) |
| 211 | 222 | ||
| 212 | (defun enlarge-window-horizontally (arg) | 223 | (defun enlarge-window-horizontally (arg) |
| 213 | "Make current window ARG columns wider." | 224 | "Make current window ARG columns wider." |