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

Helmut Eller heller at common-lisp.net
Wed Feb 18 19:43:27 UTC 2004


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

Modified Files:
	slime.el 
Log Message:
(slime): Just close the connection when called without
prefix-argument.  Keeping the connection open doesn't make sense.  We
could ask if the Lisp process should be killed, tough.

(slime-maybe-close-old-connections): Delete unused function.

(slime-start-swank-server): Use comint-send-string instead of
comint-proc-query, 'cause I don't like Olin "100%" Shivers' code.

(slime-init-output-buffer): Show some animations.

(slime-repl-clear-output): Fixed.

(slime-compilation-finished): It's not necessary to switch to the
original buffer, because the buffer is encoded in the
source-locations.

(sldb-show-source): Don't raise an error if the source cannot be
located.  Print a message instead, because errors in process-filters
cause a 1 second delay.






Date: Wed Feb 18 14:43:26 2004
Author: heller

Index: slime/slime.el
diff -u slime/slime.el:1.211 slime/slime.el:1.212
--- slime/slime.el:1.211	Tue Feb 17 16:54:25 2004
+++ slime/slime.el	Wed Feb 18 14:43:26 2004
@@ -908,7 +908,7 @@
            (slime-connected-p)
            (get-buffer "*inferior-lisp*"))
       (slime-maybe-rearrange-inferior-lisp)
-    (slime-maybe-close-old-connections))
+    (slime-disconnect))
   (slime-maybe-start-lisp)
   (slime-read-port-and-connect))
 
@@ -919,31 +919,25 @@
             (with-current-buffer "*inferior-lisp*"
               (rename-buffer bufname)))))
 
-(defun slime-maybe-close-old-connections ()
-  "Offer to keep old connections alive, otherwise disconnect."
-  (unless (or (not (slime-connected-p))
-              (y-or-n-p "Keep old connections? "))
-    (slime-disconnect)))
-
 (defun slime-maybe-start-lisp ()
   "Start an inferior lisp unless one is already running."
   (unless (get-buffer-process (get-buffer "*inferior-lisp*"))
     (call-interactively 'inferior-lisp)
-    (comint-proc-query (inferior-lisp-proc)
-                       (format "(load %S)\n"
-                               (concat slime-path slime-backend)))
+    (comint-send-string (inferior-lisp-proc)
+                        (format "(load %S)\n"
+                                (concat slime-path slime-backend)))
     (slime-maybe-start-multiprocessing)))
 
 (defun slime-maybe-start-multiprocessing ()
   (when slime-multiprocessing
     (comint-send-string (inferior-lisp-proc)
-                        "(swank:startup-multiprocessing)")))
+                        "(swank:startup-multiprocessing)\n")))
 
 (defun slime-start-swank-server ()
   "Start a Swank server on the inferior lisp."
-  (comint-proc-query (inferior-lisp-proc)
-                     (format "(swank:start-server %S)\n"
-                             (slime-swank-port-file))))
+  (comint-send-string (inferior-lisp-proc) 
+                      (format "(swank:start-server %S)\n"
+                              (slime-swank-port-file))))
 
 (defun slime-swank-port-file ()
   "Filename where the SWANK server writes its TCP port number."
@@ -1602,11 +1596,18 @@
                             (process-contact (slime-connection)))
                           (slime-pid))))
       ;; Emacs21 has the fancy persistent header-line.
-      (if (boundp 'header-line-format)
-          (progn (setq header-line-format banner)
-                 (slime-repl-insert-prompt ""))
-        (slime-repl-insert-prompt (concat "; " banner))))
-    (pop-to-buffer (current-buffer))))
+      (cond ((boundp 'header-line-format)
+             (setq header-line-format banner)
+             (pop-to-buffer (current-buffer))
+             (when (fboundp 'animate-string)
+               ;; and dancing text
+               (when (zerop (buffer-size))
+                 (animate-string (format "; SLIME %s" (slime-changelog-date))
+                                 0 0)))
+             (slime-repl-insert-prompt ""))
+            (t
+             (slime-repl-insert-prompt (concat "; " banner))
+             (pop-to-buffer (current-buffer)))))))
 
 (defvar slime-show-last-output-function 
   'slime-maybe-display-output-buffer
@@ -2019,13 +2020,15 @@
 
 (defun slime-repl-clear-output ()
   (interactive)
-  (when (marker-position slime-repl-last-input-start-mark)
-    (delete-region slime-repl-last-input-start-mark
-                   (1- (slime-repl-input-line-beginning-position)))
-    (save-excursion
-      (goto-char slime-repl-last-input-start-mark)
-      (insert ";;; output flushed"))
-    (set-marker slime-repl-last-input-start-mark nil)))
+  (let ((start (save-excursion 
+                 (slime-repl-previous-prompt)
+                 (point)))
+        (end (1- (slime-repl-input-line-beginning-position))))
+    (when (< start end)
+      (delete-region start end)
+      (save-excursion
+        (goto-char start)
+        (insert ";;; output flushed")))))
 
 (defun slime-repl-set-package (package)
   "Set the package of the REPL buffer to PACKAGE."
@@ -2346,10 +2349,9 @@
 
 (defun slime-compilation-finished (result buffer show-notes-buffer)
   (let ((notes (slime-compiler-notes)))
-    (with-current-buffer buffer
-      (multiple-value-bind (result secs) result
-        (slime-show-note-counts notes secs)
-        (slime-highlight-notes notes)))
+    (multiple-value-bind (result secs) result
+      (slime-show-note-counts notes secs)
+      (slime-highlight-notes notes))
     (when (and show-notes-buffer (slime-length> notes 1))
       (slime-list-compiler-notes notes))
     ;;(let ((xrefs (slime-xrefs-for-notes notes)))
@@ -4322,7 +4324,12 @@
      `(swank:frame-source-location-for-emacs ,number)
      nil
      (lambda (source-location)
-       (slime-show-source-location source-location)))))
+       (destructure-case source-location
+         ((:error message)
+          (message "%s" message)
+          (ding))
+         (t
+          (slime-show-source-location source-location)))))))
 
 (defun slime-show-source-location (source-location)
   (save-selected-window





More information about the slime-cvs mailing list