Helmut Eller e9626484@stud3.tuwien.ac.at writes:
Peter Seibel peter@javamonkey.com writes:
Here's the patch; please let me know what you think.
I think this looks good.
It's possible that the buffer-name is different from the filename, e.g. "foo.lisp<3>", and I think this case is not covered by the current approach. But that's pretty uncommon. You could probably pass the buffer-file-name instead of the directory just in case the actual filename is ever needed.
What about if instead of (buffer-name) in slime.el we use (or (buffer-file-name) (buffer-name))?
Only a minor detail:
-(defimplementation swank-compile-string (string &key buffer position) +(defimplementation swank-compile-string (string &key buffer position (directory *default-pathname-defaults*)) ;; We store the source buffer in excl::*source-pathname* as a string ;; of the form <buffername>:<start-offset>. Quite ugly encoding, but ;; the fasl file is corrupted if we use some other datatype. (with-compilation-hooks () (let ((*buffer-name* buffer) (*buffer-start-position* position)
(*buffer-string* string))
(*buffer-string* string)
(*default-pathname-defaults* (merge-pathnames (pathname directory)))) (compile-from-temp-file
this might not work so well if the buffer-file-name is nil.
You mean because we always pass a directory argument, even if its only NIL and thus the will never happen? I guess I should just bind *default-pathname-defaults* to (if directory (merge-pathnames (pathname directory)) *default-pathname-defaults*) and take the default value of the directory parameter.
-Peter