emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116477: In window-state-put allow WINDOW to refer t


From: Martin Rudalics
Subject: [Emacs-diffs] trunk r116477: In window-state-put allow WINDOW to refer to an internal window (Bug#16793).
Date: Wed, 19 Feb 2014 09:54:53 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116477
revision-id: address@hidden
parent: address@hidden
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Wed 2014-02-19 10:54:35 +0100
message:
  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).
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/window.el                 window.el-20091113204419-o5vbwnq5f7feedwu-94
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-02-19 08:34:45 +0000
+++ b/lisp/ChangeLog    2014-02-19 09:54:35 +0000
@@ -1,3 +1,8 @@
+2014-02-19  Martin Rudalics  <address@hidden>
+
+       * window.el (window-state-put): Allow WINDOW to refer to an
+       internal window (Bug#16793).
+
 2014-02-19  Glenn Morris  <address@hidden>
 
        * textmodes/remember.el: Move provide statement to end.

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2014-02-10 01:34:22 +0000
+++ b/lisp/window.el    2014-02-19 09:54:35 +0000
@@ -5026,14 +5026,32 @@
   "Put window state STATE into WINDOW.
 STATE should be the state of a window returned by an earlier
 invocation of `window-state-get'.  Optional argument WINDOW must
-specify a live window and defaults to the selected one.
+specify a valid window and defaults to the selected one.  If
+WINDOW is not live, replace WINDOW by a live one before putting
+STATE into it.
 
 Optional argument IGNORE non-nil means ignore minimum window
 sizes and fixed size restrictions.  IGNORE equal `safe' means
 windows can get as small as `window-safe-min-height' and
 `window-safe-min-width'."
   (setq window-state-put-stale-windows nil)
-  (setq window (window-normalize-window window t))
+  (setq window (window-normalize-window window))
+
+  ;; When WINDOW is internal, reduce it to a live one to put STATE into,
+  ;; see Bug#16793.
+  (unless (window-live-p window)
+    (let ((root (frame-root-window window)))
+      (if (eq window root)
+         (setq window (frame-first-window root))
+       (setq root window)
+       (setq window (catch 'live
+                      (walk-window-subtree
+                       (lambda (window)
+                         (when (window-live-p window)
+                           (throw 'live window)))
+                       root))))
+      (delete-other-windows-internal window root)))
+
   (let* ((frame (window-frame window))
         (head (car state))
         ;; We check here (1) whether the total sizes of root window of


reply via email to

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