* riece-display.el (riece-configure-windows): Select other window
[riece] / lisp / riece-server.el
index 4762802..859cf1e 100644 (file)
@@ -97,11 +97,11 @@ is running on."
          (service (match-string 2 string))
          (password (substring string (match-end 0)))
          plist)
-      (push `(:host ,host) plist)
+      (setq plist (cons `(:host ,host) plist))
       (unless (equal service "")
-       (push `(:service ,(string-to-int service)) plist))
+       (setq plist (cons `(:service ,(string-to-int service)) plist)))
       (unless (equal password "")
-       (push `(:password ,(substring password 1)) plist))
+       (setq plist (cons `(:password ,(substring password 1)) plist)))
       (apply #'nconc plist))))
 
 (defun riece-server-name-to-server (server-name)
@@ -109,9 +109,9 @@ is running on."
     (if entry
        (unless (listp (cdr entry))
          (setcdr entry (riece-server-parse-string (cdr entry))))
-      (setq entry (cons server-name (riece-server-parse-string server-name)))
-      (push entry riece-server-alist)
-      (setq riece-save-variables-are-dirty t))
+      (setq entry (cons server-name (riece-server-parse-string server-name))
+           riece-server-alist (cons entry riece-server-alist)
+           riece-save-variables-are-dirty t))
     (cdr entry)))
 
 (defun riece-open-server (server server-name)
@@ -196,8 +196,9 @@ If optional argument SERVICE is non-nil, open by the service name."
   (let ((riece-overriding-server-name server-name)
        (channels riece-current-channels))
     (while channels
-      (if (equal (riece-identity-server (car channels))
-                server-name)
+      (if (and (car channels)
+              (equal (riece-identity-server (car channels))
+                     server-name))
          (riece-part-channel (car channels)))
       (setq channels (cdr channels)))
     (riece-redisplay-buffers))