[ESS-bugs] ess-mode 5.3.6; opening file with tramp mode -> error

David Reitter david.reitter at gmail.com
Mon Oct 1 18:08:22 CEST 2007


Stephen,

this year-old issue has popped up again.

When I start Aquamacs from the command line and then autoload R-mode  
when accessing an .R file via tramp, I get the "opening directory"  
error again, and I believe it is, once more, due to a tramp-style  
default-directory and an element of "." in the exec-path.

The debugger trace is:

Debugger entered--Lisp error: (file-error "Opening directory" "no  
such file or directory" "/ssh:xxx at ssh.xxx.ed.ac.uk:/home/xxx/PhD/stats")
   file-name-all-completions("Splus" ".")
   ess-find-exec-completions("Splus")
   mapcar(ess-find-exec-completions ("Splus"))
   ess-s-versions-create()
   byte-code("ƒ ÆÇMˆÈÉMˆÊËMˆÌÍMˆ‚8 	 
Î=ƒ, ÆÇMˆÊËMˆÌÍMˆ‚8 ÆÇMˆÊËMˆÌÍMˆÏÌMˆÐÊMˆÃ\nBÑÃ!„L ÒÒ‰Ó


*ƒb Ô  
*Õ +‚f Ö *× ØÙÚÛ\"!‰ƒ
 ÙÜ
\"
,Ý-Þß,B#ˆ)+à ˆ.ƒ  áâãä#ˆáåãä#ˆáæãä#ˆä/ç0ƒ¯ áèé\"ˆÒ‡" [ess- 
microsoft-p system-type current-load-list ess-r-versions-created R- 
newest-list ess-versions-created S S+6 Sqpe Sqpe+6 s-mode S+6-mode s- 
transcript-mode S+6-transcript-mode gnu/linux S-transcript-mode S- 
mode boundp nil ("R-newest") ess-sqpe-versions-create ess-find-rterm  
ess-s-versions-create ess-r-versions-create ess-flatten-list mapcar # 
[(x) "Á!
 J‡" [x boundp] 2] (R-newest-list ess-r-versions-created ess-s- 
versions-created) #[(x) "ÁÂ!Ã#‡" [x vector intern t] 4] easy-menu- 
add-item ("Start Process") "Other" ess-check-R-program-name add-hook  
ess-mode-hook turn-on-font-lock t ess-transcript-mode-hook inferior- 
ess-mode-hook "always" ess-post-run-hook (lambda nil (if ... ...))  
ess-s-versions-created ess-rterm-version-paths new-menu ess-mode-menu  
window-system inferior-ess-font-lock-input ess-keep-dump-files] 6)
   R-mode()
   set-auto-mode-0(R-mode nil)
   set-auto-mode()
   normal-mode(t)
   after-find-file(nil t)
   find-file-noselect-1(#<buffer stats2.R> "/ 
ssh:xxx at ssh.xxx.ed.ac.uk:/home/xxx/PhD/stats/stats2.R" nil nil "/ 
ssh:xxx at ssh.xxx.ed.ac.uk:/amd/nfs/xxx/disk/ptn053/xxx/PhD/stats/ 
stats2.R" ((67 . 58701) (-1 0)))
   find-file-noselect("/ssh:xxx at ssh.xxx.ed.ac.uk:/home/xxx/PhD/stats/ 
stats2.R" nil nil nil)
   find-file("/ssh:xxx at ssh.xxx.ed.ac.uk:/home/xxx/PhD/stats/stats2.R")


If I manipulate `ess-find-exec-completions' to show me the `default- 
directory', it is "/ssh:xxx at ssh.xxx.ed.ac.uk:/home/xxx/PhD/stats/".
The `exec-path' at the time is

("/Library/Frameworks/Python.framework/Versions/Current/bin" "/opt/ 
local/lib/postgresql82/bin" "/opt/local/bin" "/opt/local/sbin" "/bin"  
"/sbin" "/usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/texbin" "/Users/ 
dr/Applications" "/Users/dr/Applications/bin" "/Users/dr/Projects/ 
openccg/bin" "/usr/texbin/powerpc-apple-darwin-current" "" "/Library/ 
Frameworks/Python.framework/Versions/Current/bin" "/opt/local/lib/ 
postgresql82/bin" "/opt/local/bin" "/opt/local/sbin" "/bin" "/sbin" "/ 
usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/texbin" "/Users/dr/ 
Applications" "/Users/dr/Applications/bin" "/Users/dr/Projects/ 
openccg/bin" "/usr/texbin/powerpc-apple-darwin-current" "" "/Library/ 
Frameworks/Python.framework/Versions/Current/bin" "/opt/local/lib/ 
postgresql82/bin" "/opt/local/bin" "/opt/local/sbin" "/bin" "/sbin" "/ 
usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/texbin" "/Users/dr/ 
Applications" "/Users/dr/Applications/bin" "/Users/dr/Projects/ 
openccg/bin" "/usr/texbin/powerpc-apple-darwin-current" "" "." "/ 
Applications/Aquamacs Emacs.app/Contents/MacOS/libexec" "/ 
Applications/Aquamacs Emacs.app/Contents/MacOS/bin" "/usr/local/teTeX/ 
bin/powerpc-apple-darwin-current")

(I know, some of this doesn't make sense - I don't know why it has  
all of these double entries.)


- David



--
http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
http://aquamacs.org/donate -- Could we help you? Return the favor and  
support the Aquamacs Project!




On 16 May 2006, at 17:02, Stephen Eglen wrote:

>
> Thanks David.
>
>>
>> To be more precise: exec-path contains a "" element. It may contain a
>> nil, as per doc (and if the "" was nil, you'd still get an error
>> there I believe):
>>
>> "*List of directories to search programs to run in subprocesses.
>> Each element is a string (directory name) or nil (try default
>> directory)."
>>
>> Now, you're going through exec-path and looking up files there.
>> You're calling `file-name-all-completions', in this case with a nil
>> argument, which leads to file-name-all-completions using the current
>> working dir.
>>
>> This working dir, at that point, is a tramp URL rather than a normal
>> file name. That's because we're autoloading ESS, and it gets loaded
>> just when I access a .R file over tramp. So when you call `(file- 
>> name-
>> all-completions "R-1" "")', you get the error because that function
>> doesn't seem to be able to deal with tramp working directories.
>>
>> Do you agree with me that this is a bug in Emacs?
>
> Hmm.  Is it a bug in Emacs or Tramp?  it sounds more like a tramp bug
> to me, since the doc of file-name-all-completions does nothing to
> suggest that a value of "" or nil for directory will convert to
> default-directory; that comes from exec-path.
>
> Ignoring ESS for now, if you load a remote file using tramp, what is
> the value of default-directory in that file's buffer?
>
>
>> But I would still write something like
>>
>> 	    (setq ess-tmp-dir (nth i ess-exec-path))
>> 	    (if (and (> (length ess-tmp-dir) 0)
>> 		     (file-exists-p ess-tmp-dir)) (progn
>>
>>
>> because you don't actually want to include whatever is the current
>> working directory into the list of completion items, because this
>> function is executed upon loading ess-site, and it shouldn't matter
>> what happens to be the current directory. Right?
>
> yes, I'd go along with that.  If you add that code, does it solve your
> autoloading problem?  If so, let me know, I'll put in, then get
> ess-core to test it out.
>
> Stephen



More information about the ESS-bugs mailing list