Subject: bug#6273: closed (Re: bug#6273: dired-current-directory with `t' arg returns empty string in top-level mount-point "/")

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 08 Jan 2016 10:45:02 +0000

Your bug report

#6273: dired-current-directory with `t' arg returns empty string in  top-level 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 [email-masked].

-- 
6273: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6273
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#6273: dired-current-directory with `t' arg returns empty string in top-level mount-point "/"
From: Eli Zaretskii <[email-masked]>
To: Alexis <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Fri, 08 Jan 2016 12:43:50 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Alexis <[email-masked]>
> Date: Wed, 06 Jan 2016 23:48:09 +1100
> Cc: [email-masked]
> 
> 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.

Subject: dired-current-directory with `t' arg returns empty string in top-level mount-point "/"
From: MON KEY <[email-masked]>
To: [email-masked]
Date: Tue, 25 May 2010 17:18:40 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

(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\