[slime-cvs] CVS update: slime/swank.lisp

Luke Gorrie lgorrie at common-lisp.net
Sat Nov 22 05:37:00 UTC 2003


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

Modified Files:
	swank.lisp 
Log Message:
(listener-eval): Format results in *buffer-package*.

Exporting (CREATE-SWANK-SERVER <port>). This function can be
called directly to start a swank server, which you can then
connect to with `M-x slime-connect'. It takes a port number as
argument, but this can be zero to use a random available port.
The function always returns the actual port number being used.

Date: Sat Nov 22 00:36:59 2003
Author: lgorrie

Index: slime/swank.lisp
diff -u slime/swank.lisp:1.59 slime/swank.lisp:1.60
--- slime/swank.lisp:1.59	Wed Nov 19 07:35:47 2003
+++ slime/swank.lisp	Sat Nov 22 00:36:59 2003
@@ -10,7 +10,7 @@
 (defpackage :swank
   (:use :common-lisp)
   (:nicknames "SWANK-IMPL")
-  (:export #:start-server
+  (:export #:start-server #:create-swank-server
            #:*sldb-pprint-frames*))
 
 (in-package :swank)
@@ -162,6 +162,11 @@
   (let ((*package* *buffer-package*))
     (read-from-string string)))
 
+(defun symbol-from-string (string)
+  "Read string in the *BUFFER-PACKAGE*"
+  (let ((*package* *buffer-package*))
+    (find-symbol (string-upcase string))))
+
 (defun to-string (string)
   "Write string in the *BUFFER-PACKAGE*."
   (let ((*package* *buffer-package*))
@@ -283,7 +288,9 @@
 	  *** **  ** *  * (car values)
 	  /// //  // /  / values)
     (cond ((null values) "; No value")
-          (t (format nil "~{~S~^~%~}" values)))))
+          (t
+           (let ((*package* *buffer-package*))
+             (format nil "~{~S~^~%~}" values))))))
 
 ;;;; Compilation Commands.
 
@@ -368,10 +375,21 @@
   (print-output-to-string (lambda () (describe object))))
 
 (defslimefun describe-symbol (symbol-name)
-  (print-description-to-string (from-string symbol-name)))
+  (print-description-to-string (symbol-from-string symbol-name)))
 
 (defslimefun describe-function (symbol-name)
-  (print-description-to-string (symbol-function (from-string symbol-name))))
+  (print-description-to-string
+   (symbol-function (symbol-from-string symbol-name))))
+
+(defslimefun documentation-symbol (symbol-name)
+  (let ((*package* *buffer-package*))
+    (let ((vdoc (documentation (symbol-from-string symbol-name) 'variable))
+          (fdoc (documentation (symbol-from-string symbol-name) 'function)))
+      (and (or vdoc fdoc)
+           (concatenate 'string
+                        fdoc
+                        (and vdoc fdoc '(#\Newline #\Newline))
+                        vdoc)))))
 
 ;;; Macroexpansion
 
@@ -456,7 +474,7 @@
             (if pos (subseq string 0 pos) nil))
           (search "::" string)))
 
-(defun find-symbol-designator (string default-package)
+(defun find-symbol-designator (string &optional (default-package *buffer-package*))
   "Return the symbol corresponding to the symbol designator STRING.
 If string is not package qualified use DEFAULT-PACKAGE for the
 resolution.  Return nil if no such symbol exists."





More information about the slime-cvs mailing list