当我使用远程文件(通过 SSH/SFTP)时,Emacs 始终使用 700
权限保存文件,但任何其他编辑器(例如 GEdit)都会保留 之前的权限第770章
有什么方法可以配置 Emacs 使其不更改文件权限吗?
最佳答案
所以here's可能有帮助的东西。我链接到的错误几乎完全描述了您的情况(用 vim 代替 emacs)。有人发布了您可以尝试的解决方法:
...after installing sshfs (fuse was already installed), then mounting the remote server by creating /mnt/servername, and using
sshfs user@servername:/path/ /mnt/servername/ -p port
, I was able to use gvfs to navigate to /mnt/servername and open, edit and save the file using GVim without problems. This is both a workaround, and perhaps useful in narrowing down the problem.
当然,最简单(也是最快)的解决方案是使用 Tramp Mode :
C-x C-f /<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0e7b7d6b7c4e3f3e203f3e203f203f3e" rel="noreferrer noopener nofollow">[email protected]</a>:/var/www/test.php
关于linux - 使用 Emacs 编辑 GVFS 挂载文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8977700/