Bruno Haible wrote:
* When I edit a file in the testdir using 'vi', the change gets propagated
back to the gnulib checkout. But it does not do so with 'emacs' or 'kate'
as editor.
It works for me with Emacs, possibly because I have had the following in my
~/.emacs for many years:
(setq backup-by-copying-when-linked t)
(setq backup-by-copying-when-mismatch t)
I prefer the hard links; for me, they work better than symlinks would, because
Emacs would chatter at me about following symlinks. I don't want to worry about
symlinks vs hardlinks when editing these files; I just want to change the file
everywhere without fuss. So I'd like to retain the ability to create test dirs
with hard links, at least as an option.
How about something like the attached patch? The idea is to use hard links by
default (the longstanding practice), and use symlinks if --symlink is given. If
you'd prefer to implement a new --hardlink option, I could live with that.
diff --git a/gnulib-tool b/gnulib-tool
index c5b993a..63c762e 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -6087,6 +6087,7 @@ func_create_testdir ()
if func_should_symlink; then
func_ln "$lookedup_file" "$testdir/$g"
else
+ ln "$lookedup_file" "$testdir/$g" 2>/dev/null ||
cp -p "$lookedup_file" "$testdir/$g"
fi
fi