From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Rename, delete and move current buffer and file Date: Thu, 10 May 2018 17:49:36 -0400 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1525988883 2726 195.159.176.226 (10 May 2018 21:48:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 10 May 2018 21:48:03 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel To: Radon Rosborough Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 10 23:47:59 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fGtPq-0000Xd-2s for ged-emacs-devel@m.gmane.org; Thu, 10 May 2018 23:47:58 +0200 Original-Received: from localhost ([::1]:35740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGtRv-00019G-Cs for ged-emacs-devel@m.gmane.org; Thu, 10 May 2018 17:50:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGtRi-00019A-Dw for emacs-devel@gnu.org; Thu, 10 May 2018 17:49:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGtRf-0005HC-CB for emacs-devel@gnu.org; Thu, 10 May 2018 17:49:54 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:43863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGtRf-0005GH-7r for emacs-devel@gnu.org; Thu, 10 May 2018 17:49:51 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w4ALntYH018293; Thu, 10 May 2018 17:49:59 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D0BE967F7C; Thu, 10 May 2018 17:49:36 -0400 (EDT) In-Reply-To: (Radon Rosborough's message of "Thu, 10 May 2018 11:01:39 -0600") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6283=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6283> : inlines <6627> : streams <1786517> : uri <2639989> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225209 Archived-At: > 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"