Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs gives warning when trying to save files over sshfs

Tags:

emacs

sshfs

fuse

I mount an sshfs file system with

% sshfs remote.host.org:/home/jrm /home/mnt/remote.host

then edit a file under this file system with

% emacsclient -n /home/mnt/remote.host/some_file.c.

When I save the file I get the warning

some_file.c has changed since visited or saved.  Save anyway? (yes or no)

Other editors don't have this problem. What is causing this? How can I prevent it? Both hosts are running ntp and the times are the same.

TIA.

P.S. I'm aware that I can open the files directly with tramp, but I prefer sshfs assuming I can get rid of this warning every time I try to save a file.

like image 912
jrm Avatar asked Feb 21 '12 23:02

jrm


1 Answers

I had this problem and one solution is to just ignore the warnings that the file has changed if you're sure you won't be writing over something important.

I wrote a small minor mode to ignore all file change warnings called modtime-skip-mode

you can find the repo here: https://github.com/jordonbiondo/modtime-skip-mode

this package is also on Marmalade so if you have that setup you can just

M-x: package-install <enter> modtime-skip-mode <enter>

like image 123
Jordon Biondo Avatar answered Sep 30 '22 17:09

Jordon Biondo