From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Max Mikhanosha Newsgroups: gmane.emacs.bugs Subject: bug#454: file-precious-flag overwrites symlinks Date: Fri, 01 Aug 2008 01:04:07 -0400 Message-ID: <877ib1wcl4.wl%max@openchat.com> References: <87zlnzq8vj.fsf@stupidchicken.com> Reply-To: Max Mikhanosha , 454@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1217568465 21676 80.91.229.12 (1 Aug 2008 05:27:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Aug 2008 05:27:45 +0000 (UTC) Cc: 454@emacsbugs.donarmstrong.com To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 01 07:28:35 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 1KOnBr-0006Du-1t for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Aug 2008 07:28:35 +0200 Original-Received: from localhost ([127.0.0.1]:51688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOnAw-0005ED-8i for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Aug 2008 01:27:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOnAm-0005Cv-U2 for bug-gnu-emacs@gnu.org; Fri, 01 Aug 2008 01:27:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOnAi-00059a-Cq for bug-gnu-emacs@gnu.org; Fri, 01 Aug 2008 01:27:27 -0400 Original-Received: from [199.232.76.173] (port=34096 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOnAi-00059O-0k for bug-gnu-emacs@gnu.org; Fri, 01 Aug 2008 01:27:24 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:48445) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KOnAh-0003HQ-NO for bug-gnu-emacs@gnu.org; Fri, 01 Aug 2008 01:27: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 m715RLCC004219; Thu, 31 Jul 2008 22:27:21 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m715A4Rs031727; Thu, 31 Jul 2008 22:10:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Max Mikhanosha Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 01 Aug 2008 05:10:04 +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.121756705229548 (code B ref 454); Fri, 01 Aug 2008 05:10:04 +0000 Original-Received: (at 454) by emacsbugs.donarmstrong.com; 1 Aug 2008 05:04:12 +0000 Original-Received: from momoland.openchat.com (p84-72.acedsl.com [66.114.84.72]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m71548up029542 for <454@emacsbugs.donarmstrong.com>; Thu, 31 Jul 2008 22:04:10 -0700 Original-Received: from momoland.openchat.com (localhost [127.0.0.1]) by momoland.openchat.com (Postfix) with ESMTP id CFA95F45674B; Fri, 1 Aug 2008 01:04:07 -0400 (EDT) In-Reply-To: <87zlnzq8vj.fsf@stupidchicken.com> User-Agent: Wanderlust/2.15.3 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 =?UTF-8?Q?(Shij=C5=8D)?= APEL/10.6 Emacs/22.0.51 (x86_64-unknown-linux-gnu) MULE/5.0 (SAKAKI) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Fri, 01 Aug 2008 01:27:27 -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:18948 Archived-At: After playing with it for a little bit, I found that the additional condition is to have ~/.emacs opened in the buffer, it does not matter if its modified or not. So updated steps to reproduce the problem are: 1. Setup ~/.emacs being symlink to real file 2. M-x set-variable backup-by-copying-when-linked to t (this step is not nessesary to reproduce, just to show that his does not fix it) 3. Make sure sure ~/.emacs is not opened in any buffer, customize a variable, and do "Save for future sessions" 4. It saves changes to where file is pointing 5. Now do C-x C-f ~/.emacs 6. Customize variable again, do "Save for future sessions", it now overwrites ~/.emacs link with real file I can reproduce this with 22.2.1 and with latest emacs from CVS. Regards, Max At Wed, 30 Jul 2008 18:56:16 -0400, Chong Yidong wrote: > > > 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?