diff options
| author | Martin Rudalics | 2014-02-19 10:54:35 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-02-19 10:54:35 +0100 |
| commit | 8e009b788144d2a3a4a628e32d812718dee98109 (patch) | |
| tree | edd92cc0583e537be60aafda5ba36f00e9b9ce4d | |
| parent | 95160c901a9bc780f30982002b9fcded5b436308 (diff) | |
| download | emacs-8e009b788144d2a3a4a628e32d812718dee98109.tar.gz emacs-8e009b788144d2a3a4a628e32d812718dee98109.zip | |
In window-state-put allow WINDOW to refer to an internal window (Bug#16793).
* window.el (window-state-put): Allow WINDOW to refer to an
internal window (Bug#16793).
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/window.el | 22 |
2 files changed, 25 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4827fedace1..27c681bd945 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-02-19 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (window-state-put): Allow WINDOW to refer to an | ||
| 4 | internal window (Bug#16793). | ||
| 5 | |||
| 1 | 2014-02-19 Glenn Morris <rgm@gnu.org> | 6 | 2014-02-19 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * textmodes/remember.el: Move provide statement to end. | 8 | * textmodes/remember.el: Move provide statement to end. |
diff --git a/lisp/window.el b/lisp/window.el index fab96cbabd5..c4854f02399 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -5026,14 +5026,32 @@ value can be also stored on disk and read back in a new session." | |||
| 5026 | "Put window state STATE into WINDOW. | 5026 | "Put window state STATE into WINDOW. |
| 5027 | STATE should be the state of a window returned by an earlier | 5027 | STATE should be the state of a window returned by an earlier |
| 5028 | invocation of `window-state-get'. Optional argument WINDOW must | 5028 | invocation of `window-state-get'. Optional argument WINDOW must |
| 5029 | specify a live window and defaults to the selected one. | 5029 | specify a valid window and defaults to the selected one. If |
| 5030 | WINDOW is not live, replace WINDOW by a live one before putting | ||
| 5031 | STATE into it. | ||
| 5030 | 5032 | ||
| 5031 | Optional argument IGNORE non-nil means ignore minimum window | 5033 | Optional argument IGNORE non-nil means ignore minimum window |
| 5032 | sizes and fixed size restrictions. IGNORE equal `safe' means | 5034 | sizes and fixed size restrictions. IGNORE equal `safe' means |
| 5033 | windows can get as small as `window-safe-min-height' and | 5035 | windows can get as small as `window-safe-min-height' and |
| 5034 | `window-safe-min-width'." | 5036 | `window-safe-min-width'." |
| 5035 | (setq window-state-put-stale-windows nil) | 5037 | (setq window-state-put-stale-windows nil) |
| 5036 | (setq window (window-normalize-window window t)) | 5038 | (setq window (window-normalize-window window)) |
| 5039 | |||
| 5040 | ;; When WINDOW is internal, reduce it to a live one to put STATE into, | ||
| 5041 | ;; see Bug#16793. | ||
| 5042 | (unless (window-live-p window) | ||
| 5043 | (let ((root (frame-root-window window))) | ||
| 5044 | (if (eq window root) | ||
| 5045 | (setq window (frame-first-window root)) | ||
| 5046 | (setq root window) | ||
| 5047 | (setq window (catch 'live | ||
| 5048 | (walk-window-subtree | ||
| 5049 | (lambda (window) | ||
| 5050 | (when (window-live-p window) | ||
| 5051 | (throw 'live window))) | ||
| 5052 | root)))) | ||
| 5053 | (delete-other-windows-internal window root))) | ||
| 5054 | |||
| 5037 | (let* ((frame (window-frame window)) | 5055 | (let* ((frame (window-frame window)) |
| 5038 | (head (car state)) | 5056 | (head (car state)) |
| 5039 | ;; We check here (1) whether the total sizes of root window of | 5057 | ;; We check here (1) whether the total sizes of root window of |