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

Luke Gorrie lgorrie at common-lisp.net
Tue Oct 5 21:37:39 UTC 2004


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

Modified Files:
	swank.lisp 
Log Message:
(arglist-for-echo-area): Handle errors and return a message.

(parse-symbol): Recognise an empty package name as the KEYWORD
package.

Date: Tue Oct  5 23:37:36 2004
Author: lgorrie

Index: slime/swank.lisp
diff -u slime/swank.lisp:1.245 slime/swank.lisp:1.246
--- slime/swank.lisp:1.245	Fri Oct  1 14:02:29 2004
+++ slime/swank.lisp	Tue Oct  5 23:37:36 2004
@@ -992,7 +992,10 @@
   "Find the symbol named STRING.
 Return the symbol and a flag indicateing if the symbols was found."
   (multiple-value-bind (sname pname) (tokenize-symbol string)
-    (find-symbol (casify sname) (if pname (casify pname) package))))
+    (find-symbol (casify sname)
+                 (cond ((string= pname "") "KEYWORD")
+                       (pname              (casify pname))
+                       (t                  package)))))
 
 (defun parse-symbol-or-lose (string &optional (package *package*))
   (multiple-value-bind (symbol status) (parse-symbol string package)
@@ -1045,9 +1048,12 @@
 
 (defslimefun arglist-for-echo-area (names)
   "Return the arglist for the first function, macro, or special-op in NAMES."
-  (with-buffer-syntax ()
-    (let ((name (find-if #'valid-operator-name-p names)))
-      (if name (format-arglist-for-echo-area (parse-symbol name) name)))))
+  (handler-case
+      (with-buffer-syntax ()
+        (let ((name (find-if #'valid-operator-name-p names)))
+          (if name (format-arglist-for-echo-area (parse-symbol name) name))))
+    (error (cond)
+      (format nil "ARGLIST: ~A" cond))))
 
 (defun format-arglist-for-echo-area (symbol name)
   "Return SYMBOL's arglist as string for display in the echo area.
@@ -2540,9 +2546,8 @@
 
 (defmethod inspect-for-emacs ((object cons) (inspector t))
   (declare (ignore inspector))
-  (if (or (consp (cdr object))
-          (null (cdr object)))
-      (inspect-for-emacs-nontrivial-list object)
+  (if (listp object)
+      (inspect-for-emacs-list object)
       (inspect-for-emacs-simple-cons object)))
 
 (defun inspect-for-emacs-simple-cons (cons)
@@ -2551,7 +2556,7 @@
             (:newline)
             "Cdr: " (:value ,(cdr cons)))))
 
-(defun inspect-for-emacs-nontrivial-list (list)
+(defun inspect-for-emacs-list (list)
   (let ((circularp nil)
         (length 0)
         (seen (make-hash-table :test 'eq))





More information about the slime-cvs mailing list