From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18125: file-precious-flag breaks symlinks Date: Fri, 04 Dec 2020 14:07:50 +0200 Message-ID: <83k0txepux.fsf@gnu.org> References: <8boawa800q.fsf@fencepost.gnu.org> <87h7p1iyu4.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26281"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rgm@gnu.org, 18125@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 04 13:09:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kl9te-0006hP-4u for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Dec 2020 13:09:10 +0100 Original-Received: from localhost ([::1]:58816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kl9tc-000718-Ic for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 04 Dec 2020 07:09:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kl9tW-000710-7B for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2020 07:09:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kl9tV-00083Y-UE for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2020 07:09:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kl9tV-00087m-P9 for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2020 07:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Dec 2020 12:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18125 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 18125-submit@debbugs.gnu.org id=B18125.160708369631177 (code B ref 18125); Fri, 04 Dec 2020 12:09:01 +0000 Original-Received: (at 18125) by debbugs.gnu.org; 4 Dec 2020 12:08:16 +0000 Original-Received: from localhost ([127.0.0.1]:43261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kl9sl-00086m-RW for submit@debbugs.gnu.org; Fri, 04 Dec 2020 07:08:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kl9sk-00086a-K3 for 18125@debbugs.gnu.org; Fri, 04 Dec 2020 07:08:14 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44318) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kl9sf-0007la-Fu; Fri, 04 Dec 2020 07:08:09 -0500 Original-Received: from [176.228.60.248] (port=3384 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kl9sd-0005c2-Oa; Fri, 04 Dec 2020 07:08:08 -0500 In-Reply-To: <87h7p1iyu4.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 04 Dec 2020 12:40:19 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:194992 Archived-At: > From: Lars Ingebrigtsen > Date: Fri, 04 Dec 2020 12:40:19 +0100 > Cc: 18125@debbugs.gnu.org > > Glenn Morris writes: > > > touch foo > > ln -s foo bar > > emacs-24.3.92 -Q --eval '(setq file-precious-flag t)' bar > > change bar and save > > -> bar is no longer a symlink > > > > AFAICS, it has always (since at least 22.3) been like this. > > Does it have to be, though? Why can't it overwrite the target of the link? > > This behaviour is still present in Emacs 28. > > > In any case, the doc only mentions breaking hardlinks. > > > > Setting find-file-visit-truename non-nil avoids the problem. > > I'm not sure whether this is a bug or whether it makes sense. I'm > leaning towards... bug? Perhaps? Anybody got an opinion here? IMO, we could provide the alternative behavior as opt-in, conditioned on a new option. It is not clear to me that everyone will want to overwrite the target, so an incompatible change here must be an opt-in.