[slime-cvs] CVS update: slime/swank.lisp
Dan Barlow
dbarlow at common-lisp.net
Thu Dec 11 02:20:30 UTC 2003
Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv4616
Modified Files:
swank.lisp
Log Message:
* swank.lisp (swank-compiler): new function abstracts commonality
between swank-compile-{file, string}.
(swank-load-system): call swank-compiler to load asdf system
Date: Wed Dec 10 21:20:30 2003
Author: dbarlow
Index: slime/swank.lisp
diff -u slime/swank.lisp:1.77 slime/swank.lisp:1.78
--- slime/swank.lisp:1.77 Wed Dec 10 08:24:27 2003
+++ slime/swank.lisp Wed Dec 10 21:20:30 2003
@@ -454,28 +454,31 @@
:severity (severity condition)
:location (location condition)))
-(defslimefun swank-compile-file (filename load-p)
- "Compile FILENAME and, when LOAD-P, load the result.
-Record compiler notes signalled as `compiler-condition's."
+(defun swank-compiler (function)
(clear-compiler-notes)
(multiple-value-bind (result usecs)
(handler-bind ((compiler-condition #'record-note-for-condition))
- (measure-time-interval (lambda ()
- (compile-file-for-emacs filename load-p))))
+ (measure-time-interval function))
(list (to-string result)
(format nil "~,2F" (/ usecs 1000000.0)))))
+(defslimefun swank-compile-file (filename load-p)
+ "Compile FILENAME and, when LOAD-P, load the result.
+Record compiler notes signalled as `compiler-condition's."
+ (swank-compiler (lambda () (compile-file-for-emacs filename load-p))))
+
(defslimefun swank-compile-string (string buffer position)
"Compile STRING (exerpted from BUFFER at POSITION).
Record compiler notes signalled as `compiler-condition's."
- (clear-compiler-notes)
- (multiple-value-bind (result usecs)
- (handler-bind ((compiler-condition #'record-note-for-condition))
- (measure-time-interval
- (lambda ()
- (compile-string-for-emacs string :buffer buffer :position position))))
- (list (to-string result)
- (format nil "~,2F" (/ usecs 1000000.0)))))
+ (swank-compiler
+ (lambda ()
+ (compile-string-for-emacs string :buffer buffer :position position))))
+
+(defslimefun swank-load-system (system)
+ "Compile and load SYSTEM using ASDF.
+Record compiler notes signalled as `compiler-condition's."
+ (swank-compiler (lambda () (compile-system-for-emacs system))))
+
;;;; Macroexpansion
More information about the slime-cvs
mailing list