unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18125: file-precious-flag breaks symlinks
@ 2014-07-28  6:34 Glenn Morris
  2020-12-04 11:40 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2014-07-28  6:34 UTC (permalink / raw)
  To: 18125

Package: emacs
Version: 24.3.92

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?

In any case, the doc only mentions breaking hardlinks.

Setting find-file-visit-truename non-nil avoids the problem.

(Cf http://debbugs.gnu.org/454)





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18125: file-precious-flag breaks symlinks
  2014-07-28  6:34 bug#18125: file-precious-flag breaks symlinks Glenn Morris
@ 2020-12-04 11:40 ` Lars Ingebrigtsen
  2020-12-04 12:07   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-12-04 11:40 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 18125

Glenn Morris <rgm@gnu.org> 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?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18125: file-precious-flag breaks symlinks
  2020-12-04 11:40 ` Lars Ingebrigtsen
@ 2020-12-04 12:07   ` Eli Zaretskii
  2021-08-20 14:21     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2020-12-04 12:07 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: rgm, 18125

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Fri, 04 Dec 2020 12:40:19 +0100
> Cc: 18125@debbugs.gnu.org
> 
> Glenn Morris <rgm@gnu.org> 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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18125: file-precious-flag breaks symlinks
  2020-12-04 12:07   ` Eli Zaretskii
@ 2021-08-20 14:21     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-20 14:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rgm, 18125

Eli Zaretskii <eliz@gnu.org> writes:

> 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.

It's a pretty specialised option (which makes it hard to explain), but I
get your point about being backwards-compatible in this area.

So I've now added the new option and adjusted the code.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-20 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-28  6:34 bug#18125: file-precious-flag breaks symlinks Glenn Morris
2020-12-04 11:40 ` Lars Ingebrigtsen
2020-12-04 12:07   ` Eli Zaretskii
2021-08-20 14:21     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).