From 698e6e901e34e13c21cccdadea39f359399f384d Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Sat, 5 Apr 2014 21:09:10 +0100 Subject: [PATCH] save point within squeeze-control-display-players --- squeeze.el | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/squeeze.el b/squeeze.el index 16359dc..c4a229a 100644 --- a/squeeze.el +++ b/squeeze.el @@ -300,35 +300,33 @@ (defun squeeze-control-display-players () (interactive) - (cond - (squeeze-control-display-syncgroups - (with-current-buffer (get-buffer-create "*squeeze-control*") + (with-current-buffer (get-buffer-create "*squeeze-control*") + (let ((saved (point))) (squeeze-control-mode) (read-only-mode -1) (erase-buffer) - (let ((syncgroups squeeze-syncgroups) - (seen)) - (while syncgroups - (let ((names (getf syncgroups :names)) - (members (split-string (getf syncgroups :members) ","))) - (insert (propertize names 'face 'squeeze-syncgroup-face) "\n") - (dolist (member members) - (let ((player (squeeze-find-player member))) - (squeeze-control-insert-player player) - (push player seen)))) - (setq syncgroups (cddddr syncgroups))) - (insert (propertize "No syncgroup" 'face 'squeeze-syncgroup-face) "\n") + (cond + (squeeze-control-display-syncgroups + (let ((syncgroups squeeze-syncgroups) + (seen)) + (while syncgroups + (let ((names (getf syncgroups :names)) + (members (split-string (getf syncgroups :members) ","))) + (insert (propertize names 'face 'squeeze-syncgroup-face) "\n") + (dolist (member members) + (let ((player (squeeze-find-player member))) + (squeeze-control-insert-player player) + (push player seen)))) + (setq syncgroups (cddddr syncgroups))) + (insert (propertize "No syncgroup" 'face 'squeeze-syncgroup-face) "\n") + (dolist (player squeeze-players) + (unless (member player seen) + (squeeze-control-insert-player player))))) + (t (dolist (player squeeze-players) - (unless (member player seen) - (squeeze-control-insert-player player)))))) - (t - (with-current-buffer (get-buffer-create "*squeeze-control*") - (squeeze-control-mode) - (read-only-mode -1) - (erase-buffer) - (dolist (player squeeze-players) - (squeeze-control-insert-player player)) - (read-only-mode 1))))) + (squeeze-control-insert-player player)) + (read-only-mode 1))) + (goto-char saved)))) (cl-defstruct (squeeze-player (:constructor squeeze-make-player)) playerindex playerid uuid ip name model isplayer displaytype canpoweroff connected power volume) -- 2.39.5