From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: master 10a7615b5d4: Separate filename-deletion mechanism from policy. Date: Sun, 06 Aug 2023 21:37:21 +0800 Message-ID: <87jzu847hq.fsf@yahoo.com> References: <169132873104.29568.5167661370136073295@vcs2.savannah.gnu.org> <20230806133211.6301AC038BE@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16059"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "Eric S. Raymond" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Aug 06 15:38:24 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 1qSdxg-000407-5s for ged-emacs-devel@m.gmane-mx.org; Sun, 06 Aug 2023 15:38:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qSdww-00027L-84; Sun, 06 Aug 2023 09:37:38 -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 1qSdws-000272-7k for emacs-devel@gnu.org; Sun, 06 Aug 2023 09:37:34 -0400 Original-Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qSdwq-00068P-4b for emacs-devel@gnu.org; Sun, 06 Aug 2023 09:37:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1691329049; bh=53oc8OjZHNt+Sxsc0iOOF86k311sS0xMFevu5L3Tw3c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=f/+muzhT6axsqf5s3Uhwqz2lcWBd4jfMibl2THKA2glXhna75bKnUmskG+ZJCgUQyIODYgGr456+HNsvkMg9JUbgDb4iZS7KVPIteRhvr5OXH9ZS+uiWPAZK0CFVid0hISUFKs5LbcItdcXwt8jUPqBC70AS4JzChAC2AsAd/iwXsQd/okMAE5dLJ69H5xrwm1Jgx6bE8qaN+zYYksCj+nKtcW7IoEMsjlZHoc2eRrU+6O/oIjlDTOZMfjj4x8KLO5JMdWpItVG6DGD2B8E+gKKO0fS9Rf55r5pJYxSfvRb9Ou8A6Lul/pX3jaDc8h5UwXEPzvmMZdRJxOc41Ljttw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1691329049; bh=B3rvnPLgfILG6XLMkWm4D8f2fB27vBbI2VMyzFltOK0=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=KlLQKA2YlGrmvXIDbq+Oz1KazaPqct5KRcqrgxCbq/tP+aiBhw5GoB3xpaHSZnuWbAlVnMOrss4ZbXEUm+QwJlrmV+WSo69k/ROgeHIcydMG5aiig1GWzHZ12dcK/Xewe5DLEnx84FZb4dTHgtMViYBzozuRg6A1sgo5Hxk9KA/azkOasOfEIZAe8vz+bLOgdjZxSlWT6bR1bCqBg0iX66lK2VT7py9ftzfifD3HWAduzaK927vK2gfCie+mqA6IBYmsg3xmtYSYV+eTzIG1MUsmzf1MaXVmEVNDiEno0ldJYrXKnbs2jAc3tC02W4NOk6gYRubPRJNjvwpo6DG7VQ== X-YMail-OSG: Ux6DypoVM1mzqFCcCSm2qPYKtwBy6WD33RHuYKWJPp2e.sA_NXHjCc2Iqrcrwpd dPntyroXfA3ogztV4GRTiu1bUhaJCiQS0Byhg8V9EHLC7._CzyzVv8.GSUvuL3h9b78btIXEQdvg AqfKBt3YRFe4Bi1k_TFd.xq_UredUeqV.DnDcwn4JqqDO.RVXl4DsUEUxNgd9z47V3ESgDA1dFJr koDT4ub9in5H1yV0TnO09UO.ca3rarrsAyzJUToV_0WVc9z1.AzW180.ShNKYTD.TyYJ82q5qqI4 VVsNLCbI.Aflq0Y67U7qTOtgYuhiHdtBZUaAZl7oYgLfDB9r_As3JPFRg3lTAUMBot0a.KHHNQLk hG83Ryo.0ZHg5qcU.4qTZJuKht6KQojBCd.ZLPKxT.VDK9dT8sED3K7XTgQ2fDD0PKjAQiw2WiSi P0JJY6F.RWejj55QjFqrm7ypjCZYbdnIuuAz8vR5SHKidCJ.JY9tTyW1ZVhRP.eHNZ3fMmC.iwW_ tpJthNVLqpn0QCx.BoHVIJQthfNKMh0Dr9JaKEPqsEGi5CcRRlSw7NboNKXLaJfY5yWCUTZCpTvT NrL1nTL_0l_5B8pW25cKFrv6NDIntxDg6DGiUOsfmWXoOsTPgf6YlFikngxqpg6aHSb7fK81BbYf Y.zJFs0tEXIE2pfBSgjY4H0fN1KS_qsk3Xu0EuYJsZ6qX_tUAT2pngd4mJsKqzQRqQL_GUPY6Bw0 oVcW2q63Jxl3E_TGpWjWOZPbFxuwffo4ghb5tmN_1xPsmB4G8rcuL7A56awMK0yYRG_oVYuZw6Hn up6Srm7q4bWMI0wiwa8gpdIo82H8UPi_nV1ujpRobe X-Sonic-MF: X-Sonic-ID: a5be6b82-6908-4616-b1c6-14abbab37363 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Sun, 6 Aug 2023 13:37:29 +0000 Original-Received: by hermes--production-sg3-6b8fc8d58f-f5trv (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d0e927ba2e83210da3e15d41a1e4eb31; Sun, 06 Aug 2023 13:37:26 +0000 (UTC) In-Reply-To: <20230806133211.6301AC038BE@vcs2.savannah.gnu.org> (Eric S. Raymond's message of "Sun, 6 Aug 2023 09:32:11 -0400 (EDT)") X-Mailer: WebService/1.1.21695 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.190.31; envelope-from=luangruo@yahoo.com; helo=sonic307-56.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:308367 Archived-At: "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. 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: * src/fileio.c (delete-file-internal): Renamed from delete-file, its counterpart being delete-directory-internal; policy code moved to Lisp. * src/files.el (delete-file): ...