Emacs gives warning when trying to save files via sshfs

I mount the sshfs file system using

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

then edit the file on this file system with

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

When I save the file, I get a warning

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

Other editors do not have this problem. What causes this? How can I prevent this? Both hosts work ntp, but the time is the same.

TIA.

PS I know that I can open files directly with tramp, but I prefer sshfs, believing that I can get rid of this warning every time I try to save the file.

+6
source share
1 answer

I had this problem, and one solution was to simply ignore warnings that the file was changed if you are sure that you will not write 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 included in Marmalade, so if you have this setting, you can simply

Mx: package-install <enter> modtime-skip-mode <enter>

0
source

Source: https://habr.com/ru/post/909026/


All Articles