[slime-cvs] CVS slime
CVS User heller
heller at common-lisp.net
Sat Jan 10 12:25:16 UTC 2009
Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv5531
Modified Files:
ChangeLog swank-abcl.lisp swank-allegro.lisp
swank-backend.lisp swank-clisp.lisp swank-cmucl.lisp
swank-corman.lisp swank-ecl.lisp swank-lispworks.lisp
swank-openmcl.lisp swank-sbcl.lisp swank-scl.lisp swank.lisp
Log Message:
* swank-backend.lisp (swank-compile-file): Take output-file as
additional argument. Update backends accordingly.
* swank.lisp (*fasl-directory*): New variable.
(fasl-pathname): New function.
(compile-file-for-emacs): Use it.
--- /project/slime/cvsroot/slime/ChangeLog 2009/01/10 12:17:41 1.1660
+++ /project/slime/cvsroot/slime/ChangeLog 2009/01/10 12:25:15 1.1661
@@ -4,7 +4,17 @@
2009-01-10 Helmut Eller <heller at common-lisp.net>
+ * swank-backend.lisp (swank-compile-file): Take output-file as
+ additional argument. Update backends accordingly.
+
+ * swank.lisp (*fasl-directory*): New variable.
+ (fasl-pathname): New function.
+ (compile-file-for-emacs): Use it.
+
+2009-01-10 Helmut Eller <heller at common-lisp.net>
+
* swank-backend.lisp (set-default-initial-binding): New function.
+
* swank.lisp (setup-stream-indirection): Use it
2009-01-09 Helmut Eller <heller at common-lisp.net>
--- /project/slime/cvsroot/slime/swank-abcl.lisp 2009/01/08 10:33:43 1.62
+++ /project/slime/cvsroot/slime/swank-abcl.lisp 2009/01/10 12:25:16 1.63
@@ -327,14 +327,16 @@
(defvar *abcl-signaled-conditions*)
-(defimplementation swank-compile-file (filename load-p external-format)
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
(declare (ignore external-format))
(let ((jvm::*resignal-compiler-warnings* t)
(*abcl-signaled-conditions* nil))
(handler-bind ((warning #'handle-compiler-warning))
(let ((*buffer-name* nil)
- (*compile-filename* filename))
- (multiple-value-bind (fn warn fail) (compile-file filename)
+ (*compile-filename* input-file))
+ (multiple-value-bind (fn warn fail)
+ (compile-file input-file :output-file output-file)
(values fn warn
(or fail
(and load-p
--- /project/slime/cvsroot/slime/swank-allegro.lisp 2009/01/10 12:17:41 1.123
+++ /project/slime/cvsroot/slime/swank-allegro.lisp 2009/01/10 12:25:16 1.124
@@ -285,11 +285,14 @@
)
(funcall function)))
-(defimplementation swank-compile-file (filename load-p external-format)
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
(with-compilation-hooks ()
(let ((*buffer-name* nil)
- (*compile-filename* filename))
- (compile-file *compile-filename* :load-after-compile load-p
+ (*compile-filename* input-file))
+ (compile-file *compile-filename*
+ :output-file output-file
+ :load-after-compile load-p
:external-format external-format))))
(defun call-with-temp-file (fn)
--- /project/slime/cvsroot/slime/swank-backend.lisp 2009/01/10 12:17:41 1.168
+++ /project/slime/cvsroot/slime/swank-backend.lisp 2009/01/10 12:25:16 1.169
@@ -392,8 +392,9 @@
Should return T on successfull compilation, NIL otherwise.
")
-(definterface swank-compile-file (pathname load-p external-format)
- "Compile PATHNAME signalling COMPILE-CONDITIONs.
+(definterface swank-compile-file (input-file output-file load-p
+ external-format)
+ "Compile INPUT-FILE signalling COMPILE-CONDITIONs.
If LOAD-P is true, load the file after compilation.
EXTERNAL-FORMAT is a value returned by find-external-format or
:default.
--- /project/slime/cvsroot/slime/swank-clisp.lisp 2009/01/08 10:33:43 1.87
+++ /project/slime/cvsroot/slime/swank-clisp.lisp 2009/01/10 12:25:16 1.88
@@ -625,11 +625,14 @@
:message (princ-to-string condition)
:location (compiler-note-location))))
-(defimplementation swank-compile-file (filename load-p external-format)
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
(with-compilation-hooks ()
(with-compilation-unit ()
(multiple-value-bind (fasl-file warningsp failurep)
- (compile-file filename :external-format external-format)
+ (compile-file input-file
+ :output-file output-file
+ :external-format external-format)
(values fasl-file warningsp
(or failurep
(and load-p
--- /project/slime/cvsroot/slime/swank-cmucl.lisp 2009/01/08 10:33:44 1.209
+++ /project/slime/cvsroot/slime/swank-cmucl.lisp 2009/01/10 12:25:16 1.210
@@ -379,19 +379,21 @@
(c::warning #'handle-notification-condition))
(funcall function))))
-(defimplementation swank-compile-file (filename load-p external-format)
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
(declare (ignore external-format))
- (clear-xref-info filename)
+ (clear-xref-info input-file)
(with-compilation-hooks ()
(let ((*buffer-name* nil)
(ext:*ignore-extra-close-parentheses* nil))
(multiple-value-bind (output-file warnings-p failure-p)
- (compile-file filename)
+ (compile-file input-file :output-file output-file)
(values output-file warnings-p
(or failure-p
(when load-p
;; Cache the latest source file for definition-finding.
- (source-cache-get filename (file-write-date filename))
+ (source-cache-get input-file
+ (file-write-date input-file))
(not (load output-file)))))))))
(defimplementation swank-compile-string (string &key buffer position filename
--- /project/slime/cvsroot/slime/swank-corman.lisp 2009/01/08 10:33:44 1.22
+++ /project/slime/cvsroot/slime/swank-corman.lisp 2009/01/10 12:25:16 1.23
@@ -361,13 +361,14 @@
(list :error "No location"))))))))
(funcall fn)))
-(defimplementation swank-compile-file (*compile-filename* load-p
- external-format)
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
(declare (ignore external-format))
(with-compilation-hooks ()
- (let ((*buffer-name* nil))
+ (let ((*buffer-name* nil)
+ (*compile-filename* input-file))
(multiple-value-bind (output-file warnings? failure?)
- (compile-file *compile-filename*)
+ (compile-file input-file :output-file output-file)
(values output-file warnings?
(or failure? (and load-p (load output-file))))))))
--- /project/slime/cvsroot/slime/swank-ecl.lisp 2009/01/08 10:33:44 1.37
+++ /project/slime/cvsroot/slime/swank-ecl.lisp 2009/01/10 12:25:16 1.38
@@ -138,12 +138,13 @@
(handler-bind ((warning #'handle-compiler-warning))
(funcall function)))
-(defimplementation swank-compile-file (*compile-filename* load-p
- external-format)
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
(declare (ignore external-format))
(with-compilation-hooks ()
- (let ((*buffer-name* nil))
- (compile-file *compile-filename* :load t))))
+ (let ((*buffer-name* nil)
+ (*compile-filename* input-file))
+ (compile-file input-file :output-file output-file :load t))))
(defimplementation swank-compile-string (string &key buffer position filename
policy)
--- /project/slime/cvsroot/slime/swank-lispworks.lisp 2009/01/10 12:17:41 1.127
+++ /project/slime/cvsroot/slime/swank-lispworks.lisp 2009/01/10 12:25:16 1.128
@@ -426,9 +426,12 @@
(signal-undefined-functions compiler::*unknown-functions*
,location))))))
-(defimplementation swank-compile-file (filename load-p external-format)
- (with-swank-compilation-unit (filename)
- (compile-file filename :load load-p
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
+ (with-swank-compilation-unit (input-file)
+ (compile-file input-file
+ :output-file output-file
+ :load load-p
:external-format external-format)))
(defvar *within-call-with-compilation-hooks* nil
--- /project/slime/cvsroot/slime/swank-openmcl.lisp 2009/01/10 12:17:41 1.154
+++ /project/slime/cvsroot/slime/swank-openmcl.lisp 2009/01/10 12:25:16 1.155
@@ -261,12 +261,15 @@
(handler-bind ((ccl::compiler-warning 'handle-compiler-warning))
(funcall function)))
-(defimplementation swank-compile-file (filename load-p external-format)
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
(declare (ignore external-format))
(with-compilation-hooks ()
(let ((*buffer-name* nil)
(*buffer-offset* nil))
- (compile-file filename :load load-p))))
+ (compile-file input-file
+ :output-file output-file
+ :load load-p))))
(defimplementation frame-var-value (frame var)
(block frame-var-value
--- /project/slime/cvsroot/slime/swank-sbcl.lisp 2009/01/08 10:33:44 1.231
+++ /project/slime/cvsroot/slime/swank-sbcl.lisp 2009/01/10 12:25:16 1.232
@@ -485,16 +485,19 @@
(defvar *trap-load-time-warnings* nil)
-(defimplementation swank-compile-file (pathname load-p external-format)
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
(handler-case
(multiple-value-bind (output-file warnings-p failure-p)
(with-compilation-hooks ()
- (compile-file pathname :external-format external-format))
+ (compile-file input-file :output-file output-file
+ :external-format external-format))
(values output-file warnings-p
(or failure-p
(when load-p
;; Cache the latest source file for definition-finding.
- (source-cache-get pathname (file-write-date pathname))
+ (source-cache-get input-file
+ (file-write-date input-file))
(not (load output-file))))))
(sb-c:fatal-compiler-error () nil)))
--- /project/slime/cvsroot/slime/swank-scl.lisp 2009/01/08 10:33:44 1.31
+++ /project/slime/cvsroot/slime/swank-scl.lisp 2009/01/10 12:25:16 1.32
@@ -438,17 +438,21 @@
(c::warning #'handle-notification-condition))
(funcall function))))
-(defimplementation swank-compile-file (filename load-p external-format)
+(defimplementation swank-compile-file (input-file output-file
+ load-p external-format)
(with-compilation-hooks ()
(let ((*buffer-name* nil)
(ext:*ignore-extra-close-parentheses* nil))
(multiple-value-bind (output-file warnings-p failure-p)
- (compile-file filename :external-format external-format)
+ (compile-file input-file
+ :output-file output-file
+ :external-format external-format)
(values output-file warnings-p
(or failure-p
(when load-p
;; Cache the latest source file for definition-finding.
- (source-cache-get filename (file-write-date filename))
+ (source-cache-get input-file
+ (file-write-date input-file))
(not (load output-file)))))))))
(defimplementation swank-compile-string (string &key buffer position filename
--- /project/slime/cvsroot/slime/swank.lisp 2009/01/10 12:17:41 1.630
+++ /project/slime/cvsroot/slime/swank.lisp 2009/01/10 12:25:16 1.631
@@ -29,6 +29,7 @@
;; These are user-configurable variables:
#:*communication-style*
#:*dont-close*
+ #:*fasl-directory*
#:*log-events*
#:*log-output*
#:*use-dedicated-output-stream*
@@ -2724,7 +2725,7 @@
(check-type successp boolean)
(make-compilation-result (reverse notes) successp seconds))))
-(defslimefun compile-file-for-emacs (filename load-p)
+(defslimefun compile-file-for-emacs (filename load-p &optional options)
"Compile FILENAME and, when LOAD-P, load the result.
Record compiler notes signalled as `compiler-condition's."
(with-buffer-syntax ()
@@ -2733,12 +2734,32 @@
(let ((pathname (filename-to-pathname filename))
(*compile-print* nil) (*compile-verbose* t))
(multiple-value-bind (output-pathname warnings? failure?)
- (swank-compile-file pathname load-p
+ (swank-compile-file pathname
+ (fasl-pathname pathname options)
+ load-p
(or (guess-external-format pathname)
:default))
(declare (ignore output-pathname warnings?))
(not failure?)))))))
+(defvar *fasl-directory* nil
+ "Directory where swank should place fasl files.")
+
+(defun fasl-pathname (input-file options)
+ (cond ((getf options :fasl-directory)
+ (let* ((str (getf options :fasl-directory))
+ (dir (filename-to-pathname str)))
+ (assert (char= (aref str (1- (length str))) #\/))
+ (compile-file-pathname input-file :output-file dir)))
+ (*fasl-directory*
+ (compile-file-pathname input-file :output-file *fasl-directory*))
+ (t
+ (compile-file-pathname input-file))))
+
+(pathname-to-filename
+ (compile-file-pathname "y.lisp"
+ :output-file (filename-to-pathname "/tmp/x/")))
+
(defslimefun compile-string-for-emacs (string buffer position filename policy)
"Compile STRING (exerpted from BUFFER at POSITION).
Record compiler notes signalled as `compiler-condition's."
More information about the slime-cvs
mailing list