Closed PetrKryslUCSD closed 4 years ago
Same thing for C-c C-p (change to the folder of the current buffer).
Here is another example, this time accessing a folder on the Windows file system. The file is included with the key binding C-c C-b from the source file:
julia> include("/cygdrive/c/Users/PK/Documents/work/advanced-finite-element-analysis-of-solids/thread_buffers.jl")
ERROR: could not open file \cygdrive\c\Users\PK\Documents\work\advanced-finite-element-analysis-of-solids\thread_buffers.jl
Stacktrace:
[1] include at .\boot.jl:328 [inlined]
[2] include_relative(::Module, ::String) at .\loading.jl:1105
[3] include(::Module, ::String) at .\Base.jl:31
[4] include(::String) at .\client.jl:432
[5] top-level scope at REPL[6]:1
shell> ls /cygdrive/c/Users/PK/Documents/work/advanced-finite-element-analysis-of-solids/thread_buffers.jl
/cygdrive/c/Users/PK/Documents/work/advanced-finite-element-analysis-of-solids/thread_buffers.jl
The buffer file name is apparently
buffer-file-name is a variable defined in ‘C source code’.
Its value is
"/cygdrive/c/Users/PK/Documents/work/advanced-finite-element-analysis-of-solids/thread_buffers.jl"
Local in buffer thread_buffers.jl; global value is nil
So it seems the name is deduced correctly, but the file cannot be included for some reason.
EDIT: It appears to be a Julia thing. The Julia run in the cygwin terminal is the Windows Julia. Evidently it doesn't know how to handle the path.
It seems that absolute paths are a problem for Julia running under cygwin. Would be difficult to change the mechanism in julia-repl to run the includes with relative pathnames?
cf https://github.com/JuliaLang/julia/issues/24128
A workaround I can imagine on the julia-repl side is a simple rewriting rule that replaces "/cygdrive/c/"
with C:/
or something like that. This should be quite easy to implement, but I need some help from you about the details.
Specifically, it would be nice to have a few examples of
M-x (buffer-file-name)
include
in JuliaHere are the results of an experiment I did. The files were included using C-c C-b for the cases that failed (and faithfully represented the buffer-file-name variable). The cases that succeeded were run by recalling the previous command line in the terminal and tweaking it.
First a file located in the cygwin folder structure: This fails julia> include("/home/PK/thread_buffers.jl");
This works julia> include("c:/cygwin64/home/PK/thread_buffers.jl");
Now for a file located in the Windows folder structure: This fails julia> include("/cygdrive/c/Users/PK/Documents/work/advanced-finite-element-analysis-of-solids/another.jl");
This works julia> include("c:/Users/PK/Documents/work/advanced-finite-element-analysis-of-solids/another.jl");
Thank you for your help. Much appreciated. I used to use Emacs, and I would like to return to it. (Even though Sublime Text is a pleasure to work with. It is simply not as easy to extend or customize as Emacs.)
Thanks, so in these examples the "this fails" path comes from (buffer-file-name)
, and the "this works" is what you rewrite it to make it work?
Thanks, so in these examples the "this fails" path comes from (buffer-file-name), and the "this works" is what you rewrite it to make it work?
That is correct.
(reopening, this will be closed by #76 which is not yet merged)
Cygwin Emacs 26: The following error is found when
include
ing a buffer.Manually typing in
include("/cygwin64/home/PK/thread_buffers.jl")
succeeds.