From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master 10a7615b5d4: Separate filename-deletion mechanism from policy. Date: Sun, 06 Aug 2023 17:12:42 +0300 Message-ID: <83jzu8p8dh.fsf@gnu.org> References: <169132873104.29568.5167661370136073295@vcs2.savannah.gnu.org> <20230806133211.6301AC038BE@vcs2.savannah.gnu.org> <87jzu847hq.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22909"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, esr@thyrsus.com To: Po Lu , Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 06 16:13:13 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qSeVN-0005lU-9U for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Aug 2023 16:13:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSeUi-0005SF-Js; Sun, 06 Aug 2023 10:12:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSeUd-0005Pd-AV for emacs-devel@gnu.org; Sun, 06 Aug 2023 10:12:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSeUc-0005f4-Pw; Sun, 06 Aug 2023 10:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vEvvJ+JgrlIzB0eOTmtqvSUUHo/nHiR6td5tbKc8v4M=; b=XFPLeKEPCdcJ LQqozOYXLDIlPkIWgp+I3ItkRBakcPnnnsx64htlite2Ahkqkgpp55c72Cf1Q4X67BurgfWS0SuYD vqjKa2gm55rbftYo5NJnjj9gu4q1EpCmUIihWGCedyglp8Jqssch0zyVeBR3YKC8vOKdD8PNQvJ3o ogor7uiEd49E3E8Q+HFsVQu7fZbVQJQg1qUXTklQ3ojfKbMYAeQ/ar5zMcmBwFfln8cSxUc+AFJeG 5oZx8XurntbxmNTvjuKve+gFLRY6PyCL3285h3I565kprKiUGi4izTGXuqOfIhbu1F59kntHuQSO4 DweVj1waTJDAROtFe6CJZw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qSeUc-0002eO-8M; Sun, 06 Aug 2023 10:12:26 -0400 In-Reply-To: <87jzu847hq.fsf@yahoo.com> (message from Po Lu on Sun, 06 Aug 2023 21:37:21 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:308369 Archived-At: > From: Po Lu > Cc: "Eric S. Raymond" > Date: Sun, 06 Aug 2023 21:37:21 +0800 > > "Eric S. Raymond" writes: > > > This is a pure refactoring step, delete-file's behavior is > > unchanged. But the C core is a little simpler now. > > --- > > lisp/files.el | 20 ++++++++++++++++++++ > > src/fileio.c | 40 +++++++++------------------------------- > > 2 files changed, 29 insertions(+), 31 deletions(-) > > > > diff --git a/lisp/files.el b/lisp/files.el > > index f8867432000..84a8c308b09 100644 > > --- a/lisp/files.el > > +++ b/lisp/files.el > > @@ -6352,6 +6352,26 @@ non-nil and if FN fails due to a missing file or directory." > > (apply fn args) > > (file-missing (or no-such (signal (car err) (cdr err)))))) > > > > +(defun delete-file (filename &optional trash) > > + "Delete file named FILENAME. If it is a symlink, remove the symlink. > > +If file has multiple names, it continues to exist with the other names.q > ^ > Typo alert! > > Thanks. While I'm not enthusiastic about moving functions from C to > Lisp, others seem to appreciate the gesture, so I won't mention this > subject now. This kind of changes should have been discussed before it was installed. There are several issues I can see here: . delete-file-internal must call expand-file-name on its argument, as all primitives that interface to the filesystem must; I fixed that; . Emacs will now be unable to call delete-file or rename-file during loadup, until files.el is loaded -- not sure if this is a problem, but I guess we will see; . the changeset failed to adjust internal_delete_file, which still called Fdelete_file; I fixed that (I hope, see below) Andrea, please take a look at the last bullet above: I made internal_delete_file call Fdelete_file_internal, which means it no longer supports remote files. If that is a problem, we should call Qdelete_file there, but then I wonder whether calling Lisp at that place, even though delete-file is preloaded, can cause any trouble? If there's any doubt this will work, I'd rather revert this whole changeset, as this is a delicate place in Emacs, and I'd hate to break it. > However, > > > branch: master > > commit 10a7615b5d45bcd909bb03d67423b337dfe93b1e > > Author: Eric S. Raymond > > Commit: Eric S. Raymond > > > > Separate filename-deletion mechanism from policy. > > > > src/fileio.c: (delete-file-internal) Renamed from delete-file, > > parallel to delete-directory-internal; policy > > code moved to Lisp. > > src/files.el: (delete-file) New function, holds policy logic. > > calls delete-file-internal. > > is incorrect, since our ChangeLog generator expects the entries to be > formatted like so: That's water under the bridge, as this is Git. Whoever prepares the Emacs 30.1 tarball will have to deal with this.