[slime-cvs] CVS slime

heller heller at common-lisp.net
Sat Nov 24 07:58:43 UTC 2007


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv16721

Modified Files:
	swank.lisp ChangeLog 
Log Message:
* swank.lisp (apropos-symbols):  Use simple search instead of
regexps.
(make-apropos-matcher): Used to be make-regexp-matcher.

(*sldb-printer-bindings*): Set *print-right-margin* to
most-positive-fixnum. This prints each frame in the backtrace in a
single long line.  But is suboptimal for other purposes, like
eval-in-frame.

(setup-server): Initialize multiprocessing here, so that is also
done for create-server.



--- /project/slime/cvsroot/slime/swank.lisp	2007/11/23 08:25:52	1.515
+++ /project/slime/cvsroot/slime/swank.lisp	2007/11/24 07:58:43	1.516
@@ -103,7 +103,7 @@
     (*print-array*            . t)
     (*print-lines*            . 10)
     (*print-escape*           . t)
-    (*print-right-margin*     . 70))
+    (*print-right-margin*     . ,most-positive-fixnum))
   "A set of printer variables used in the debugger.")
 
 (defvar *default-worker-thread-bindings* '()
@@ -582,14 +582,10 @@
                                     (coding-system *coding-system*))
   "Start the server and write the listen port number to PORT-FILE.
 This is the entry point for Emacs."
-  (flet ((start-server-aux ()
-           (setup-server 0 (lambda (port) 
-                             (announce-server-port port-file port))
-                         style dont-close 
-                         (find-external-format-or-lose coding-system))))
-    (if (eq style :spawn)
-        (initialize-multiprocessing #'start-server-aux)
-        (start-server-aux))))
+  (setup-server 0 (lambda (port) 
+                    (announce-server-port port-file port))
+                style dont-close 
+                (find-external-format-or-lose coding-system)))
 
 (defun create-server (&key (port default-server-port)
                       (style *communication-style*)
@@ -616,8 +612,11 @@
              (serve-connection socket style dont-close external-format)))
       (ecase style
         (:spawn
-         (spawn (lambda () (loop do (ignore-errors (serve)) while dont-close))
-                :name "Swank"))
+         (initialize-multiprocessing
+          (lambda ()
+            (spawn (lambda () 
+                     (loop do (ignore-errors (serve)) while dont-close))
+                   :name "Swank"))))
         ((:fd-handler :sigio)
          (add-fd-handler socket (lambda () (serve))))
         ((nil) (loop do (serve) while dont-close)))
@@ -2017,7 +2016,7 @@
 (defun safe-condition-message (condition)
   "Safely print condition to a string, handling any errors during
 printing."
-  (let ((*print-pretty* t))
+  (let ((*print-pretty* t) (*print-right-margin* 65))
     (handler-case
         (format-sldb-condition condition)
       (error (cond)
@@ -2481,24 +2480,15 @@
                      (string< (symbol-name x) (symbol-name y))
                      (string< (package-name px) (package-name py)))))))))
 
-(let ((regex-hash (make-hash-table :test #'equal)))
-  (defun compiled-regex (regex-string)
-    (or (gethash regex-string regex-hash)
-        (setf (gethash regex-string regex-hash)
-              (if (zerop (length regex-string))
-                  (lambda (s) (check-type s string) t)
-                  (compile nil (slime-nregex:regex-compile regex-string)))))))
-
-(defun make-regexp-matcher (string case-sensitive)
-  (let* ((case-modifier (if case-sensitive #'string #'string-upcase))
-         (regex (compiled-regex (funcall case-modifier string))))
+(defun make-apropos-matcher (pattern case-sensitive)
+  (let ((chr= (if case-sensitive #'char= #'char-equal)))
     (lambda (symbol)
-      (funcall regex (funcall case-modifier symbol)))))
+      (search pattern (string symbol) :test chr=))))
 
 (defun apropos-symbols (string external-only case-sensitive package)
   (let ((packages (or package (remove (find-package :keyword)
                                       (list-all-packages))))
-        (matcher  (make-regexp-matcher string case-sensitive))
+        (matcher  (make-apropos-matcher string case-sensitive))
         (result))
     (with-package-iterator (next packages :external :internal)
       (loop (multiple-value-bind (morep symbol) (next)
--- /project/slime/cvsroot/slime/ChangeLog	2007/11/23 08:26:31	1.1245
+++ /project/slime/cvsroot/slime/ChangeLog	2007/11/24 07:58:43	1.1246
@@ -1,3 +1,17 @@
+2007-11-24  Helmut Eller  <heller at common-lisp.net>
+
+	* swank.lisp (apropos-symbols):  Use simple search instead of
+	regexps.
+	(make-apropos-matcher): Used to be make-regexp-matcher.
+
+	(*sldb-printer-bindings*): Set *print-right-margin* to
+	most-positive-fixnum. This prints each frame in the backtrace in a
+	single long line.  But is suboptimal for other purposes, like
+	eval-in-frame.
+	
+	(setup-server): Initialize multiprocessing here, so that is also
+	done for create-server.
+
 2007-11-23  Tobias C. Rittweiler  <tcr at freebits.de>
 
 	* swank.lisp (swank-require): Fix typo (:key was used instead of




More information about the slime-cvs mailing list