From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.bugs Subject: bug#27982: 25.1.50; expand-file-name docstring on how to traverse the filesystem Date: Sun, 06 Aug 2017 13:38:32 +0200 Message-ID: <87tw1lkjt8.fsf@members.fsf.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1502019560 22546 195.159.176.226 (6 Aug 2017 11:39:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 6 Aug 2017 11:39:20 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 25.1.50.1 To: 27982@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 06 13:39:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1deJtk-0005D5-2X for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Aug 2017 13:39:08 +0200 Original-Received: from localhost ([::1]:60922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deJtq-0001tV-BT for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Aug 2017 07:39:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1deJtj-0001tF-Ap for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 07:39:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1deJte-00084x-Ch for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 07:39:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41447) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1deJte-00084t-8g for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 07:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1deJte-0003c1-25 for bug-gnu-emacs@gnu.org; Sun, 06 Aug 2017 07:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Richard Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Aug 2017 11:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27982 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.150201953113865 (code B ref -1); Sun, 06 Aug 2017 11:39:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Aug 2017 11:38:51 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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: 9a23:ucHAoBVG70QUVeWakpgxMWNXREfV8LGtZVwlr6E/grcLSJyIuqrYYxaAt8tkgFKBZ4jH8fUM07OQ6PGwHzRYqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjSwbLdxIRmssQndqtQdjJd/JKo21hbHuGZDdf5MxWNvK1KTnhL86dm18ZV+7SleuO8v+tBZX6nicKs2UbJXDDI9M2Ao/8LrrgXMTRGO5nQHTGoblAdDDhXf4xH7WpfxtTb6tvZ41SKHM8D6Uaw4VDK/5KptVRTmijoINyQh/W7ZisJ+kr9VrhGvqRNw34HZe4SVOOZkc67HYd8XX3ZNU8BMXCJBGIO8aI4PAvIZM+ZZs4b9oF8OogGlBQKxGO3vyyNHhn/s0q0gzusqDAbL3QwnH9ITtnTUo9v1NL0VUeC616TIyCvMb/ZN1jjj8ojIaQotof+XXbJ+a8bRzlMvFwzcg1iWtIfrPCuV2/wOvmSG9eZsS+2ih3M9pw1srTWj2N0ghpTLi44LzF3P6D93z5wvJdKiTU52edukEJxNuC6EL4Z2WcYiQ31wuCY9170GpYa3fCgUx5QjwB7Sc+SHc4iJ4h39TeqRLzZ4hX17d76nhhay91avyvHkW8S3zVpGtDRJn9bRunwXyhDe5daLRuFg8kqjxzqDzwXT5ftFIUAwm6rbMZkhwrsom5sTtkTDAyn2mEr4jK+McUUk 9fOl6+H5bbXjvZCTKZV0ihrkPqQggcy/D/40Mg8UX2iU4ei8zqHs/VXlQLVWif07irLWsI3VJcgCqa65BRJV3p895Ba6FTipzM X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DQCgDE/oZZ/6yO8VFchApkbSePAo82AgEBCAcDAQEBAQEBBgWBITMBlWWCEiSFI4RMQBgBAQEBAQEBAQEBAWoogjMigkMBXDsUAwECCjQBKRYhiiIRr1qLaA+DKIMHhR2EclUshQkfBZB1jkhSpn+RSIRAHziBCjIhMVGHHD42hl+CQQEBAQ X-IPAS-Result: A2DQCgDE/oZZ/6yO8VFchApkbSePAo82AgEBCAcDAQEBAQEBBgWBITMBlWWCEiSFI4RMQBgBAQEBAQEBAQEBAWoogjMigkMBXDsUAwECCjQBKRYhiiIRr1qLaA+DKIMHhR2EclUshQkfBZB1jkhSpn+RSIRAHziBCjIhMVGHHD42hl+CQQEBAQ Original-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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135485 Archived-At: --=-=-= 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 --=-=-=--