[slime-cvs] CVS slime

crhodes crhodes at common-lisp.net
Thu Mar 23 07:14:13 UTC 2006


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

Modified Files:
	ChangeLog slime.el swank.lisp 
Log Message:
Allow swank:ed-in-emacs to take cons function names.  (This adds some 
ambiguity with conses representing filenames and positions)


--- /project/slime/cvsroot/slime/ChangeLog	2006/03/23 05:02:54	1.867
+++ /project/slime/cvsroot/slime/ChangeLog	2006/03/23 07:14:13	1.868
@@ -1,3 +1,13 @@
+2006-03-23  Christophe Rhodes <csr21 at cam.ac.uk>
+
+	* swank.lisp (ed-in-emacs): Allow conses as function names.
+	Ensure that there is a connection to emacs before sending the
+	:ed message.
+
+	* slime.el (slime-edit-definition): read names, not symbols.
+	(slime-ed): handle conses whose car is not a string as function
+	names.
+
 2006-03-23  Matthias Koeppe  <mkoeppe at mail.math.uni-magdeburg.de>
 
 	* slime.el (slime-qualify-cl-symbol-name): Strip leading colon
--- /project/slime/cvsroot/slime/slime.el	2006/03/23 05:01:40	1.602
+++ /project/slime/cvsroot/slime/slime.el	2006/03/23 07:14:13	1.603
@@ -6281,10 +6281,10 @@
   dspec location)
 
 (defun slime-edit-definition (name &optional where)
-  "Lookup the definition of the symbol at point.  
-If there's no symbol at point, or a prefix argument is given, then the
+  "Lookup the definition of the name at point.  
+If there's no name at point, or a prefix argument is given, then the
 function name is prompted."
-  (interactive (list (slime-read-symbol-name "Symbol: ")))
+  (interactive (list (slime-read-symbol-name "Name: ")))
   (let ((definitions (slime-eval `(swank:find-definitions-for-emacs ,name))))
     (if (null definitions)
         (if slime-edit-definition-fallback-function
@@ -6426,7 +6426,7 @@
   A filename (string),
   A list (FILENAME LINE [COLUMN]),
   A list (FILENAME :charpos CHARPOS),
-  A function name (symbol),
+  A function name (symbol or cons),
   nil.
 
 This is for use in the implementation of COMMON-LISP:ED."
@@ -6439,7 +6439,7 @@
       (select-frame slime-ed-frame))
     (cond ((stringp what)
            (find-file (slime-from-lisp-filename what)))
-          ((consp what)
+          ((and (consp what) (stringp (first what)))
            (find-file (first (slime-from-lisp-filename what)))
            (cond
             ((eql (second what) :charpos)
@@ -6455,6 +6455,8 @@
                  (forward-char 1))))))
           ((and what (symbolp what))
            (slime-edit-definition (symbol-name what)))
+          ((consp what)
+           (slime-edit-definition (prin1-to-string what)))
           (t nil))))                    ; nothing in particular
 
 
--- /project/slime/cvsroot/slime/swank.lisp	2006/03/22 23:18:53	1.370
+++ /project/slime/cvsroot/slime/swank.lisp	2006/03/23 07:14:13	1.371
@@ -2244,7 +2244,7 @@
 WHAT can be:
   A pathname or a string,
   A list (PATHNAME-OR-STRING LINE [COLUMN]),
-  A function name (symbol),
+  A function name (symbol or cons),
   NIL.
 
 Returns true if it actually called emacs, or NIL if not."
@@ -2256,9 +2256,14 @@
                  ((pathname-or-string-p what)
                   (canonicalize-filename what))
                  ((symbolp what) what)
+                 ((consp what) what)
                  (t (return-from ed-in-emacs nil)))))
-      (send-oob-to-emacs `(:ed ,target))
-      t)))
+      (cond
+        (*emacs-connection* (send-oob-to-emacs `(:ed ,target)))
+        ((default-connection)
+         (with-connection ((default-connection))
+           (send-oob-to-emacs `(:ed ,target))))
+        (t nil)))))
 
 (defslimefun value-for-editing (form)
   "Return a readable value of FORM for editing in Emacs.




More information about the slime-cvs mailing list