From unknown Sun Jun 22 07:58:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6273: dired-current-directory with `t' arg returns empty string in top-level mount-point "/" Resent-From: MON KEY Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 May 2010 21:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6273 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6273@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.127482233132384 (code B ref -1); Tue, 25 May 2010 21:19:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 May 2010 21:18:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OH1WU-0008QH-RF for submit@debbugs.gnu.org; Tue, 25 May 2010 17:18:51 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OH1WS-0008QC-NQ for submit@debbugs.gnu.org; Tue, 25 May 2010 17:18:49 -0400 Received: from lists.gnu.org ([199.232.76.165]:59740) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OH1WO-0001Fb-JN for submit@debbugs.gnu.org; Tue, 25 May 2010 17:18:44 -0400 Received: from [140.186.70.92] (port=39837 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OH1WM-00008K-H2 for bug-gnu-emacs@gnu.org; Tue, 25 May 2010 17:18:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OH1WL-0005f6-Gk for bug-gnu-emacs@gnu.org; Tue, 25 May 2010 17:18:42 -0400 Received: from mail-gw0-f41.google.com ([74.125.83.41]:50102) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OH1WL-0005es-EW for bug-gnu-emacs@gnu.org; Tue, 25 May 2010 17:18:41 -0400 Received: by gwb19 with SMTP id 19so1755630gwb.0 for ; Tue, 25 May 2010 14:18:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.3.25 with SMTP id f25mr8112440ybi.183.1274822320491; Tue, 25 May 2010 14:18:40 -0700 (PDT) Received: by 10.151.143.21 with HTTP; Tue, 25 May 2010 14:18:40 -0700 (PDT) Date: Tue, 25 May 2010 17:18:40 -0400 X-Google-Sender-Auth: nwjptLzZleLPmCZL7gvPeGU_ZbM Message-ID: From: MON KEY Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) (dired-current-directory t) returns the empty string when in a `top-level' mount point, e.g. "/" (progn (dired "/" ) (dired-current-directory t)) => "" ,---- (documentation 'dired-current-directory) | {...} | This returns a string with trailing slash, like `default-directory'. | Optional argument means return a file name relative to `default-directory'. `---- In the case at hand it does not return a string with trailing slash... and appears in contrast to the return value of following forms: (progn (dired "/") (file-relative-name default-directory)) => "./" (progn (dired "/") (file-relative-name (dired-default-directory))) => "./" which are likewise at odds with each of the following: (progn (dired "/") (dired-make-relative (dired-default-directory))) => "" (progn (dired "/") (dired-make-relative (dired-make-absolute default-directory))) => "/" So which is the correct return value? Relatively speaking... GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-05-10 -- /s_P\ From unknown Sun Jun 22 07:58:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6273: dired-current-directory with `t' arg returns empty string in top-level mount-point "/" Resent-From: Alexis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Jan 2016 12:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6273 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: MON KEY Cc: 6273@debbugs.gnu.org Received: via spool by 6273-submit@debbugs.gnu.org id=B6273.145208450310065 (code B ref 6273); Wed, 06 Jan 2016 12:49:02 +0000 Received: (at 6273) by debbugs.gnu.org; 6 Jan 2016 12:48:23 +0000 Received: from localhost ([127.0.0.1]:39486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGnVm-0002cH-Qe for submit@debbugs.gnu.org; Wed, 06 Jan 2016 07:48:22 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:36439) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aGnVl-0002c4-37 for 6273@debbugs.gnu.org; Wed, 06 Jan 2016 07:48:21 -0500 Received: by mail-pf0-f180.google.com with SMTP id 65so193483560pff.3 for <6273@debbugs.gnu.org>; Wed, 06 Jan 2016 04:48:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=ninxMzHutNHBdz1tK4GeWBj/Ty9GorLpTRy/Sf1GUQw=; b=iehfSudE6Hw424HBoMevlKQ9sOaQrQdRTltAUs9Z7ChQ3s1Y7CtlcrPMfwkyfPtvg3 gpLDbQ/HHwxVoOLEpX1wKOJO+rhKyajBNFIqYEjvVoxNG1wknUDYYs9vJKqCrQ8j8W1t tIjT4eiRZHZPpV1pDKZ7W41wqSQHzT0r6OJFRjdHQER7WsnoSjK04lT+s4nEOU2nbKlV HQ931m8KNkeZXZejVkmdI92e38qkBKW8Ikre9bGDrgMqp+PQLaAhOAmnpDCBO5bTz/ZZ XW74SO4K26J/XHGNLgT9OSwdkaz5xgyk23wGhy3ErKu/WOcKUwcCpsFfKmyrHG/q9byN rHmw== X-Received: by 10.98.0.149 with SMTP id 143mr140075171pfa.73.1452084495209; Wed, 06 Jan 2016 04:48:15 -0800 (PST) Received: from localhost (114-198-94-242.dyn.iinet.net.au. [114.198.94.242]) by smtp.gmail.com with ESMTPSA id 70sm85500813pfa.3.2016.01.06.04.48.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jan 2016 04:48:13 -0800 (PST) From: Alexis References: Date: Wed, 06 Jan 2016 23:48:09 +1100 In-Reply-To: (MON KEY's message of "Tue, 25 May 2010 17:18:40 -0400") Message-ID: <87ziwiq3g6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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 (/) Since the documentation for `dired-current-directory' states: "Optional argument means return a file name relative to `default-directory'" and there is no file name to return in the case that `dired-current-directory' and `default-directory' are the same, an empty string seems to be a reasonable return value here. More generally, regarding the various values returned in each of the examples provided, my feeling is that unless Emacs contains code in which these various return values directly interact with each other to produce obviously incorrect results, this bug should either be closed or tagged 'wishlist'. From unknown Sun Jun 22 07:58:56 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: MON KEY Subject: bug#6273: closed (Re: bug#6273: dired-current-directory with `t' arg returns empty string in top-level mount-point "/") Message-ID: References: <83poxcpd09.fsf@gnu.org> X-Gnu-PR-Message: they-closed 6273 X-Gnu-PR-Package: emacs Reply-To: 6273@debbugs.gnu.org Date: Fri, 08 Jan 2016 10:45:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1452249902-1077-1" This is a multi-part message in MIME format... ------------=_1452249902-1077-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #6273: dired-current-directory with `t' arg returns empty string in top-le= vel mount-point "/" which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 6273@debbugs.gnu.org. --=20 6273: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D6273 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1452249902-1077-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 6273-done) by debbugs.gnu.org; 8 Jan 2016 10:44:03 +0000 Received: from localhost ([127.0.0.1]:42306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHUWZ-0000G2-HZ for submit@debbugs.gnu.org; Fri, 08 Jan 2016 05:44:03 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59270) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHUWX-0000FP-MS for 6273-done@debbugs.gnu.org; Fri, 08 Jan 2016 05:44:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHUWP-000203-Qe for 6273-done@debbugs.gnu.org; Fri, 08 Jan 2016 05:43:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHUWP-0001zz-Nd; Fri, 08 Jan 2016 05:43:53 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1261 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aHUWO-0005QE-Vc; Fri, 08 Jan 2016 05:43:53 -0500 Date: Fri, 08 Jan 2016 12:43:50 +0200 Message-Id: <83poxcpd09.fsf@gnu.org> From: Eli Zaretskii To: Alexis In-reply-to: <87ziwiq3g6.fsf@gmail.com> (message from Alexis on Wed, 06 Jan 2016 23:48:09 +1100) Subject: Re: bug#6273: dired-current-directory with `t' arg returns empty string in top-level mount-point "/" References: <87ziwiq3g6.fsf@gmail.com> 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: 6273-done Cc: 6273-done@debbugs.gnu.org, monkey@sandpframing.com 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: Alexis > Date: Wed, 06 Jan 2016 23:48:09 +1100 > Cc: 6273@debbugs.gnu.org > > Since the documentation for `dired-current-directory' states: > > "Optional argument means return a file name relative to > `default-directory'" > > and there is no file name to return in the case that > `dired-current-directory' and `default-directory' are the same, > an empty string seems to be a reasonable return value here. Actually, the value returned by dired-current-directory is always an empty string of default-directory is the same one as the directory where the file on the current line lives. IOW, the issue is not limited to "/" as the current directory of the Dired buffer. I think this is just something that needs to be clarified in the doc string, so I just pushed such a change, and I'm marking this bug done. Thanks for looking into it. ------------=_1452249902-1077-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 May 2010 21:18:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OH1WU-0008QH-RF for submit@debbugs.gnu.org; Tue, 25 May 2010 17:18:51 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OH1WS-0008QC-NQ for submit@debbugs.gnu.org; Tue, 25 May 2010 17:18:49 -0400 Received: from lists.gnu.org ([199.232.76.165]:59740) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OH1WO-0001Fb-JN for submit@debbugs.gnu.org; Tue, 25 May 2010 17:18:44 -0400 Received: from [140.186.70.92] (port=39837 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OH1WM-00008K-H2 for bug-gnu-emacs@gnu.org; Tue, 25 May 2010 17:18:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OH1WL-0005f6-Gk for bug-gnu-emacs@gnu.org; Tue, 25 May 2010 17:18:42 -0400 Received: from mail-gw0-f41.google.com ([74.125.83.41]:50102) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OH1WL-0005es-EW for bug-gnu-emacs@gnu.org; Tue, 25 May 2010 17:18:41 -0400 Received: by gwb19 with SMTP id 19so1755630gwb.0 for ; Tue, 25 May 2010 14:18:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.3.25 with SMTP id f25mr8112440ybi.183.1274822320491; Tue, 25 May 2010 14:18:40 -0700 (PDT) Received: by 10.151.143.21 with HTTP; Tue, 25 May 2010 14:18:40 -0700 (PDT) Date: Tue, 25 May 2010 17:18:40 -0400 X-Google-Sender-Auth: nwjptLzZleLPmCZL7gvPeGU_ZbM Message-ID: Subject: dired-current-directory with `t' arg returns empty string in top-level mount-point "/" From: MON KEY To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) (dired-current-directory t) returns the empty string when in a `top-level' mount point, e.g. "/" (progn (dired "/" ) (dired-current-directory t)) => "" ,---- (documentation 'dired-current-directory) | {...} | This returns a string with trailing slash, like `default-directory'. | Optional argument means return a file name relative to `default-directory'. `---- In the case at hand it does not return a string with trailing slash... and appears in contrast to the return value of following forms: (progn (dired "/") (file-relative-name default-directory)) => "./" (progn (dired "/") (file-relative-name (dired-default-directory))) => "./" which are likewise at odds with each of the following: (progn (dired "/") (dired-make-relative (dired-default-directory))) => "" (progn (dired "/") (dired-make-relative (dired-make-absolute default-directory))) => "/" So which is the correct return value? Relatively speaking... GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-05-10 -- /s_P\ ------------=_1452249902-1077-1--