go-langserver icon indicating copy to clipboard operation
go-langserver copied to clipboard

Ignore Emacs autosave files

Open weijiangan opened this issue 7 years ago • 4 comments

Emacs creates files that precede with .# when there's autosave data and the go-langserver seems to try read these files (and fail when they're gone). I'm not sure if it causes any problems or crashes, because it appears to still work, but I imagine it is something that should be considered.

This is the error I get:

open /Users/weijiangan/go/src/concealed/gosrc/dir/.#file.go: no such file or directory (Unknown error)

weijiangan avatar May 06 '18 16:05 weijiangan

I don't let my Emacs save those files in the same directory as the original files,, There are just too many things which breaks beacuse of it..

thomasf avatar May 28 '18 17:05 thomasf

@thomasf that's more of a workaround rather than a proper solution isn't it

weijiangan avatar May 29 '18 13:05 weijiangan

Maybe so but tools should avoid writing temporary files outside of it's own data directories if possible. It's just an age old thing in emacs,, If the auto save backups were invented today they would would maybe not default to the same directory as the original file.. Having said that, (IIRC) the go tool ignores already ignores dotfiles so go-langserver should do it as well.

thomasf avatar May 29 '18 13:05 thomasf

But I suggest that you look into the backup-directory-alist , auto-save-file-name-transforms and auto-save-list-file-prefix (maybe others, I'm not sure, just quickly scanned my init file) to stop Emacs from storing temp files and backups in the working directory.. I moved those things over to their own tree ages ago and problems like this stopped popping up.

thomasf avatar May 29 '18 13:05 thomasf