/[slime]/slime/swank.lisp
ViewVC logotype

Diff of /slime/swank.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.581 by heller, Sun Aug 31 11:58:01 2008 UTC revision 1.582 by trittweiler, Mon Sep 8 22:35:58 2008 UTC
# Line 2003  aborted and return immediately with the Line 2003  aborted and return immediately with the
2003    
2004  N.B. this is not an actual package name or nickname."  N.B. this is not an actual package name or nickname."
2005    (when *auto-abbreviate-dotted-packages*    (when *auto-abbreviate-dotted-packages*
2006      (let ((last-dot (position #\. (package-name package) :from-end t)))      (loop with package-name = (package-name package)
2007        (when last-dot (subseq (package-name package) (1+ last-dot))))))            with offset = nil
2008              do (let ((last-dot-pos (position #\. package-name :end offset :from-end t)))
2009                   (unless last-dot-pos
2010                     (return nil))
2011                   ;; If a dot chunk contains only numbers, that chunk most
2012                   ;; likely represents a version number; so we collect the
2013                   ;; next chunks, too, until we find one with meat.
2014                   (let ((name (subseq package-name (1+ last-dot-pos) offset)))
2015                     (if (notevery #'digit-char-p name)
2016                         (return (subseq package-name (1+ last-dot-pos)))
2017                         (setq offset last-dot-pos)))))))
2018    
2019  (defun shortest-package-nickname (package)  (defun shortest-package-nickname (package)
2020    "Return the shortest nickname (or canonical name) of PACKAGE."    "Return the shortest nickname of PACKAGE."
2021    (loop for name in (cons (package-name package) (package-nicknames package))    (loop for name in (cons (package-name package) (package-nicknames package))
2022          for shortest = name then (if (< (length name) (length shortest))          for shortest = name then (if (< (length name) (length shortest))
2023                                     name                                     name

Legend:
Removed from v.1.581  
changed lines
  Added in v.1.582

  ViewVC Help
Powered by ViewVC 1.1.5