From 54a98afcc7041cfbc06c3652703c3ad690dc86a8 Mon Sep 17 00:00:00 2001
From: Christophe Rhodes <csr21@cantab.net>
Date: Mon, 1 Dec 2014 16:34:46 +0000
Subject: [PATCH] allow squeeze completion on known squeeze player ids

---
 squeeze.el | 80 ++++++++++++++++++++++++++++--------------------------
 1 file changed, 41 insertions(+), 39 deletions(-)

diff --git a/squeeze.el b/squeeze.el
index cfbca13..7dbf120 100644
--- a/squeeze.el
+++ b/squeeze.el
@@ -408,45 +408,47 @@
   (save-excursion
     (list (progn (backward-word) (point))
           (progn (forward-word) (point))
-          '(;; General commands and queries
-            "login" "can" "version" "listen" "subscribe" "pref"
-            "logging" "getstring" "setsncredentials" "debug"
-            "exit" "shutdown"
-
-            ;; Player commands and queries
-            "player" "count" "id" "uuid" "name" "ip" "model" "isplayer"
-            "displaytype" "canpoweroff" "?" "signalstrength" "connected"
-            "sleep" "sync" "syncgroups" "power" "mixer" "volume" "muting"
-            "bass" "treble" "pitch" "show" "display" "linesperscreen"
-            "displaynow" "playerpref" "button" "ir" "irenable"
-            "connect" "client" "forget" "disconnect" "players"
-            
-            ;; Database commands and queries
-            "rescan" "rescanprogress" "abortscan" "wipecache" "info"
-            "total" "genres" "artists" "albums" "songs" "years"
-            "musicfolder" "playlists" "tracks" "new" "rename" "delete"
-            "edit" "songinfo" "titles" "search" "pragma"
-
-            ;; Playlist commands and queries
-            "play" "stop" "pause" "mode" "time" "genre" "artist" "album"
-            "title" "duration" "remote" "current_title" "path" "playlist"
-            "add" "insert" "deleteitem" "move" "delete" "preview" "resume"
-            "save" "loadalbum" "addalbum" "loadtracks" "addtracks"
-            "insertalbum" "deletealbum" "clear" "zap" "name" "url"
-            "modified" "playlistsinfo" "index" "shuffle" "repeat"
-            "playlistcontrol"
-
-            ;; Compound queries
-            "serverstatus" "status" "displaystatus" "readdirectory"
-
-            ;; Notifications
-
-            ;; Alarm commands and queries
-            "alarm" "alarms"
-
-            ;; Plugins commands and queries
-            "favorites"
-            ))))
+          (append
+           (mapcar 'squeeze-player-playerid squeeze-players)
+           '(;; General commands and queries
+             "login" "can" "version" "listen" "subscribe" "pref"
+             "logging" "getstring" "setsncredentials" "debug"
+             "exit" "shutdown"
+
+             ;; Player commands and queries
+             "player" "count" "id" "uuid" "name" "ip" "model" "isplayer"
+             "displaytype" "canpoweroff" "?" "signalstrength" "connected"
+             "sleep" "sync" "syncgroups" "power" "mixer" "volume" "muting"
+             "bass" "treble" "pitch" "show" "display" "linesperscreen"
+             "displaynow" "playerpref" "button" "ir" "irenable"
+             "connect" "client" "forget" "disconnect" "players"
+
+             ;; Database commands and queries
+             "rescan" "rescanprogress" "abortscan" "wipecache" "info"
+             "total" "genres" "artists" "albums" "songs" "years"
+             "musicfolder" "playlists" "tracks" "new" "rename" "delete"
+             "edit" "songinfo" "titles" "search" "pragma"
+
+             ;; Playlist commands and queries
+             "play" "stop" "pause" "mode" "time" "genre" "artist" "album"
+             "title" "duration" "remote" "current_title" "path" "playlist"
+             "add" "insert" "deleteitem" "move" "delete" "preview" "resume"
+             "save" "loadalbum" "addalbum" "loadtracks" "addtracks"
+             "insertalbum" "deletealbum" "clear" "zap" "name" "url"
+             "modified" "playlistsinfo" "index" "shuffle" "repeat"
+             "playlistcontrol"
+
+             ;; Compound queries
+             "serverstatus" "status" "displaystatus" "readdirectory"
+
+             ;; Notifications
+
+             ;; Alarm commands and queries
+             "alarm" "alarms"
+
+             ;; Plugins commands and queries
+             "favorites"
+             )))))
 
 (defun squeeze-read-server-parameters (address port)
   (let ((host (read-string "Host: " nil nil address))
-- 
2.39.5