From unknown Sun Jun 22 07:30:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#27982 <27982@debbugs.gnu.org> To: bug#27982 <27982@debbugs.gnu.org> Subject: Status: 25.1.50; expand-file-name docstring on how to traverse the filesystem Reply-To: bug#27982 <27982@debbugs.gnu.org> Date: Sun, 22 Jun 2025 14:30:49 +0000 retitle 27982 25.1.50; expand-file-name docstring on how to traverse the fi= lesystem reassign 27982 emacs submitter 27982 Nicolas Richard severity 27982 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 06 07:38:50 2017 Received: (at submit) by debbugs.gnu.org; 6 Aug 2017 11:38:51 +0000 Received: from localhost ([127.0.0.1]:44124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deJtS-0003bZ-JV for submit@debbugs.gnu.org; Sun, 06 Aug 2017 07:38:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48422) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deJtR-0003bN-5Q for submit@debbugs.gnu.org; Sun, 06 Aug 2017 07:38:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1deJtL-00082O-0L for submit@debbugs.gnu.org; Sun, 06 Aug 2017 07:38:44 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39241) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1deJtK-00082K-TT for submit@debbugs.gnu.org; Sun, 06 Aug 2017 07:38:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deJtJ-0001ra-Gu for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 07:38:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1deJtE-00080x-LZ for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 07:38:41 -0400 Received: from mailrelay118.isp.belgacom.be ([195.238.20.145]:40467) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1deJtE-0007zD-Aq for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 07:38:36 -0400 X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AucHAoBVG70QUVeWakpgxMWNXREfV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYYxaAt8tkgFKBZ4jH8fUM07OQ6PGwHzRYqb+681k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRo?= =?us-ascii?q?LerpBIHSk9631+ev8JHPfglEnjSwbLdxIRmssQndqtQdjJd/JKo21hbHuGZDdf?= =?us-ascii?q?5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXM?= =?us-ascii?q?TRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmij?= =?us-ascii?q?oINyQh/W7ZisJ+kr9VrhGvqRNw34HZe4SVOOZkc67HYd8XX3ZNU8BMXCJBGIO8?= =?us-ascii?q?aI4PAvIZM+ZZs4b9oF8OogGlBQKxGO3vyyNHhn/s0q0gzusqDAbL3QwnH9ITtn?= =?us-ascii?q?TUo9v1NL0VUeC616TIyCvMb/ZN1jjj8ojIaQotof+XXbJ+a8bRzlMvFwzcg1iW?= =?us-ascii?q?tIfrPCuV2/wOvmSG9eZsS+2ih3M9pw1srTWj2N0ghpTLi44LzF3P6D93z5wvJd?= =?us-ascii?q?KiTU52edukEJxNuC6EL4Z2WcYiQ31wuCY9170GpYa3fCgUx5QjwB7Sc+SHc4iJ?= =?us-ascii?q?4h39TeqRLzZ4hX17d76nhhay91avyvHkW8S3zVpGtDRJn9bRunwXyhDe5daLRu?= =?us-ascii?q?Fg8kqjxzqDzwXT5ftFIUAwm6rbMZkhwrsom5sTtkTDAyn2mEr4jK+McUUk9fOl?= =?us-ascii?q?6+H5bbXjvZCTKZV0ihrkPqQggcy/D/40Mg8UX2iU4ei8zqHs/VXlQLVWif07ir?= =?us-ascii?q?LWsI3VJcgCqa65BRJV3p895Ba6FTipzM8YkGIILFJDZRKLlY/pO0vBIKOwMfDq?= =?us-ascii?q?iUmj1Tht2rXLO7TqGb3CKGWFl63uLphn7EsJ7gs4ytRW/NpuC7oBKej/Ehvgs8?= =?us-ascii?q?HeAREjNAOcxuviAthnzcUQQmzJBbWWZvCB+WSU7/4idrHfLLQevyzwfqAo?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2DQCgDE/oZZ/6yO8VFchApkbSePAo82A?= =?us-ascii?q?gEBCAcDAQEBAQEBBgWBITMBlWWCEiSFI4RMQBgBAQEBAQEBAQEBAWoogjMigkM?= =?us-ascii?q?BXDsUAwECCjQBKRYhiiIRr1qLaA+DKIMHhR2EclUshQkfBZB1jkhSpn+RSIRAH?= =?us-ascii?q?ziBCjIhMVGHHD42hl+CQQEBAQ?= X-IPAS-Result: =?us-ascii?q?A2DQCgDE/oZZ/6yO8VFchApkbSePAo82AgEBCAcDAQEBAQE?= =?us-ascii?q?BBgWBITMBlWWCEiSFI4RMQBgBAQEBAQEBAQEBAWoogjMigkMBXDsUAwECCjQBK?= =?us-ascii?q?RYhiiIRr1qLaA+DKIMHhR2EclUshQkfBZB1jkhSpn+RSIRAHziBCjIhMVGHHD4?= =?us-ascii?q?2hl+CQQEBAQ?= Received: from 172.142-241-81.adsl-dyn.isp.belgacom.be (HELO phie-fixe) ([81.241.142.172]) by relay.skynet.be with ESMTP; 06 Aug 2017 13:38:33 +0200 User-agent: mu4e 0.9.19; emacs 25.1.50.1 From: Nicolas Richard To: bug-gnu-emacs@gnu.org Subject: 25.1.50; expand-file-name docstring on how to traverse the filesystem Message-ID: <87tw1lkjt8.fsf@members.fsf.org> Date: Sun, 06 Aug 2017 13:38:32 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain The docstring of expand-file-name suggest (directory-file-name (file-name-directory dirname)) to traverse a directory This looks wrong to me, e.g. (list current-directory (directory-file-name (file-name-directory current-directory))) => ("/home/youngfrog/" "/home/youngfrog") I think it should be (file-name-directory (directory-file-name dirname)) instead. Then the example becomes: (list current-directory (file-name-directory (directory-file-name current-directory))) => ("/home/youngfrog/" "/home/") Am I overlooking something ? Is this patch ok to commit ? In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu) of 2016-11-15 built on phie-fixe Repository revision: f994c2046588b168c1a4a900879cdffaf9d02f01 Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 System Description: Ubuntu 16.04.2 LTS --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-src-fileio.c-Fexpand_file_name-fix-suggestion-to-tra.patch >From 607e1445cfb1294c14af38cb4c39a93683e5671d Mon Sep 17 00:00:00 2001 From: Nicolas Richard Date: Sun, 6 Aug 2017 13:14:41 +0200 Subject: [PATCH] * src/fileio.c (Fexpand_file_name): fix suggestion to traverse the filesystem --- src/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index c3b2be7..28d619c 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -776,7 +776,7 @@ See also the function `substitute-in-file-name'. For technical reasons, this function can return correct but non-intuitive results for the root directory; for instance, \(expand-file-name ".." "/") returns "/..". For this reason, use -\(directory-file-name (file-name-directory dirname)) to traverse a +\(file-name-directory (directory-file-name dirname)) to traverse a filesystem tree, not (expand-file-name ".." dirname). */) (Lisp_Object name, Lisp_Object default_directory) { -- 2.7.4 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 06 12:54:16 2017 Received: (at 27982) by debbugs.gnu.org; 6 Aug 2017 16:54:16 +0000 Received: from localhost ([127.0.0.1]:44923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deOoi-0002kt-9U for submit@debbugs.gnu.org; Sun, 06 Aug 2017 12:54:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deOog-0002kh-GW for 27982@debbugs.gnu.org; Sun, 06 Aug 2017 12:54:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1deOoY-0006ux-5f for 27982@debbugs.gnu.org; Sun, 06 Aug 2017 12:54:09 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deOoY-0006uo-1o; Sun, 06 Aug 2017 12:54:06 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3248 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1deOoU-0006Vx-TR; Sun, 06 Aug 2017 12:54:05 -0400 Date: Sun, 06 Aug 2017 19:53:57 +0300 Message-Id: <83r2wotz6i.fsf@gnu.org> From: Eli Zaretskii To: Nicolas Richard In-reply-to: <87tw1lkjt8.fsf@members.fsf.org> (message from Nicolas Richard on Sun, 06 Aug 2017 13:38:32 +0200) Subject: Re: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem References: <87tw1lkjt8.fsf@members.fsf.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27982 Cc: 27982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Nicolas Richard > Date: Sun, 06 Aug 2017 13:38:32 +0200 > > The docstring of expand-file-name suggest > (directory-file-name (file-name-directory dirname)) > to traverse a directory No, it only suggests that as a more reliable alternative to (expand-file-name ".." dirname) > This looks wrong to me, e.g. > (list current-directory > (directory-file-name (file-name-directory current-directory))) > => ("/home/youngfrog/" "/home/youngfrog") This is not the use case against which the doc string tries to warn, Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 23 08:18:34 2017 Received: (at 27982) by debbugs.gnu.org; 23 Aug 2017 12:18:34 +0000 Received: from localhost ([127.0.0.1]:50520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkUcD-0007VQ-IV for submit@debbugs.gnu.org; Wed, 23 Aug 2017 08:18:34 -0400 Received: from mailrelay108.isp.belgacom.be ([195.238.20.135]:64280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkUcB-0007VB-ES for 27982@debbugs.gnu.org; Wed, 23 Aug 2017 08:18:31 -0400 X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AKV1h4BIQngLi8PaBsdmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgeKvXxwZ3uMQTl6Ol3ixeRBMOAuqIC07KempujcFRI2YyGvnEGfc4EfD4+ou?= =?us-ascii?q?JSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgpp?= =?us-ascii?q?POT1HZPZg9iq2+yo9ZDeZwZFiCChbb9uMR67sRjfus4KjIV4N60/0AHJonxGe+?= =?us-ascii?q?RXwWNnO1eelAvi68mz4ZBu7T1et+ou+MBcX6r6eb84TaFDAzQ9L281/szrugLd?= =?us-ascii?q?QgaJ+3ART38ZkhtMAwjC8RH6QpL8uTb0u+ZhxCWXO9D9QKsqUjq+8ahkVB7oiD?= =?us-ascii?q?8GNzEn9mHXltdwh79frB64uhBz35LYbISTOfFjfK3SYMkaSHJPXslfVyJPHJ6y?= =?us-ascii?q?YIkBAeQCMulXs5Lwp0cSoRakGQWgGPnixiNOi3Tr3aM6yeMhEQTe0QI4HtIBrH?= =?us-ascii?q?PUrNHvO6cJTOu70KjIwinDb/xMwzfy9ZXDfxchoPGLQLJwd8XRyUc1FwPCgVWd?= =?us-ascii?q?sonlMC2Q1usWrWeb9fFgWfihi248pQF9uD+vxt0jioTQgI8e11PK9T1hzYorON?= =?us-ascii?q?G1SlR3bcOqHZZRrS2WKYp7Ttk/T212visx16cItoShfCcQzZQq3xvfa/uafIeW?= =?us-ascii?q?+h/jT+ORIStghHJiZbK/mw6+8Ui+xe34Ucm5yEpHrjdfktnLrHACzQTf6smBSv?= =?us-ascii?q?Rj4keswSiD2x3R5+1ePEw5m6vWJ4Q/zrMxjJYfrFrPEjfzmErsja+Wcksk+vKv?= =?us-ascii?q?6+TierjnppicN5JyigHxPKQugMu/AesjPwgLQWeb/P+z26P5/U3iWrlKgOY2kq?= =?us-ascii?q?fDvJDdP8Qbqba1AxVJ3YY79xa/EzCm3cwGkXQFKF9IewyLgpP0NF7QO//3Fuq/?= =?us-ascii?q?g1u3kDtxyPDGOKDhDo/KLnjZn7frZax95FJEyAov0dBf4IpZBa8FIPLyW078r9?= =?us-ascii?q?PYDhkkMwCuxObnEtp9hcsiXjeiBq7RAqrIvEOT5eMua72BYI4HkDn7Nr4i/fG4?= =?us-ascii?q?3lEjnlpIW6ii2p8ecziCH/9mKl+VKS79hcoHHmkQuQUWSeHvglCYSnhdfHj0WL?= =?us-ascii?q?gzsGJoQLm6BJvOE9j+yIeK2z22S9gPPjhL?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AWBgAwcZ1Z/wwaiNlcHQEFAQsBGAEFA?= =?us-ascii?q?QsBgy+BeY8Ij10JBoEmBC8BlXSCEoVHAoRCQhYBAQEBAQEBAQEBAWooQg6BYyQ?= =?us-ascii?q?BgkABAQEBAgFWIxAIAxQBDCUPASkeBhOKJAUMsEWLbwEBAQEBBQIBJYMqgweFU?= =?us-ascii?q?YpIHwWKBYcWhweINphDjmWWLiYLJoEKMiExhh2BUD42gVmJKAEBAQ?= X-IPAS-Result: =?us-ascii?q?A2AWBgAwcZ1Z/wwaiNlcHQEFAQsBGAEFAQsBgy+BeY8Ij10?= =?us-ascii?q?JBoEmBC8BlXSCEoVHAoRCQhYBAQEBAQEBAQEBAWooQg6BYyQBgkABAQEBAgFWI?= =?us-ascii?q?xAIAxQBDCUPASkeBhOKJAUMsEWLbwEBAQEBBQIBJYMqgweFUYpIHwWKBYcWhwe?= =?us-ascii?q?INphDjmWWLiYLJoEKMiExhh2BUD42gVmJKAEBAQ?= Received: from 12.26-136-217.adsl-dyn.isp.belgacom.be (HELO Aurora) ([217.136.26.12]) by relay.skynet.be with ESMTP; 23 Aug 2017 14:18:24 +0200 References: <87tw1lkjt8.fsf@members.fsf.org> <83r2wotz6i.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 25.2.1 From: Nicolas Richard To: Eli Zaretskii Subject: Re: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem In-reply-to: <83r2wotz6i.fsf@gnu.org> Date: Wed, 23 Aug 2017 14:18:24 +0200 Message-ID: <86bmn6o4tr.fsf@members.fsf.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 27982 Cc: 27982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hello, Thanks for your comment. Eli Zaretskii writes: >> From: Nicolas Richard >> Date: Sun, 06 Aug 2017 13:38:32 +0200 >> >> The docstring of expand-file-name suggest >> (directory-file-name (file-name-directory dirname)) >> to traverse a directory > > No, it only suggests that as a more reliable alternative to > > (expand-file-name ".." dirname) If it's an alternative, shouldn't it have an equivalent effect, except for cases where it's better? Or perhaps my english is lacking and I misunderstand the suggestion completely. Let me rephrase my example just to make sure I explained myself correctly: (let ((dirname current-directory)) (format "%s versus %s" (directory-file-name (file-name-directory dirname)) (expand-file-name ".." dirname))) => "/home/youngfrog versus /home" => Effect is clearly different. With my suggestion this would become: (let ((dirname current-directory)) (format "%s versus %s" (file-name-directory (directory-file-name dirname)) (expand-file-name ".." dirname))) => "/home/ versus /home" => Effect is somewhat similar Nicolas. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 23 13:51:08 2017 Received: (at 27982) by debbugs.gnu.org; 23 Aug 2017 17:51:08 +0000 Received: from localhost ([127.0.0.1]:51658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkZo4-0000SQ-38 for submit@debbugs.gnu.org; Wed, 23 Aug 2017 13:51:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkZo2-0000Rx-BF for 27982@debbugs.gnu.org; Wed, 23 Aug 2017 13:51:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkZnt-00067I-MR for 27982@debbugs.gnu.org; Wed, 23 Aug 2017 13:51:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkZnt-00067D-J3; Wed, 23 Aug 2017 13:50:57 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3759 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dkZnr-0003iP-2K; Wed, 23 Aug 2017 13:50:57 -0400 Date: Wed, 23 Aug 2017 20:50:29 +0300 Message-Id: <83378i9nrv.fsf@gnu.org> From: Eli Zaretskii To: Nicolas Richard In-reply-to: <86bmn6o4tr.fsf@members.fsf.org> (message from Nicolas Richard on Wed, 23 Aug 2017 14:18:24 +0200) Subject: Re: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem References: <87tw1lkjt8.fsf@members.fsf.org> <83r2wotz6i.fsf@gnu.org> <86bmn6o4tr.fsf@members.fsf.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27982 Cc: 27982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Nicolas Richard > Cc: 27982@debbugs.gnu.org > Date: Wed, 23 Aug 2017 14:18:24 +0200 > > (let ((dirname current-directory)) > (format "%s versus %s" > (directory-file-name (file-name-directory dirname)) > (expand-file-name ".." dirname))) > => "/home/youngfrog versus /home" > => Effect is clearly different. Crystal ball says that current-directory (which you probably meant to be default-directory instead) ends in a slash, in which case remove it, and the 2 results will match. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 23 15:19:03 2017 Received: (at 27982) by debbugs.gnu.org; 23 Aug 2017 19:19:04 +0000 Received: from localhost ([127.0.0.1]:51710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkbB9-0002Qy-Nb for submit@debbugs.gnu.org; Wed, 23 Aug 2017 15:19:03 -0400 Received: from mailrelay117.isp.belgacom.be ([195.238.20.144]:20557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkbB7-0002QS-Hh for 27982@debbugs.gnu.org; Wed, 23 Aug 2017 15:19:01 -0400 X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AQZF83x9yuwcObf9uRHKM819IXTAuvvDOBiVQ1KB3?= =?us-ascii?q?0+8cTK2v8tzYMVDF4r011RmSDNWds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2e2//57ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMNboRr4oRzut86ZrSAfpiC?= =?us-ascii?q?gZMT457HrXgdF0gK5CvR6tuwBzz4vSbYqINvRxY7ndcMsURWVPXshfSTFPDIC+?= =?us-ascii?q?YIUBAOUOIf1Vr5Xhq1YUsReyGROhCP/pxzRVhnH2x6o60+E5HA/e3QwvA9UOsH?= =?us-ascii?q?DOo9XuKawcTeG1w7XIzTrZdfNZxCr25Y/IcxAmvPGMW71wccTLyUkoGAPIlVCQ?= =?us-ascii?q?ppLgPzyOyOsNqXOb4/BuVeK0hW4rsQZxoiKgxso1jITCm4Ebykjc+Clk3Io4Ic?= =?us-ascii?q?e0RFN1bNK5CpddtTuWO5V0T84kXmpmojw1yqcctp6+ZCUKzZMnyAPBZPGfaIiI?= =?us-ascii?q?5w7jVP6WITdlmHJpYLK/iAi28Uin0uDxStS00ExNripfiNbArnEN1xrN5cibUv?= =?us-ascii?q?Zx41ut1DKV2wzO5OxIPFo4mKjBJ5I/wLM8jp8Tvl7CHi/ylkX2lqiWdkA89+mo?= =?us-ascii?q?7OTnf7PmppCSN49ujQH+Pb8jmsmhDuQ9KQcBQXKb+f+m2L3t5k35Tq9Gjvoskq?= =?us-ascii?q?nWqJzaP9gUpralAw9J1YYu8wizAjWi3dkbg3UKN09KdwycgIfyJlHOL+v4Ae2w?= =?us-ascii?q?g1SqjTdn3ffGPqfuAp/VNHjMjK/hfaph605b0Ac809Rf55NVC7waL/LzXFLxuM?= =?us-ascii?q?bfDh8jPAzni9rgXfh518ssUHiCHrSaMaKa5VKM5/AHLO+RIogPt2CuBeIi4qvI?= =?us-ascii?q?jHQ+nVYGNZOo1psecnzwSuVhPkOWb2Drjf8EHGIAsxAlCuLxhhuFSzEFNCX6ZL?= =?us-ascii?q?41+jxuUNHuNozEXI34xeXZhCo=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2DlBAA81J1Z/xsHg21dHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBgy8qgU+OFHSPWgkFAYEmMwGVdIIShUcChEVAGAEBAQEBAQEBAQE?= =?us-ascii?q?BaihCDoFjJAGCQQZWIxAIAyElDwEpHgYTiiQRsgaLYAEBAQEBBQIBJYMqgweFU?= =?us-ascii?q?YpIHwWRG489pyiWLh84gQoyITGGHYFQPjaBWYkoAQEB?= X-IPAS-Result: =?us-ascii?q?A2DlBAA81J1Z/xsHg21dHAEBBAEBCgEBFwEBBAEBCgEBgy8?= =?us-ascii?q?qgU+OFHSPWgkFAYEmMwGVdIIShUcChEVAGAEBAQEBAQEBAQEBaihCDoFjJAGCQ?= =?us-ascii?q?QZWIxAIAyElDwEpHgYTiiQRsgaLYAEBAQEBBQIBJYMqgweFUYpIHwWRG489pyi?= =?us-ascii?q?WLh84gQoyITGGHYFQPjaBWYkoAQEB?= Received: from 27.7-131-109.adsl-dyn.isp.belgacom.be (HELO Aurora) ([109.131.7.27]) by relay.skynet.be with ESMTP; 23 Aug 2017 21:18:54 +0200 References: <87tw1lkjt8.fsf@members.fsf.org> <83r2wotz6i.fsf@gnu.org> <86bmn6o4tr.fsf@members.fsf.org> <83378i9nrv.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 25.2.1 From: Nicolas Richard To: Eli Zaretskii Subject: Re: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem Message-ID: <86wp5um6ss.fsf@members.fsf.org> In-reply-to: <83378i9nrv.fsf@gnu.org> Date: Wed, 23 Aug 2017 21:18:53 +0200 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 27982 Cc: 27982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > Crystal ball says that current-directory (which you probably meant to > be default-directory instead) ends in a slash, in which case remove > it, and the 2 results will match. Your crystal ball is working fine. Sorry for leaving that detail out. FWIW I have (defvaralias 'current-directory 'default-directory) because I used to forget the name of the variable (and I still do, it seems). Note however that default-directory ends in a slash when using "emacs -Q" too. Ok so now I'm saying that, with the suggestion in the docstring, output will be different if "dirname" ends in a slash. IOW if it is a "directory name" as opposed to "directory's file name". (let ((dirname "/home/youngfrog/")) (format "%s versus %s" (directory-file-name (file-name-directory dirname)) (expand-file-name ".." dirname))) => output is different (let ((dirname "/home/youngfrog")) (format "%s versus %s" (directory-file-name (file-name-directory dirname)) (expand-file-name ".." dirname))) => output the same With the function calls swapped the output is always similar: (let ((dirname "/home/youngfrog/")) (format "%s versus %s" (file-name-directory (directory-file-name dirname)) (expand-file-name ".." dirname))) => output is similar (let ((dirname "/home/youngfrog")) (format "%s versus %s" (file-name-directory (directory-file-name dirname)) (expand-file-name ".." dirname))) => output is similar Nicolas. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 24 13:09:25 2017 Received: (at 27982) by debbugs.gnu.org; 24 Aug 2017 17:09:25 +0000 Received: from localhost ([127.0.0.1]:53069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkvdD-0005Od-OE for submit@debbugs.gnu.org; Thu, 24 Aug 2017 13:09:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkvdB-0005OP-Jh for 27982@debbugs.gnu.org; Thu, 24 Aug 2017 13:09:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkvd2-0004Ny-A8 for 27982@debbugs.gnu.org; Thu, 24 Aug 2017 13:09:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkvd2-0004Ns-6l; Thu, 24 Aug 2017 13:09:12 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4496 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dkvd0-0005VV-Hn; Thu, 24 Aug 2017 13:09:12 -0400 Date: Thu, 24 Aug 2017 20:08:49 +0300 Message-Id: <83inhc99lq.fsf@gnu.org> From: Eli Zaretskii To: Nicolas Richard In-reply-to: <86wp5um6ss.fsf@members.fsf.org> (message from Nicolas Richard on Wed, 23 Aug 2017 21:18:53 +0200) Subject: Re: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem References: <87tw1lkjt8.fsf@members.fsf.org> <83r2wotz6i.fsf@gnu.org> <86bmn6o4tr.fsf@members.fsf.org> <83378i9nrv.fsf@gnu.org> <86wp5um6ss.fsf@members.fsf.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27982 Cc: 27982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Nicolas Richard > Cc: 27982@debbugs.gnu.org > Date: Wed, 23 Aug 2017 21:18:53 +0200 > > Ok so now I'm saying that, with the suggestion in the docstring, output > will be different if "dirname" ends in a slash. Of course. directory-file-name and file-name-directory look at the slashes, so having one more slash at the end changes everything. There's nothing new here. So where do we go from here, in the context of this bug report? What would you propose to change, where, and why? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 30 11:44:02 2017 Received: (at 27982-done) by debbugs.gnu.org; 30 Aug 2017 15:44:02 +0000 Received: from localhost ([127.0.0.1]:34724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dn59t-0003VS-MV for submit@debbugs.gnu.org; Wed, 30 Aug 2017 11:44:01 -0400 Received: from mailrelay105.isp.belgacom.be ([195.238.20.132]:47277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dn59r-0003V4-5T for 27982-done@debbugs.gnu.org; Wed, 30 Aug 2017 11:44:00 -0400 X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3ADiJowB8MAMKgMf9uRHKM819IXTAuvvDOBiVQ1KB3?= =?us-ascii?q?0uMcTK2v8tzYMVDF4r011RmSDNWds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2e2//57ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMNboRr4oRzut86ZrSAfpiC?= =?us-ascii?q?gZMT457HrXgdF0gK5CvR6tuwBzz4vSbYqINvRxY7ndcMsURWVPXshfSTFPDYGy?= =?us-ascii?q?YYUMAOUOIf1Vr5Xhq1YUsReyGROhCP/pxzRVhnH2x6o60+E5HA/e3QwvA9UOsH?= =?us-ascii?q?DOo9XuKawcTeG1w7XIzTrZdfNZxCr25Y/IcxAmvPGMW71wccTLyUkoGAPIlVCQ?= =?us-ascii?q?ppLgPzyOyOsNqXOb4/BuVeK0hW4rsQZxoiKgxso1jITCm4Ebykjc+Cln3Yo4J8?= =?us-ascii?q?e0RFN1bNOlCpdcqSCXO5FrTs88RWxjpTw0xaccuZGheSgH0JEnxxnCZPOZa4WI?= =?us-ascii?q?+RfjVPqJITd/mXJlZKqzhxas/kikze3xTtW50EtQripCiNnDrGgB1x3V6seZVv?= =?us-ascii?q?tw5lmt1SuN2gzJ9+1JL0E5mbDFJ5Mg2LI8i4QfvVzGHiDsmUX2iKGWdl8j+uit?= =?us-ascii?q?8+nmYrLmpoKaN497hAH+KKMumsOkDOQ9LAcOWnOU9vqm1L3450H5Tq5KjvMsnq?= =?us-ascii?q?neqpDaKtwXprSlDA9NzoYj9xG/Ai+43NkamXQKL0xJdAuagIjuPVHBPuv1Auqh?= =?us-ascii?q?jFu3izhr2v/GPqb7DpXCKHjDja3tfbFn605T0AAz18xQ54pICrEdJ/L+QlH+tN?= =?us-ascii?q?jZDh44KAG0zODnCMhn2oMZQ2KPDfzRDKSHnFuJrtAmOeSQf4wUuX6pJvwk9dbh?= =?us-ascii?q?i2J/nkUSK/qHx5wSPVa5FfNiKl7RW3vngt4bHS9erw0jSuPkklqNeTteYny/Rb?= =?us-ascii?q?l66Co1ToW8AtGQFciWnLWd0XLjTdVtbWdcBwXJSC+weg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2DTAQDX3KZZ/wwaiNleHQEFAQsBGAEFA?= =?us-ascii?q?QsBgy9EgTWOFXSPXwMBAQEBAQEGgSYBAy8BlXeCEoVHAoQmQBgBAQEBAQEBAQE?= =?us-ascii?q?BAWoogjMkAYJAAQEBAQIBViMQCAMUAQwlDwEpHgYTiiQFDK54i0EBAQEBAQUCA?= =?us-ascii?q?SWDKoMJhVKKSh8FkSWHCYg+pzeWQx84gQ0yITGGHoFQPjaKbQEBAQ?= X-IPAS-Result: =?us-ascii?q?A2DTAQDX3KZZ/wwaiNleHQEFAQsBGAEFAQsBgy9EgTWOFXS?= =?us-ascii?q?PXwMBAQEBAQEGgSYBAy8BlXeCEoVHAoQmQBgBAQEBAQEBAQEBAWoogjMkAYJAA?= =?us-ascii?q?QEBAQIBViMQCAMUAQwlDwEpHgYTiiQFDK54i0EBAQEBAQUCASWDKoMJhVKKSh8?= =?us-ascii?q?FkSWHCYg+pzeWQx84gQ0yITGGHoFQPjaKbQEBAQ?= Received: from 12.26-136-217.adsl-dyn.isp.belgacom.be (HELO Aurora) ([217.136.26.12]) by relay.skynet.be with ESMTP; 30 Aug 2017 17:43:52 +0200 References: <87tw1lkjt8.fsf@members.fsf.org> <83r2wotz6i.fsf@gnu.org> <86bmn6o4tr.fsf@members.fsf.org> <83378i9nrv.fsf@gnu.org> <86wp5um6ss.fsf@members.fsf.org> <83inhc99lq.fsf@gnu.org> User-agent: mu4e 0.9.19; emacs 25.2.1 From: Nicolas Richard To: Eli Zaretskii Subject: Re: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem In-reply-to: <83inhc99lq.fsf@gnu.org> Date: Wed, 30 Aug 2017 17:43:51 +0200 Message-ID: <86efrtysaw.fsf@members.fsf.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 27982-done Cc: 27982-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi Eli, Thanks for your help but let me close this. I initially thought it was "obviously wrong", but it is not. I think the wording is slightly misleading (e.g. "dirname" vs "dir-as-file-name"), but nothing important. Nicolas. Eli Zaretskii writes: >> From: Nicolas Richard >> Cc: 27982@debbugs.gnu.org >> Date: Wed, 23 Aug 2017 21:18:53 +0200 >> >> Ok so now I'm saying that, with the suggestion in the docstring, output >> will be different if "dirname" ends in a slash. > > Of course. directory-file-name and file-name-directory look at the > slashes, so having one more slash at the end changes everything. > There's nothing new here. > > So where do we go from here, in the context of this bug report? What > would you propose to change, where, and why? > > Thanks. -- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 02 05:59:25 2017 Received: (at 27982) by debbugs.gnu.org; 2 Sep 2017 09:59:25 +0000 Received: from localhost ([127.0.0.1]:41444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1do5D2-0005Dk-3x for submit@debbugs.gnu.org; Sat, 02 Sep 2017 05:59:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1do5D0-0005DY-E9 for 27982@debbugs.gnu.org; Sat, 02 Sep 2017 05:59:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1do5Cq-00064X-T9 for 27982@debbugs.gnu.org; Sat, 02 Sep 2017 05:59:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1do5Cq-00064L-PO; Sat, 02 Sep 2017 05:59:12 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1882 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1do5Cq-0006gg-4T; Sat, 02 Sep 2017 05:59:12 -0400 Date: Sat, 02 Sep 2017 12:59:03 +0300 Message-Id: <838thx1kwo.fsf@gnu.org> From: Eli Zaretskii To: Nicolas Richard In-reply-to: <86efrtysaw.fsf@members.fsf.org> (message from Nicolas Richard on Wed, 30 Aug 2017 17:43:51 +0200) Subject: Re: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem References: <87tw1lkjt8.fsf@members.fsf.org> <83r2wotz6i.fsf@gnu.org> <86bmn6o4tr.fsf@members.fsf.org> <83378i9nrv.fsf@gnu.org> <86wp5um6ss.fsf@members.fsf.org> <83inhc99lq.fsf@gnu.org> <86efrtysaw.fsf@members.fsf.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27982 Cc: 27982@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Nicolas Richard > Cc: 27982-done@debbugs.gnu.org > Date: Wed, 30 Aug 2017 17:43:51 +0200 > > Thanks for your help but let me close this. > > I initially thought it was "obviously wrong", but it is not. I think the > wording is slightly misleading (e.g. "dirname" vs "dir-as-file-name"), > but nothing important. I added a note to the doc string to make sure the trailing-slash issue is not overlooked. Thanks. From unknown Sun Jun 22 07:30:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 30 Sep 2017 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator