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 400df210ce0: Fix last change of 'delete-file' Date: Fri, 11 Aug 2023 20:47:10 +0300 Message-ID: <83y1ihfp41.fsf@gnu.org> References: <169133064669.24990.11219399079845613336@vcs2.savannah.gnu.org> <20230806140407.09E6BC038BE@vcs2.savannah.gnu.org> <875y5n6nz2.fsf@gmail.com> <83o7jfhvw3.fsf@gnu.org> <871qgb6mg9.fsf@gmail.com> <83h6p7hueg.fsf@gnu.org> <87wmy355aa.fsf@gmail.com> <83cyzvhri7.fsf@gnu.org> <87msyyt4ne.fsf@gmx.de> <83h6p5hmex.fsf@gnu.org> <87350pu7qq.fsf@gmx.de> <834jl5hj9x.fsf@gnu.org> <87ttt5sd9y.fsf@gmx.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3330"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, emacs-devel@gnu.org, esr@thyrsus.com To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 11 19:47:37 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 1qUWEb-0000ft-0A for ged-emacs-devel@m.gmane-mx.org; Fri, 11 Aug 2023 19:47:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUWDk-0006EJ-4X; Fri, 11 Aug 2023 13:46:44 -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 1qUWDi-0006Ds-LU for emacs-devel@gnu.org; Fri, 11 Aug 2023 13:46:42 -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 1qUWDh-0004gT-SM; Fri, 11 Aug 2023 13:46:41 -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=t62xps7+nTv0HHCpY/xtQkgmSjMMopyq5J3nRrtanIg=; b=UDKRLExxt0Zf tLW/7PYpcGjYlFmluCFODmuY3skXWhdRsIRrLSwkn2i0Ebq18NiDp40j7tUIBe+H8mw2By6dGYRkl 0qU+bII4VsyYbNB3rBtnnXwuTjWoHlkncSa50FeWgmrjb+AqVbyUx0oLd+msTRwf93ojTgsy0YIi/ ITWU9HCIVgMRjo91WApXgHTlBh8tU4FE5TbFVJ8qckA2ojTsX5GDbBSHrqoh3jUixOxrbcwQLNhwL 3hNF4fb8pKx/nZLhkJpp9aIA7NJpTPvXJrcyg61K2aYvQPqzb1MYYKa4C/Hs7qvRYyHWKn6PXzr6J r0DL1r4xSdf1Y/M6pqfIjA==; In-Reply-To: <87ttt5sd9y.fsf@gmx.de> (message from Michael Albinus on Fri, 11 Aug 2023 19:24:25 +0200) 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:308586 Archived-At: > From: Michael Albinus > Cc: rpluim@gmail.com, emacs-devel@gnu.org, esr@thyrsus.com > Date: Fri, 11 Aug 2023 19:24:25 +0200 > > Eli Zaretskii writes: > > Hi Eli, > > > Primitives indeed _must_ call expand-file-name. And expand-file-name > > does that with default-directory because it accepts a directory as its > > 2nd argument, and that argument defaults to default-directory. > > Do you want two different versions of find-file-name-handler? One used > for primitives in C core which doesn't apply expand-file-name, and > another version for file operations in Lisp? No, I mean single one that serves both. > > The addition of expand-file-name to delete-file made that function a > > bit slower, and for local files that is a net loss. We should extend > > instead find-file-name-handler to work for non-absolute file names to > > avoid this overhead. > > It is not a recent addition, it has been there for ages. In Fdelete_file. I'm talking about the situation on master now, after delete-file was split into two parts. After my change today, delete-file calls expand-file-name (because find-file-name-handler needs that), and then delete-file-internal calls expand-file-name again (because every primitive must). > > Indeed, the fact that find-file-name-handler needs an absolute file > > name is never mentioned anywhere in the documentation. It is strange > > this didn't pop up earlier. > > find-file-name-handler does not need an absolute file name in > general. Several handlers are invoked based on the file name > extensions. It are the remote file names which require absolute file > names. A caller of find-file-name-handler cannot (and should not) know which parts of the file name the handlers look at. > If we add expand-file-name for cases it isn't applied yet, Emacs might > become slower. And perhaps we introduce new faults by this, because > everybody has arranged with the current behavior. But the situation now is bad already: if I call file-name-as-directory, for example, with a relative file name in a remote directory, the handler is not invoked. Isn't that a bug?