Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spacemacs can't create auto-save files when using tramp on Windows. #7302

Closed
batonius opened this issue Oct 6, 2016 · 4 comments
Closed
Labels
- Bug tracker - Should report upstream stale marked as a stale issue/pr (usually by a bot)

Comments

@batonius
Copy link

batonius commented Oct 6, 2016

Description :octocat:

Spacemacs can't create auto-save files in the cache directory when using tramp on Windows. dotspacemacs-auto-save-file-location is set to 'cache.

Reproduction guide 馃

  • Start Emacs on Windows via msys2.
  • Open a file on a remote server with tramp.
  • Edit the file.
  • Wait for auto-save to kick in.

Observed behaviour: 馃憖 馃挃
No new auto-save files in .cache/dist or .cache/site directories, error message in the Messages buffer:

Auto-saving test.sh: Opening output file: Invalid argument, d:/msys64/home/user/.emacs.d/.cache/auto-save/dist/#!plinkx:188:!home!user!test.sh#

Expected behaviour: 鉂わ笍 馃槃
Auto-saving working properly. I've looked in ~/.emacs.d/.cache/auto-save and found auto-save files created by the previous version of Spacemacs in the site subdir, their names being of form #_aplinkx_b188_b_ahome_auser_atest.sh#, so I guess the problem is broken file name escaping.

System Info 馃捇

  • OS: windows-nt
  • Emacs: 25.1.1
  • Spacemacs: 0.200.0
  • Spacemacs branch: master (rev. e6357a5)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(helm emacs-lisp dockerfile
      (shell :variables shell-default-height 30 shell-default-shell 'shell shell-default-position 'bottom)
      rust markdown c-c  
      (colors :variables colors-colorize-identifiers 'all)
      sql php html)
@TheBB
Copy link
Collaborator

TheBB commented Oct 6, 2016

If Spacemacs caused this to happen it should be possible to bisect this. If not, you should probably report this upstream to the relevant places, since I don't think (famous last words) we are doing anything that might affect this.

@batonius
Copy link
Author

batonius commented Oct 7, 2016

You're right, the problem is with vanilla emacs 25.1.

I've looked into it and it looks like tramp has two methods for auto-save file name escaping: if tramp-auto-save-directory is set it uses it's own transformations (/ -> _a, : -> _b, etc) and if it's nil it uses the default behavior for the system provided by make-auto-save-file-name. The problem is, after this commit make-auto-save-file-name can't detect the system as windows-nt and fails to replace the forbidden symbols in file names. I don't understand the reasoning behind the commit, but I got auto-saving working by explicitly setting tramp-auto-save-directory:

 (setq tramp-auto-save-directory (concat spacemacs-auto-save-directory "tramp/"))

I'm aware this isn't your bug, but maybe Spacemacs could set tramp-auto-save-directory when it sets auto-save-file-name-transforms? It seems reasonable and would solve the problem.

@hieudang9
Copy link

Same here, but in babun shell, Windows 10, hang up in this phase:
Wrote /home/dt/.emacs.d/.cache/layouts/persp-auto-save

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Bug tracker - Should report upstream stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

3 participants