Peter Seibel wrote:
[...]
Also, I was hacking around some more with another addition to shortest-package-nickname to automatically create abbreviations for dotted package names:
CL-USER> (in-package :com.gigamonkeys.spam) #<The COM.GIGAMONKEYS.SPAM package> SPAM>
How about abbreviating to
C.G.SPAM>
That way, you are possibly less likely to be confused if you have two packages ending with the same name.
Something like:
(defun auto-abbreviated-package-name (package) (when *auto-abbreviate-dotted-packages* (let ((name (make-array '(0) :element-type 'base-char :fill-pointer 0 :adjustable t)) (pname (package-name package)) (dot nil)) (with-output-to-string (s name) (while (setf dot (position #. pname)) (princ (char pname 0) s) (princ #. s) (setf pname (subseq pname (1+ dot)))) (princ pname s)) name)))
perhaps.