From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: master e315544: ; * src/fileio.c (Fdirectory_append): Doc fix. Date: Sun, 25 Jul 2021 09:59:44 +0200 Message-ID: <87a6man7rj.fsf@gmx.de> References: <20210724171858.1726.43078@vcs0.savannah.gnu.org> <20210724171900.4A26D20D0A@vcs0.savannah.gnu.org> <87h7gjo8sh.fsf@gmx.de> <871r7n1r6a.fsf@gnus.org> <87zgubmt3z.fsf@gmx.de> <87wnpfynqn.fsf@gnus.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="24018"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 25 10:00:51 2021 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 1m7Z47-000670-Ad for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Jul 2021 10:00:51 +0200 Original-Received: from localhost ([::1]:48770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7Z46-0003qx-At for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Jul 2021 04:00:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7Z38-0002jY-3e for emacs-devel@gnu.org; Sun, 25 Jul 2021 03:59:50 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:36839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7Z36-0002Su-7u; Sun, 25 Jul 2021 03:59:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1627199986; bh=eOLliH6rE40krAwAWVWDqeYgqZ5VEwjLzLjDh4tovl0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=XBwr2/CabgCyfoQxSxcuQPisFmjJ0BN7dP38uRe+BzClSY3h3V/hco7CA/ORxqEdF NOnaVXdF/Clc4YyYjRr2XwhE/WjS9zFxsOMa2B1c4xQjVxWBY3ADs0UEEn/febb/ga HxWOTNbZKVgKu7ABJvGwgyG+j27/RYw5UUT88s6o= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.91.249.69]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N6bjy-1l12Tv38Ws-0186Qt; Sun, 25 Jul 2021 09:59:45 +0200 In-Reply-To: <87wnpfynqn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 25 Jul 2021 07:19:12 +0200") X-Provags-ID: V03:K1:Aje+w033TtEiYBClfiKtnI9veK+QYj1CntV45wk0hUXEBGTNvqM GYQ/5jEAwxxwMnk05Z8AZt4hFw7vDGgFdhz/i1Ti5j9GeahdDg8HfTNc2F8Qtlsavae7dA6 gbKoUvD9MbWagTX7WqTO5iSc73Jp0MCAreDgF3bBy+WcrFEKorii+qG+jTs68qB4V1BA8Cz 2ahsuqMMvHufCqaw+01uw== X-UI-Out-Filterresults: notjunk:1;V03:K0:YSVpg/0QjOA=:O4uyDXfBYJB5Opa21RGuOm 95pA4PAnkgHgm/T/R3Ad4bIYI2PU/ncOgK4sqHiLsgGYMzxsLSrVnR0uKPGncMmFZa1L/HRyX 9txLl5FPM0xiwAU6izcF9wRCwr0gX2MNWHo1Jx69rA+ZcRW2l+4//DurhCV3maCx12OpiosCy b+m7E5Aht940wbVryD4fzikCEAGfurbw6OF9+/HnDNT8EGZI04qNVHmXk8QID4LXwCQGdV6bT Thq1NVZSE/7MAukppSqIwe5tY9WpKeCylHwlHoCj+jpQAzB75vWOwKhMtlfolMgvvtxwDIiU8 qdri7a03UlRB8ytLfC+MXMTLPiXq9G8RuKYsM1ryO93rtyutHulcFeZ8dl3nt60HPa3owSEoe uJZPfhbAbgqzYAg71Dl78Uc5asZtJn8FVcGXj3DpXP5vprpBTie4Vxolma3yuYba9GWdJ/gup iVNA898tycsLFKW1PlE6rQwjekuIU5XfWzQgM6e9w9o5U/H7jR1adD3hZeqkmYtYmGHCoXAx7 tYcO9q8vrTmHZmZAilqQ/Lmg8vvQiZ2L8UK9wLK9hxpc8rjqwi3FfAFmmGxGMsOi8MuVwZFyD rPwaPCAlsOImoKzvyTli2GwCCJV5oV6nCwsY8baX8qz5FJdKadGgxZxHuQEY2rcGXBDqxi/AZ O/Z2m5Q4fcB0hXV9wK2V+AR62FQBjJajbhzIjhGZXI2Oi+dwO1T5uum2GCCQvrADRO/oGHC3v /9dkHFBv5yHn811r03I+c1JTR+uXak9BvzZvNrkC2PIodH0uCjB3vLvjXA/Y3ZNwZHi9bcUx Received-SPF: pass client-ip=212.227.17.21; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=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.23 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" Xref: news.gmane.io gmane.emacs.devel:271588 Archived-At: Lars Ingebrigtsen writes: >>>> I would expect "foo/bar", meaning that all leading slashes in COMPONENTS >>>> are removed. >>> >>> Well, I think that's over into DWIM-land again (which is what >>> expand-file-name does, and this function deliberately doesn't do). >> >> expand-file-name and file-name-as-directory are functions which call a >> handler, for example Tramp. directory-append is much cheaper, and if it >> could do this string handling, I could avoid those functions. It would >> be more performant. > > The reason `directory-append' is useful as a function at all (instead of > just using `concat') is that we're very vague about the difference > between a directory name and a file name in Emacs. That is, we treat > "/tmp/" and "/tmp" as equivalent in more than 99% of cases when dealing > with directories. This has naturally led to people setting > `foo-directory' variables etc to something ending with a slash or not > arbitrarily, which again means that you can't just use `concat' to > construct file names. > > But "/bar.txt" does not happen naturally as a leaf file name, so I think > it'd be counter-productive to have `directory-append' do anything > particular about the start of file name components. So (file-name-concat x y) is roughly equivalent to (let (file-name-handler-alist) (concat (file-name-as-directory x) y)) Perhaps this could be mentioned somewhere in the manual? This would also precise, that leading slashes in COMPONENTS are kept. Best regards, Michael.