]> code.delx.au - gnu-emacs-elpa/commitdiff
* ampc.el (ampc-configure-frame): Reorder update statements to guarantee correct
authorChristopher Schmidt <christopher@ch.ristopher.com>
Fri, 3 Aug 2012 07:34:56 +0000 (09:34 +0200)
committerChristopher Schmidt <christopher@ch.ristopher.com>
Fri, 3 Aug 2012 07:34:56 +0000 (09:34 +0200)
filling in some corner cases.

ampc.el

diff --git a/ampc.el b/ampc.el
index f81551a21a6d874ac1ed9d54c185765a50e84cc6..c191bd1d655a7065c9d5275cadaa2799929ff4f9 100644 (file)
--- 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")