Permalink
Browse files

* 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.
  • Loading branch information...
Helmut Eller
Helmut Eller committed Jan 10, 2009
1 parent 01ce2bc commit f761f28fa16dd8eff6cdbefeecba4f9428317163
Showing with 73 additions and 33 deletions.
  1. +10 −0 ChangeLog
  2. +5 −3 swank-abcl.lisp
  3. +6 −3 swank-allegro.lisp
  4. +3 −2 swank-backend.lisp
  5. +5 −2 swank-clisp.lisp
  6. +6 −4 swank-cmucl.lisp
  7. +5 −4 swank-corman.lisp
  8. +5 −4 swank-ecl.lisp
  9. +6 −3 swank-lispworks.lisp
  10. +5 −2 swank-openmcl.lisp
  11. +6 −3 swank-sbcl.lisp
  12. +7 −3 swank-scl.lisp
  13. +4 −0 swank.lisp
View
@@ -2,9 +2,19 @@
* swank.lisp (do-symbols*): Wrap body in TAGBODY.
+2009-01-10 Helmut Eller <heller@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@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@common-lisp.net>
View
@@ -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
View
@@ -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)
View
@@ -392,8 +392,9 @@ value.
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.
View
@@ -625,11 +625,14 @@ Execute BODY with NAME's function slot set to FUNCTION."
: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
View
@@ -379,19 +379,21 @@ NIL if we aren't compiling from a buffer.")
(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
View
@@ -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))))))))
View
@@ -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)
View
@@ -426,9 +426,12 @@ Return NIL if the symbol is unbound."
(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
View
@@ -261,12 +261,15 @@ condition."
(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
View
@@ -485,16 +485,19 @@ compiler state."
(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)))
View
@@ -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
View
@@ -2756,6 +2756,10 @@ Record compiler notes signalled as `compiler-condition's."
(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."

0 comments on commit f761f28

Please sign in to comment.