--- swank.lisp.~1.105.~ 2004-01-21 00:47:56.000000000 +0100 +++ swank.lisp 2004-01-21 02:13:53.000000000 +0100 @@ -897,27 +897,30 @@ (if n (find-package (case-convert n)) *buffer-package* )))) + (unless package + (return-from completions (list nil ""))) + (flet ((symbol-matches-p (symbol) (and (compound-prefix-match name (symbol-name symbol)) (or (or internal-p (null package-name)) (symbol-external-p symbol package))))) - (when package (do-symbols (symbol package) (when (symbol-matches-p symbol) - (push symbol completions))))) + (push symbol completions)))) + (let ((*print-case* (if (find-if #'upper-case-p string) :upcase :downcase)) - (*package* package)) - (let* ((completion-set - (mapcar (lambda (s) - (cond (internal-p (format nil "~A::~A" package-name s)) - (package-name (format nil "~A:~A" package-name s)) - (t (format nil "~A" s)))) - ;; DO-SYMBOLS can consider the same symbol more than - ;; once, so remove duplicates. - (remove-duplicates (sort completions #'string< - :key #'symbol-name))))) - (list completion-set (longest-completion completion-set))))))) + (*package* package) + (completion-set + (mapcar (lambda (s) + (cond (internal-p (format nil "~A::~A" package-name s)) + (package-name (format nil "~A:~A" package-name s)) + (t (format nil "~A" s)))) + ;; DO-SYMBOLS can consider the same symbol more than + ;; once, so remove duplicates. + (remove-duplicates (sort completions #'string< + :key #'symbol-name))))) + (list completion-set (longest-completion completion-set)))))) (defun parse-symbol-designator (string) "Parse STRING as a symbol designator.