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: Thu, 10 Aug 2023 16:57:43 +0300 Message-ID: <83h6p7hueg.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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14444"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 10 15:57:58 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 1qU6An-0003UI-1U for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Aug 2023 15:57:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qU6AB-0007mo-IQ; Thu, 10 Aug 2023 09:57:19 -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 1qU6A9-0007mQ-RY for emacs-devel@gnu.org; Thu, 10 Aug 2023 09:57:18 -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 1qU6A9-0000Kw-Iq; Thu, 10 Aug 2023 09:57:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=iTBZfj9Y12cFmV3s52BoN7kMGsKjcsZmLc9Rr4YMfEc=; b=RS1NhpVjIvnosMaLh7f0 VBr/rswT1klGH4ADu1NWPORyvTuEJI8y8UOW0hWmBzhooZADnNgEja4i+VLlIefgRCwuSNTFMdnrr mntV9vLQfZyVRlSFG9WqAYc3vqBkIGdzwCqTTAdG3pOOa2JgmqcGFVu6mBbNXty8Pq7xTRuCuaOPK 0CVTgAl/EX74GW0llq2JJM4xje09jo7d25j6HFxnkv7OcPpm+0AEzjaE0O8Wycj/Jho+hUO0VDbia l0mzuDO6oiiKmR4GRkQ8jexqsWYYbLbltwprilabDTg9w026ZNAvKX6AXAyioRrKHDWLrD5LITTon u3q7LrAWVZ3zzw==; In-Reply-To: <871qgb6mg9.fsf@gmail.com> (message from Robert Pluim on Thu, 10 Aug 2023 15:44:54 +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:308535 Archived-At: > From: Robert Pluim > Cc: emacs-devel@gnu.org > Date: Thu, 10 Aug 2023 15:44:54 +0200 > > >>>>> On Thu, 10 Aug 2023 16:25:32 +0300, Eli Zaretskii said: > > >> I donʼt know if it matters, but along with esrʼs change this means we > >> now use the unexpanded file name for eg `find-file-name-handler' > > Eli> All file handlers are perfectly equipped to deal with unexpanded file > Eli> names. It must be so, don't you agree? Because if it wasn't, how > Eli> could file operations deal with relative file names? > > I was thinking of the opposite case, where someone has a personal file > handler with a regexp with an absolute path in it. That'd be a buggy file handler, I think, unless it also checks default-directory. > Eli> Only if the caller doesn't expand by itself. And even if it doesn't > Eli> why do you think it's a problem? Primitives that deal with file names > Eli> must always call expand-file-name early on, for this very reason. No > Eli> primitive should assume it will receive only absolute file names. > > I donʼt think itʼs a problem; I was just noting the change, and > wondering if it mattered. I don't think it could matter. Before the change we had Fdelete_file which could handle relative file names perfectly well, eight? So some Lisp could call delete-file passing it a relative file name, and that would work correctly, right? Now we have the same arrangement, except that the primitive was renamed. In effect, the call to expand-file-name was pushed a bit further into the processing pipeline. That cannot cause any harm, as long as code before expand-file-name expects absolute file names. But no general-purpose Lisp code should ever expect only absolute file names, because we make them absolute in the primitives.