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

Helmut Eller heller at common-lisp.net
Sat Mar 27 21:11:20 UTC 2004


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

Modified Files:
	slime.el 
Log Message:
(slime-repl-indent-and-complete-symbol): New command.  Bound to TAB in
the REPL mode.  First try to indent the current line then try to
complete the symbol at point.

(slime-dispatch-event): Ignore a unused thread variable to keep
XEmacs' byte compiler quiet.

Date: Sat Mar 27 16:11:19 2004
Author: heller

Index: slime/slime.el
diff -u slime/slime.el:1.245 slime/slime.el:1.246
--- slime/slime.el:1.245	Fri Mar 26 11:06:56 2004
+++ slime/slime.el	Sat Mar 27 16:11:19 2004
@@ -1486,6 +1486,7 @@
       ((:ed what)
        (slime-ed what))
       ((:debug-condition thread message)
+       (apply 'ignore thread) ; stupid XEmacs warns about unused variable
        (message "%s" message)))))
 
 (defun slime-reset ()
@@ -2132,6 +2133,18 @@
     (insert "\n")
     (lisp-indent-line)))
 
+(defun slime-repl-indent-and-complete-symbol ()
+  "Indent the current line and perform symbol completion.
+First indent the line.  If indenting doesn't move point complete the
+symbol."
+  (interactive)
+  (let ((pos (point)))
+    (lisp-indent-line)
+    (when (and (= pos (point))
+               (save-excursion 
+                 (re-search-backward "\\(\\s_\\|\\sw\\)+\\=" nil t)))
+      (slime-complete-symbol))))
+
 (defun slime-repl-delete-current-input ()
   (delete-region slime-repl-input-start-mark slime-repl-input-end-mark))
 
@@ -2277,7 +2290,8 @@
   ("\M-s" 'slime-repl-next-matching-input)
   ("\C-c\C-c" 'slime-interrupt)
   ("\C-c\C-g" 'slime-interrupt)
-  ("\t"   'slime-complete-symbol)
+  ;("\t"   'slime-complete-symbol)
+  ("\t"   'slime-repl-indent-and-complete-symbol)
   (" "    'slime-space)
   ("\C-\M-x" 'slime-eval-defun)
   ("\C-c\C-o" 'slime-repl-clear-output)
@@ -2830,7 +2844,7 @@
 If the location's sexp is a list spanning multiple lines, then the
 region around the first element is used."
   (let ((location (getf note :location)))
-    (unless (eql (car location) :error) 
+    (unless (eq (car location) :error) 
       (slime-goto-source-location location)
       (let ((start (point)))
         (ignore-errors (slime-forward-sexp))





More information about the slime-cvs mailing list