[slime-cvs] CVS slime

CVS User trittweiler trittweiler at common-lisp.net
Mon Mar 1 12:26:02 UTC 2010


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv29150

Modified Files:
	ChangeLog slime.el 
Log Message:
	Fix that annoying bug that caused being constantly asked to switch
	connection in case one had multiple connections running and quit
	from one.

	* slime.el (slime-modeline-string): Bail out early because
	`slime-current-package' involves `slime-connection' in case the
	slime-repl contrib is used, and querying the user in a
	periodically called function is rather annoying..


--- /project/slime/cvsroot/slime/ChangeLog	2010/02/26 21:02:59	1.2001
+++ /project/slime/cvsroot/slime/ChangeLog	2010/03/01 12:26:01	1.2002
@@ -1,3 +1,14 @@
+2010-03-01  Tobias C. Rittweiler <tcr at freebits.de>
+
+	Fix that annoying bug that caused being constantly asked to switch
+	connection in case one had multiple connections running and quit
+	from one.
+
+	* slime.el (slime-modeline-string): Bail out early because
+	`slime-current-package' involves `slime-connection' in case the
+	slime-repl contrib is used, and querying the user in a
+	periodically called function is rather annoying..
+
 2010-02-26  Stas Boukarev  <stassats at gmail.com>
 
 	* swank-loader.lisp (ecl-version-string): Check length of
--- /project/slime/cvsroot/slime/slime.el	2010/02/23 20:54:30	1.1280
+++ /project/slime/cvsroot/slime/slime.el	2010/03/01 12:26:01	1.1281
@@ -435,18 +435,21 @@
 \"Slime\" only appears if we aren't connected.  If connected,
 include package-name, connection-name, and possibly some state
 information."
-  (let* ((conn (slime-current-connection))
-         (local (and conn (eq conn slime-buffer-connection)))
-         (pkg (slime-current-package)))
-    (cond ((not conn) (and slime-mode " Slime"))
-          ((concat " "
-                   (if local "{" "[")
-                   (if pkg (slime-pretty-package-name pkg) "?")
-                   " "
-                   ;; ignore errors for closed connections
-                   (ignore-errors (slime-connection-name conn))
-                   (slime-modeline-state-string conn)
-                   (if local "}" "]"))))))
+  (let ((conn (slime-current-connection)))
+    ;; Bail out early in case there's no connection, so we won't
+    ;; implicitly invoke `slime-connection' which may query the user.
+    (if (not conn)
+        (and slime-mode " Slime")
+        (let ((local (eq conn slime-buffer-connection))
+              (pkg   (slime-current-package)))
+          (concat " "
+                  (if local "{" "[")
+                  (if pkg (slime-pretty-package-name pkg) "?")
+                  " "
+                  ;; ignore errors for closed connections
+                  (ignore-errors (slime-connection-name conn))
+                  (slime-modeline-state-string conn)
+                  (if local "}" "]"))))))
 
 (defun slime-pretty-package-name (name)
   "Return a pretty version of a package name NAME."





More information about the slime-cvs mailing list