strings /usr/bin/emacs gives lots of /var/tmp/portage/emacs-21.3-r1/work/emacs-21.3/... When I use certain scripts (rcp.el in my case). it tries to write in that directory. Reproducible: Always Steps to Reproduce:
hi, where can i find the rcp.el you are using?
Created attachment 13132 [details] rcp.el Load this (load-file) and open a file over ssh with something like /r@scp:user@host:/path/file and then wait for emacs to try to auto-save the file... it will try to auto-save it in the wrong path. Anyways, the fact that there are multiple strings from the build environment in the final executable is really wrong.
I also experience this problem. Auto-saving <filename>: Opening output file: no such file or directory, /var/tmp/portage/emacs-21.3-r1/work/emacs-21.3/src/#<filename># Auto-saving...done In addition to failed autosave emacs freezes for ~1 second per failed auto-save which gets to be quite a long while when editing many files remotely. I'm using tramp, i installed it manually from http://tramp.sourceforge.net/. the portage version seemed to be outdated and non-working.
You can put this in your .emacs to work around that: (setq auto-save-file-name-transforms `(("\\`/[^/]*:\\(.+/\\)*\\(.*\\)" ,(expand-file-name "\\2" temporary-file-directory)))) or do M-x customize-group RET auto-save RET , then change "Auto Save File Name Transforms" -> "Replacement" to "/tmp/\2" or something as you like.
As for tramp, I added a workaround in Comment #4 to 50tramp-gentoo.el. However, I have no idea how to fix the problem :(
*** Bug 65663 has been marked as a duplicate of this bug. ***
When using emacs to edit files remotely (e.g., via Tramp), this bug has serious consequences. Emacs will try to auto-save to a non-existent directory: /var/tmp/portage/emacs-21.3-r3/work/emacs-21.3/src/#auto-save-file-name# In order to avoid this, it is necessary to turn off auto-save-mode for that buffer. That's annoying but not as annoying as what happens if you forget to do it. If you forget, emacs may become unusable for up to several minutes. If using tramp to access the remote file, there is this workaround: (setq tramp-auto-save-directory "~") in the .emacs will cause tramp to auto-save the file to the home directory of the user instead.
The bug is still present in emacs-21.4-r6. Attached patch (backported from Emacs-22) fixes the problem for me.
Created attachment 110421 [details, diff] Proposed bugfix: files/emacs-21.4-autosave-tmp.patch
Created attachment 110423 [details, diff] Proposed bugfix: patch for emacs-21.4-r6.ebuild Since startup.el is patched, we have to recompile it. And then we simply call make to dump Emacs again.
(In reply to comment #2) > Anyways, the fact that there are multiple strings from the build environment in > the final executable is really wrong. Why do you consider this to be a bug? It is an artefact of emacs' build procedure, but it should not affect the normal running of the program.
fixed in 21.4-r7, thanks Ulrich.