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

Luke Gorrie lgorrie at common-lisp.net
Tue Jan 18 16:21:28 UTC 2005


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

Modified Files:
	slime.el 
Log Message:
(slime-complete-symbol*-fancy): Now defaults to t.

(slime-complete-symbol*-fancy-bit): Factored out this function.
Only do "semantic" completion when the symbol is in function-position,
avoid interning argument names in Emacs, and don't display arglists if
the minibuffer is active.

Date: Tue Jan 18 08:21:27 2005
Author: lgorrie

Index: slime/slime.el
diff -u slime/slime.el:1.449 slime/slime.el:1.450
--- slime/slime.el:1.449	Tue Jan 18 08:01:10 2005
+++ slime/slime.el	Tue Jan 18 08:21:27 2005
@@ -201,7 +201,7 @@
                  (const :tag "Compound" slime-complete-symbol*)
                  (const :tag "Fuzzy" slime-fuzzy-complete-symbol)))
 
-(defcustom slime-complete-symbol*-fancy nil
+(defcustom slime-complete-symbol*-fancy t
   "Use information from argument lists for DWIM'ish symbol completion.")
 
 (defcustom slime-space-information-p t
@@ -4530,16 +4530,7 @@
                   (= (length completion-set) 1))
              (slime-minibuffer-respecting-message "Sole completion")
              (when slime-complete-symbol*-fancy
-               (let ((arglist (slime-get-arglist
-                               (slime-symbol-name-at-point))))
-                 (when arglist
-                   (if (cdr (read arglist))
-                       (progn (insert-and-inherit " ")
-                              (when (and slime-space-information-p
-                                         (slime-background-activities-enabled-p)
-                                         (not (minibuffer-window-active-p)))
-                                (slime-echo-arglist)))
-                     (insert-and-inherit ")")))))
+               (slime-complete-symbol*-fancy-bit))
              (slime-complete-restore-window-configuration))
             ;; Incomplete
             (t
@@ -4552,6 +4543,28 @@
                (goto-char (+ beg unambiguous-completion-length))
                (slime-display-completion-list completion-set)
                (slime-complete-delay-restoration)))))))
+
+(defun slime-complete-symbol*-fancy-bit ()
+  "Do fancy tricks after completing a symbol.
+\(Insert a space or close-paren based on arglist information.)"
+  (let ((arglist (slime-get-arglist (slime-symbol-name-at-point))))
+    (when arglist
+      (let ((args
+             ;; Don't intern these symbols
+             (let ((obarray (make-vector 10 0)))
+               (cdr (read arglist))))
+            (function-call-position-p
+             (save-excursion
+                (backward-sexp)
+                (equal (char-before) ?\())))
+        (when function-call-position-p
+          (if (null args)
+              (insert-and-inherit ")")
+            (insert-and-inherit " ")
+            (when (and slime-space-information-p
+                       (slime-background-activities-enabled-p)
+                       (not (minibuffer-window-active-p (minibuffer-window))))
+              (slime-echo-arglist))))))))
 
 (defun* slime-simple-complete-symbol ()
   "Complete the symbol at point.  




More information about the slime-cvs mailing list