1
环境:Ubuntu Lucid上的GNU Emacs版本23.2.1。emacs在保存时用普通文件替换远程(gvfs/sftp)符号链接
我有一个使用Gnome的gvfs/sftp协议本地安装的远程文件系统。在通过其符号链接(也是远程)编辑远程文件并保存后,emacs用编辑后的目标文件副本替换远程符号链接。目标文件未触及。
local:~/remote/prakash/tmp> ln -sv ../.bashrc
./.bashrc' -> `../.bashrc'
local:~/remote/prakash/tmp> ls -l ./.bashrc ../.bashrc
lrwxrwxrwx 1 prakash prakash 9 2011-06-13 16:29 .bashrc -> ../.bashrc
-rwx------ 1 prakash prakash 10269 2011-06-13 16:29 ../.bashrc
# ... Editing and saving ~/prakash/tmp/.bashrc in emacs ...
local:~/remote/prakash/tmp> ls -l ./.bashrc ../.bashrc
-rwxrwxrwx 1 prakash prakash 10270 2011-06-13 16:30 .bashrc
-rwx------ 1 prakash prakash 10269 2011-06-13 16:29 ../.bashrc
以上可以看出,连结../.bashrc
被编辑过的文件的副本替换和目标文件是未修饰的。
搜索symbolic-link
和symlink
通过apropos
没有发现任何有用的东西。
如何防止这种情况发生?
如果您使用其他方式编辑文件,或者只使用Emacs,会发生这种情况吗? – jeremiahd 2011-06-13 22:49:00
如果您使用TRAMP,您是否可以再现此行为?我无法在Debian测试/ unstable中使用Emacs 23.3.1进行重现。 – vpit3833 2011-06-14 01:19:00
@jeremiahd:你说得对。这似乎是文件如何通过gnome-vfs呈现给本地系统的人为因素。当我在vim中编辑和保存符号链接文件时,发生了同样的情况。 – 2011-06-14 15:11:54