branch: externals/ampc
commit 8357bd667943246efa1b15de2bca4ef63c543e31
Author: Christopher Schmidt <christop...@ch.ristopher.com>
Commit: Christopher Schmidt <christop...@ch.ristopher.com>

    * ampc.el (ampc-configure-frame): Reorder update statements to guarantee 
correct
    filling in some corner cases.
---
 ampc.el | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/ampc.el b/ampc.el
index f81551a21a..c191bd1d65 100644
--- a/ampc.el
+++ b/ampc.el
@@ -1567,28 +1567,25 @@ all the time!"
              (delete-other-windows))
     (loop with live-window = nil
           for w in (nreverse (ampc-windows t))
-          if (window-live-p w)
-          if (not live-window)
-          do (setf live-window w)
-          else
-          do (delete-window w)
-          end
-          end
+          do (when (window-live-p w)
+               (if (not live-window)
+                   (setf live-window w)
+                 (delete-window w)))
           finally do (if live-window (select-window live-window))))
   (setf ampc-buffers nil)
   (ampc-configure-frame-1 split)
   (setf ampc-buffers-unordered (mapcar 'cdr ampc-buffers)
         ampc-buffers (mapcar 'cdr (sort ampc-buffers
                                         (lambda (a b) (< (car a) (car b))))))
-  (ampc-update)
-  ;; fill the song, current-playlist and outputs buffer again as the tab 
offsets
-  ;; might have changed
+  ;; fill the song, current-playlist and outputs buffers again as the tab
+  ;; offsets might have changed
   (ampc-with-buffer 'song
     (delete-region (point-min) (point-max)))
   (ampc-with-buffer 'current-playlist
     (delete-region (point-min) (point-max)))
   (ampc-with-buffer 'outputs
-    (delete-region (point-min) (point-max))))
+    (delete-region (point-min) (point-max)))
+  (ampc-update))
 
 (defun ampc-mouse-play-this (event)
   (interactive "e")

Reply via email to