[slime-cvs] CVS slime
    trittweiler 
    trittweiler at common-lisp.net
       
    Thu May 17 15:29:07 UTC 2007
    
    
  
Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv7625
Modified Files:
	slime.el 
Log Message:
* slime.el (slime-complete-form): Only insert a closing
  parenthesis if the form is not already closed. Reported by and
  adapted from Mac Chan.
--- /project/slime/cvsroot/slime/slime.el	2007/05/14 19:40:28	1.788
+++ /project/slime/cvsroot/slime/slime.el	2007/05/17 15:29:02	1.789
@@ -5652,7 +5652,7 @@
   (interactive)
   ;; Find the (possibly incomplete) form around point.
   (let* ((start (save-excursion (backward-up-list 1) (point)))
-         (end (point)) ; or try to find end (tricky)?
+         (end (point))
          (form-string
           (concat (buffer-substring-no-properties start end) ")")))
     (let ((result (slime-eval `(swank:complete-form ,form-string))))
@@ -5661,7 +5661,12 @@
           (progn
             (just-one-space)
             (save-excursion
-              (insert result))
+              ;; SWANK:COMPLETE-FORM always returns a closing
+              ;; parenthesis; but we only want to insert one if it's
+              ;; really necessary (thinking especially of paredit.el.)
+              (insert (substring result 0 -1))
+              (let ((slime-close-parens-limit 1))
+                (slime-close-parens-at-point)))
             (save-excursion
               (backward-up-list 1)
               (indent-sexp)))))))
    
    
More information about the slime-cvs
mailing list