[slime-cvs] CVS update: slime/slime.el

Luke Gorrie lgorrie at common-lisp.net
Sun Feb 20 20:29:45 UTC 2005


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv8449

Modified Files:
	slime.el 
Log Message:
(slime-complete-form): New command.

(slime-keys): Bind C-c C-s to slime-complete-form rather than
slime-insert-arglist.

Date: Sun Feb 20 21:29:44 2005
Author: lgorrie

Index: slime/slime.el
diff -u slime/slime.el:1.457 slime/slime.el:1.458
--- slime/slime.el:1.457	Fri Feb 18 17:01:53 2005
+++ slime/slime.el	Sun Feb 20 21:29:43 2005
@@ -566,7 +566,7 @@
     ("\M-g" slime-quit :prefixed t :inferior t :sldb t)
     ;; Documentation
     (" " slime-space :inferior t)
-    ("\C-s" slime-insert-arglist :prefixed t :inferior t)
+    ("\C-s" slime-complete-form :prefixed t :inferior t)
     ("\C-f" slime-describe-function :prefixed t :inferior t :sldb t)
     ("\M-d" slime-disassemble-symbol :prefixed t :inferior t :sldb t)
     ("\C-t" slime-toggle-trace-fdefinition :prefixed t :sldb t)
@@ -4266,6 +4266,23 @@
           (t
            (save-excursion
              (insert arglist))))))
+
+(defun slime-complete-form ()
+  "Complete the form at point.  This is a superset of the
+functionality of `slime-insert-arglist'."
+  (interactive)
+  ;; Find the (possibly incomplete) form around point.
+  (let* ((start (save-excursion (backward-up-list) (point)))
+         (end (point)) ; or try to find end (tricky)?
+         (form-string
+          (concat (buffer-substring-no-properties start end) ")")))
+    (let ((result (slime-eval `(swank:complete-form ,form-string))))
+      (if (eq result :not-available)
+          (error "Arglist not available")
+          (progn
+            (just-one-space)
+            (save-excursion
+              (insert result)))))))
 
 (defun slime-get-arglist (symbol-name)
   "Return the argument list for SYMBOL-NAME."




More information about the slime-cvs mailing list