emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sly ef5211456a 5/5: clasp: Replace TMP host with EXT:TEMPO


From: ELPA Syncer
Subject: [nongnu] elpa/sly ef5211456a 5/5: clasp: Replace TMP host with EXT:TEMPORARY-DIRECTORY when available
Date: Wed, 13 Jul 2022 10:59:19 -0400 (EDT)

branch: elpa/sly
commit ef5211456a59d639c98b2ed42428726d32728ff8
Author: Tarn W. Burton <twburton@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    clasp: Replace TMP host with EXT:TEMPORARY-DIRECTORY when available
    
    Cherry-picked-from: SLIME commit 805c29672c8a1f6c68286ab379359f9ab9ad9dc2
---
 slynk/backend/clasp.lisp | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/slynk/backend/clasp.lisp b/slynk/backend/clasp.lisp
index 102f1db3e8..0e9619cc9a 100644
--- a/slynk/backend/clasp.lisp
+++ b/slynk/backend/clasp.lisp
@@ -33,7 +33,9 @@
     (pushnew :profile *features*))
   (when (probe-file "sys:serve-event")
     (require :serve-event)
-    (pushnew :serve-event *features*)))
+    (pushnew :serve-event *features*))
+  (when (find-symbol "TEMPORARY-DIRECTORY" "EXT")
+    (pushnew :temporary-directory *features*)))
 
 (declaim (optimize (debug 3)))
 
@@ -265,13 +267,20 @@
       (((or error warning) #'handle-compiler-condition))
     (funcall function)))
 
+(defun mkstemp (name)
+  (ext:mkstemp #+temporary-directory
+               (namestring (make-pathname :name name
+                                          :defaults (ext:temporary-directory)))
+               #-temporary-directory
+               (concatenate 'string "tmp:" name)))
+
 (defimplementation slynk-compile-file (input-file output-file
                                        load-p external-format
                                        &key policy)
   (declare (ignore policy))
   (format t "Compiling file input-file = ~a   output-file = ~a~%" input-file 
output-file)
   ;; Ignore the output-file and generate our own
-  (let ((tmp-output-file (compile-file-pathname (si:mkstemp 
"TMP:clasp-slynk-compile-file-"))))
+  (let ((tmp-output-file (compile-file-pathname (mkstemp 
"clasp-slynk-compile-file-"))))
     (format t "Using tmp-output-file: ~a~%" tmp-output-file)
     (multiple-value-bind (fasl warnings-p failure-p)
         (with-compilation-hooks ()
@@ -298,7 +307,7 @@
   (with-compilation-hooks ()
     (let ((*buffer-name* buffer)        ; for compilation hooks
           (*buffer-start-position* position))
-      (let ((tmp-file (si:mkstemp "TMP:clasp-slynk-tmpfile-"))
+      (let ((tmp-file (mkstemp "clasp-slynk-tmpfile-"))
             (fasl-file)
             (warnings-p)
             (failure-p))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]