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

Helmut Eller heller at common-lisp.net
Mon Mar 8 07:14:58 UTC 2004


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

Modified Files:
	slime.el 
Log Message:
(slime-start-swank-server, slime-maybe-start-lisp): Translate
filenames.  Reported by "49gu4n502 at sneakemail.com".

(slime-insert-balanced-comments slime-remove-balanced-comments)
(slime-pretty-lambdas): New functions.  From Bill Clementson.


Date: Mon Mar  8 02:14:58 2004
Author: heller

Index: slime/slime.el
diff -u slime/slime.el:1.229 slime/slime.el:1.230
--- slime/slime.el:1.229	Sun Mar  7 11:40:18 2004
+++ slime/slime.el	Mon Mar  8 02:14:57 2004
@@ -965,7 +965,8 @@
     (call-interactively 'inferior-lisp)
     (comint-send-string (inferior-lisp-proc)
                         (format "(load %S)\n"
-                                (concat slime-path slime-backend)))
+                                (slime-to-lisp-filename
+                                 (concat slime-path slime-backend))))
     (slime-maybe-start-multiprocessing)))
 
 (defun slime-maybe-start-multiprocessing ()
@@ -977,7 +978,8 @@
   "Start a Swank server on the inferior lisp."
   (comint-send-string (inferior-lisp-proc) 
                       (format "(swank:start-server %S)\n"
-                              (slime-swank-port-file))))
+                                (slime-to-lisp-filename
+                                 (slime-swank-port-file)))))
 
 (defun slime-swank-port-file ()
   "Filename where the SWANK server writes its TCP port number."
@@ -5204,6 +5206,47 @@
       (skip-chars-forward " \t\n)")
       (skip-chars-backward " \t\n")
       (delete-region point (point)))))
+
+(defun slime-insert-balanced-comments (arg)
+  "Insert a set of balanced comments around the s-expression
+containing the point.  If this command is invoked repeatedly
+(without any other command occurring between invocations), the
+comment progressively moves outward over enclosing expressions.
+If invoked with a positive prefix argument, the s-expression arg
+expressions out is enclosed in a set of balanced comments."
+  (interactive "*p")
+  (save-excursion
+    (when (eq last-command this-command)
+      (when (search-backward "#|" nil t)
+        (save-excursion
+          (delete-char 2)
+          (while (and (< (point) (point-max)) (not (looking-at " *|#")))
+            (forward-sexp))
+          (replace-match ""))))
+    (while (> arg 0)
+      (backward-char 1)
+      (cond ((looking-at ")") (incf arg))
+            ((looking-at "(") (decf arg))))
+    (insert "#|")
+    (forward-sexp)
+    (insert "|#")))
+
+(defun slime-remove-balanced-comments ()
+  "Remove a set of balanced comments enclosing point."
+  (interactive "*")
+  (save-excursion
+    (when (search-backward "#|" nil t)
+      (delete-char 2)
+      (while (and (< (point) (point-max)) (not (looking-at " *|#")))
+      (forward-sexp))
+      (replace-match ""))))
+
+(defun slime-pretty-lambdas ()
+  (font-lock-add-keywords
+   nil `(("(\\(lambda\\>\\)"
+        (0 (progn (compose-region (match-beginning 1) (match-end 1)
+                            ,(make-char 'greek-iso8859-7 107))
+                nil))))))
 
 ;;; Test suite
 





More information about the slime-cvs mailing list