[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rename, delete and move current buffer and file

From: Stefan Monnier
Subject: Re: Rename, delete and move current buffer and file
Date: Thu, 10 May 2018 17:49:36 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> I would have to disagree here. At the very least, as a *user*, when I
> look for a command to rename a file, if I find a command that copies
> and deletes the original, then I'm going to keep looking.

We have `rename-file` for those who want that.  I was just discussing
a proposition to provide a UI that lets one move "the current buffer's
file" without having to introduce a new command (which comes with
problems linked with finding a key-binding and/or a name for it that is
easy enough to discover).

> Also, renaming a file is atomic on many filesystems,

It's not atomic on any POSIX system, AFAIK: it first creates a second
name with `link` and then deletes the old name with `unlink`.

The difference here is one of *identity*, because write-file+delete-file
will not preserve the inode (and also potentially differences w.r.t
handling of symlinks).

> Why would we want the "official" way to rename a file be needlessly
> prone to race conditions, even if the problem doesn't come up
> in practice?

It wouldn't be the official way to rename a file.
Just a convenient way to rename the current buffer's file.

        Stefan "in any case it seems not to be popular, so I'll stop
                explaining it, since it seems to be confused with
                defending/promoting it"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]