all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Radon Rosborough <radon.neon@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Rename, delete and move current buffer and file
Date: Thu, 10 May 2018 17:49:36 -0400	[thread overview]
Message-ID: <jwvefijchn9.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CADB4rJFedLpBO9RJvQ9PCjRDH4=p9qFt0EEkKKnvQJSjWXQZRg@mail.gmail.com> (Radon Rosborough's message of "Thu, 10 May 2018 11:01:39 -0600")

> 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	other threads:[~2018-05-10 21:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07 13:58 Rename, delete and move current buffer and file Jarosław Rzeszótko
2018-05-07 14:53 ` Stefan Monnier
2018-05-07 16:20   ` Jarosław Rzeszótko
2018-05-07 17:01     ` Stefan Monnier
2018-05-07 17:47       ` Jarosław Rzeszótko
2018-05-08  1:28         ` Stefan Monnier
2018-05-08  7:05           ` Jarosław Rzeszótko
2018-05-09 12:28             ` Stefan Monnier
2018-05-09 18:12               ` Radon Rosborough
2018-05-09 22:44                 ` Stefan Monnier
2018-05-10 17:01                   ` Radon Rosborough
2018-05-10 21:49                     ` Stefan Monnier [this message]
2018-05-11  7:31                       ` Andreas Schwab
2018-05-11 15:33                         ` Stefan Monnier
2018-05-11 15:45                           ` Paul Eggert
2018-05-11 16:06                             ` Clément Pit-Claudel
2018-05-11 16:14                             ` Stefan Monnier
2018-05-09 23:50               ` Van L
2018-05-10  5:37                 ` Jarosław Rzeszótko
2018-05-10 13:18                   ` Van L
2018-05-10  8:20               ` Amit Ramon
2018-05-10  8:59                 ` Phil Sainty
2018-05-10 16:04                 ` Eli Zaretskii
2018-05-07 18:20     ` Andreas Schwab
2018-05-08  1:28       ` Stefan Monnier
2018-05-07 15:28 ` Yuri Khan
2018-05-07 16:20   ` Jarosław Rzeszótko
2018-05-09 11:46   ` Tino Calancha
2018-05-07 15:29 ` Andreas Röhler
2018-05-07 15:38   ` Andreas Röhler
2018-05-10  0:46   ` net june
2018-05-11  6:26     ` Andreas Röhler
2018-05-11 16:10       ` net june

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvefijchn9.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=radon.neon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.