[slime-cvs] CVS slime

trittweiler trittweiler at common-lisp.net
Mon Sep 8 22:35:59 UTC 2008


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv27461

Modified Files:
	swank.lisp ChangeLog 
Log Message:

A package "Foo.Bar.1.0" was truncated to "0>" as REPL
prompt. It'll now be displayed as "Bar.1.0>".

* swank.lisp (auto-abbreviated-package-name): Adapted accordingly.


--- /project/slime/cvsroot/slime/swank.lisp	2008/08/31 11:58:01	1.581
+++ /project/slime/cvsroot/slime/swank.lisp	2008/09/08 22:35:58	1.582
@@ -2003,11 +2003,21 @@
 
 N.B. this is not an actual package name or nickname."
   (when *auto-abbreviate-dotted-packages*
-    (let ((last-dot (position #\. (package-name package) :from-end t)))
-      (when last-dot (subseq (package-name package) (1+ last-dot))))))
+    (loop with package-name = (package-name package)
+          with offset = nil
+          do (let ((last-dot-pos (position #\. package-name :end offset :from-end t)))
+               (unless last-dot-pos
+                 (return nil))
+               ;; If a dot chunk contains only numbers, that chunk most
+               ;; likely represents a version number; so we collect the
+               ;; next chunks, too, until we find one with meat.
+               (let ((name (subseq package-name (1+ last-dot-pos) offset)))
+                 (if (notevery #'digit-char-p name)
+                     (return (subseq package-name (1+ last-dot-pos)))
+                     (setq offset last-dot-pos)))))))
 
 (defun shortest-package-nickname (package)
-  "Return the shortest nickname (or canonical name) of PACKAGE."
+  "Return the shortest nickname of PACKAGE."
   (loop for name in (cons (package-name package) (package-nicknames package))
         for shortest = name then (if (< (length name) (length shortest))
                                    name
--- /project/slime/cvsroot/slime/ChangeLog	2008/08/31 11:58:09	1.1491
+++ /project/slime/cvsroot/slime/ChangeLog	2008/09/08 22:35:58	1.1492
@@ -1,3 +1,10 @@
+2008-09-09  Tobias C. Rittweiler  <tcr at freebits.de>
+
+	A package "Foo.Bar.1.0" was truncated to "0>" as REPL
+	prompt. It'll now be displayed as "Bar.1.0>".
+
+	* swank.lisp (auto-abbreviated-package-name): Adapted accordingly.
+
 2008-08-31  Helmut Eller  <heller at common-lisp.net>
 
 	* swank-backend.lisp (*gray-stream-symbols*): Remove




More information about the slime-cvs mailing list