unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* backup-by-copying-when-linked
@ 2020-08-30 19:15 Mario Lang
  2020-08-30 19:22 ` backup-by-copying-when-linked Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Mario Lang @ 2020-08-30 19:15 UTC (permalink / raw)
  To: emacs-devel

Hi.

I was recently bitten again by Emacs destroying hard-links when saving.

I have to admit, I consider this default behaviour pretty rude.
What is the rationale for such a default?  And, can we perhaps find a
way to change this such that saving a hard-linked file doesn't undo the
link?

-- 
CYa,
  ⡍⠁⠗⠊⠕



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

* Re: backup-by-copying-when-linked
  2020-08-30 19:15 backup-by-copying-when-linked Mario Lang
@ 2020-08-30 19:22 ` Stefan Monnier
  2020-08-31  2:51   ` backup-by-copying-when-linked Elias Mårtenson
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2020-08-30 19:22 UTC (permalink / raw)
  To: Mario Lang; +Cc: emacs-devel

> I have to admit, I consider this default behaviour pretty rude.

In other circumstances, the other behavior is pretty rude as well.


        Stefan




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

* Re: backup-by-copying-when-linked
  2020-08-30 19:22 ` backup-by-copying-when-linked Stefan Monnier
@ 2020-08-31  2:51   ` Elias Mårtenson
  2020-08-31  3:15     ` backup-by-copying-when-linked Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Elias Mårtenson @ 2020-08-31  2:51 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Mario Lang, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]

On Mon, 31 Aug 2020, 03:24 Stefan Monnier, <monnier@iro.umontreal.ca> wrote:

> > I have to admit, I consider this default behaviour pretty rude.
>
> In other circumstances, the other behavior is pretty rude as well.


While I consider the default Emacs behaviour to be appropriate, it is
possible to detect that a file has hardlinks and warn if you're saving to
such a file.

It may be useful to provide such functionality?

[-- Attachment #2: Type: text/html, Size: 826 bytes --]

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

* Re: backup-by-copying-when-linked
  2020-08-31  2:51   ` backup-by-copying-when-linked Elias Mårtenson
@ 2020-08-31  3:15     ` Stefan Monnier
  2020-08-31  3:46       ` backup-by-copying-when-linked Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2020-08-31  3:15 UTC (permalink / raw)
  To: Elias Mårtenson; +Cc: Mario Lang, emacs-devel

>> > I have to admit, I consider this default behaviour pretty rude.
>> In other circumstances, the other behavior is pretty rude as well.
> While I consider the default Emacs behaviour to be appropriate, it is
> possible to detect that a file has hardlinks and warn if you're saving to
> such a file.

Warning might be a good feature and even a good default, indeed, since both
options can be quite rude: sometimes the links are really there because
you really want to keep those N places equal, and other times the links
should only be there as long as the N files are equal.


        Stefan




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

* Re: backup-by-copying-when-linked
  2020-08-31  3:15     ` backup-by-copying-when-linked Stefan Monnier
@ 2020-08-31  3:46       ` Eli Zaretskii
  2020-08-31  3:57         ` backup-by-copying-when-linked Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2020-08-31  3:46 UTC (permalink / raw)
  To: emacs-devel, Stefan Monnier, Elias Mårtenson; +Cc: Mario Lang

On August 31, 2020 6:15:43 AM GMT+03:00, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>> > I have to admit, I consider this default behaviour pretty rude.
>>> In other circumstances, the other behavior is pretty rude as well.
>> While I consider the default Emacs behaviour to be appropriate, it is
>> possible to detect that a file has hardlinks and warn if you're
>saving to
>> such a file.
>
>Warning might be a good feature and even a good default, indeed, since
>both
>options can be quite rude: sometimes the links are really there because
>you really want to keep those N places equal, and other times the links
>should only be there as long as the N files are equal.

Careful with these warnings: they could potentially be a terrible nuisance, since saving your edits is a very frequent operation.

If we are going to introduce such a warning, it should be issued only once per session for a given buffer.



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

* Re: backup-by-copying-when-linked
  2020-08-31  3:46       ` backup-by-copying-when-linked Eli Zaretskii
@ 2020-08-31  3:57         ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2020-08-31  3:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Elias Mårtenson, Mario Lang, emacs-devel

> If we are going to introduce such a warning, it should be issued only once
> per session for a given buffer.

Oh yes.  I'd even hope the info about which to choose can survive longer
than a session.


        Stefan




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

end of thread, other threads:[~2020-08-31  3:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-30 19:15 backup-by-copying-when-linked Mario Lang
2020-08-30 19:22 ` backup-by-copying-when-linked Stefan Monnier
2020-08-31  2:51   ` backup-by-copying-when-linked Elias Mårtenson
2020-08-31  3:15     ` backup-by-copying-when-linked Stefan Monnier
2020-08-31  3:46       ` backup-by-copying-when-linked Eli Zaretskii
2020-08-31  3:57         ` backup-by-copying-when-linked Stefan Monnier

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