GNU bug report logs - #454
file-precious-flag overwrites symlinks

Previous Next

Package: emacs;

Reported by: Max Mikhanosha <max <at> openchat.com>

Date: Fri, 20 Jun 2008 18:00:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Max Mikhanosha <max <at> openchat.com>
Cc: 454 <at> debbugs.gnu.org
Subject: bug#454: file-precious-flag overwrites symlinks
Date: Wed, 30 Jul 2008 18:56:16 -0400
> I keep my .emacs file under version control as part of overall
> collection of config files, and as result ~/.emacs is a symbolic
> link.
>
> `backup-by-copying-when-linked' is set to t, so visiting ~/.emacs
> and then editing and saving it correctly saves the file that
> symlink is pointing too.
>
> For a long time I was trying to track down why sometimes, my ~/.emacs
> symbolic link is suddenly overwritten by the actual file.
>
> Finally found that this happens when one uses "Save for future
> session" in customize package, and farther tracked it down to a
> behavior of `basic-save-buffer-2' when file-precious-flag is set.

Setting file-precious-flag to t in custom-save-all shouldn't be a
problem, because the custom file is visited using
find-file-visit-truename.  I tried to reproduce your problem, without
success:

$ touch foo
$ ln -s foo .emacs
$ emacs
  M-x customize-variable RET sentence-end-double-space RET
  [Click on Toggle]
  C-x C-s
  C-x C-c
$ ls -l foo .emacs

lrwxrwxrwx 1 cyd cyd   3 2008-07-30 18:54 .emacs -> foo
-rw-r--r-- 1 cyd cyd 528 2008-07-30 18:55 foo

Could you provide a recipe that shows this problem?




This bug report was last modified 16 years and 297 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.