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

Luke Gorrie lgorrie at common-lisp.net
Mon Jan 19 20:12:29 UTC 2004


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

Modified Files:
	swank.lisp 
Log Message:
(ed-in-emacs): New command with the same interface as CL:ED.

Date: Mon Jan 19 15:12:29 2004
Author: lgorrie

Index: slime/swank.lisp
diff -u slime/swank.lisp:1.103 slime/swank.lisp:1.104
--- slime/swank.lisp:1.103	Sun Jan 18 02:17:15 2004
+++ slime/swank.lisp	Mon Jan 19 15:12:28 2004
@@ -423,6 +423,9 @@
        (terpri output)
        (force-output output)))))
 
+(defun send-oob-to-emacs (object)
+  (send-to-emacs object (connection.socket-io *main-connection*)))
+
 (defun prin1-to-string-for-emacs (object)
   (with-standard-io-syntax
     (let ((*print-case* :downcase)
@@ -764,6 +767,13 @@
            (let ((*package* *buffer-package*))
              (format nil "~{~S~^~%~}" values))))))
 
+(defslimefun ed-in-emacs (&optional what)
+  "Edit WHAT in Emacs.
+WHAT can be a filename (pathname or string) or function name (symbol)."
+  (send-oob-to-emacs `(:ed ,(if (pathnamep what)
+                                (canonicalize-filename what)
+                                what))))
+
 
 ;;;; Compilation Commands.
 
@@ -825,7 +835,6 @@
 Record compiler notes signalled as `compiler-condition's."
   (swank-compiler  (lambda ()  (compile-system-for-emacs system))))
 
-
 
 ;;;; Macroexpansion
 
@@ -997,7 +1006,12 @@
   "Make an apropos search for Emacs.
 The result is a list of property lists."
   (mapcan (listify #'briefly-describe-symbol-for-emacs)
-          (sort (apropos-symbols name external-only package)
+          (sort (apropos-symbols name
+                                 external-only
+                                 (if package
+                                     (or (find-package (read-from-string package))
+                                         (error "No such package: ~S" package))
+                                     nil))
                 #'present-symbol-before-p)))
 
 (defun briefly-describe-symbol-for-emacs (symbol)
@@ -1044,7 +1058,7 @@
   (remove-if (lambda (sym)
                (or (keywordp sym) 
                    (and external-only
-                        (not (equal (symbol-package sym) *buffer-package*))
+;;                        (not (equal (symbol-package sym) *buffer-package*))
                         (not (symbol-external-p sym)))))
              (apropos-list string package)))
 





More information about the slime-cvs mailing list