[slime-devel] [PATCH] completions-for-keyword: better handling when arglist is unavailable

Ariel Badichi vermilionrush at gmail.com
Fri Dec 18 04:22:43 UTC 2009


---
 contrib/swank-arglists.lisp |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/contrib/swank-arglists.lisp b/contrib/swank-arglists.lisp
index fcc3551..4873091 100644
--- a/contrib/swank-arglists.lisp
+++ b/contrib/swank-arglists.lisp
@@ -1150,14 +1150,17 @@ wrapped in ===> X <===."
   "Return a list of possible completions for KEYWORD-STRING relative
 to the context provided by RAW-FORM."
   (with-buffer-syntax ()
-    (with-available-arglist (arglist)
-        (find-immediately-containing-arglist (parse-raw-form raw-form))
       ;; It would be possible to complete keywords only if we are in
       ;; a keyword position, but it is not clear if we want that.
-      (let* ((keywords
-              (append (mapcar #'keyword-arg.keyword
-                              (arglist.keyword-args arglist))
-                      (remove-if-not #'keywordp (arglist.any-args arglist))))
+      (let* ((keywords-for-arglist
+              (with-available-arglist (arglist)
+                  (find-immediately-containing-arglist (parse-raw-form raw-form))
+                (append (mapcar #'keyword-arg.keyword
+                                (arglist.keyword-args arglist))
+                        (remove-if-not #'keywordp (arglist.any-args arglist)))))
+             (keywords
+              (unless (eq :not-available keywords-for-arglist)
+                keywords-for-arglist))
              (keyword-name
               (tokenize-symbol keyword-string))
              (matching-keywords
@@ -1170,7 +1173,7 @@ to the context provided by RAW-FORM."
              (completion-set
               (format-completion-set strings nil "")))
         (list completion-set
-              (longest-compound-prefix completion-set))))))
+              (longest-compound-prefix completion-set)))))
 
 (defparameter +cursor-marker+ '%cursor-marker%)
 
-- 
1.6.6.rc2.5.g49666






More information about the slime-devel mailing list