From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#454: file-precious-flag overwrites symlinks Date: Wed, 30 Jul 2008 18:56:16 -0400 Message-ID: <87zlnzq8vj.fsf@stupidchicken.com> Reply-To: Chong Yidong , 454@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1217459258 8087 80.91.229.12 (30 Jul 2008 23:07:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2008 23:07:38 +0000 (UTC) Cc: 454@emacsbugs.donarmstrong.com To: Max Mikhanosha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 31 01:08:28 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KOKmR-0005HL-GL for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Jul 2008 01:08:27 +0200 Original-Received: from localhost ([127.0.0.1]:42475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOKlX-0005NJ-4S for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Jul 2008 19:07:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOKlS-0005Mv-MR for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2008 19:07:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOKlQ-0005Ma-8H for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2008 19:07:25 -0400 Original-Received: from [199.232.76.173] (port=52320 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOKlQ-0005MX-0s for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2008 19:07:24 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34715) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KOKlP-0001Bl-FQ for bug-gnu-emacs@gnu.org; Wed, 30 Jul 2008 19:07:23 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6UN7LB4004260; Wed, 30 Jul 2008 16:07:21 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m6UN03i0001045; Wed, 30 Jul 2008 16:00:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 30 Jul 2008 23:00:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 454 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 454-submit@emacsbugs.donarmstrong.com id=B454.121745845932205 (code B ref 454); Wed, 30 Jul 2008 23:00:03 +0000 Original-Received: (at 454) by emacsbugs.donarmstrong.com; 30 Jul 2008 22:54:19 +0000 Original-Received: from cyd (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6UMsGHI032199 for <454@emacsbugs.donarmstrong.com>; Wed, 30 Jul 2008 15:54:17 -0700 Original-Received: by cyd (Postfix, from userid 1000) id 5EE2E57E323; Wed, 30 Jul 2008 18:56:16 -0400 (EDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Wed, 30 Jul 2008 19:07:25 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:18931 Archived-At: > 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?