unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* directory-files called with empty string
@ 2009-12-08 21:20 Thierry Volpiatto
  2009-12-08 22:47 ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Volpiatto @ 2009-12-08 21:20 UTC (permalink / raw)
  To: emacs-devel

Hi all,
is it the normal behavior of directory-files to use default-directory
when it is called with empty string or is it a bug?

actually with emacs -Q:

(directory-files "")

return the content of default-directory.

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: directory-files called with empty string
  2009-12-08 21:20 directory-files called with empty string Thierry Volpiatto
@ 2009-12-08 22:47 ` Andreas Schwab
  2009-12-09  1:34   ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2009-12-08 22:47 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: emacs-devel

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> is it the normal behavior of directory-files to use default-directory
> when it is called with empty string or is it a bug?

That is the normal behviour of every file related function.  It is
basically what expand-file-name defines.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: directory-files called with empty string
  2009-12-08 22:47 ` Andreas Schwab
@ 2009-12-09  1:34   ` Stefan Monnier
  2009-12-09  6:58     ` Thierry Volpiatto
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2009-12-09  1:34 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: emacs-devel, Thierry Volpiatto

>> is it the normal behavior of directory-files to use default-directory
>> when it is called with empty string or is it a bug?
> That is the normal behviour of every file related function.  It is
> basically what expand-file-name defines.

Indeed, although I don't think it's documented, and code had probably
better not rely on it.


        Stefan




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: directory-files called with empty string
  2009-12-09  1:34   ` Stefan Monnier
@ 2009-12-09  6:58     ` Thierry Volpiatto
  2009-12-09 14:27       ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Volpiatto @ 2009-12-09  6:58 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Andreas Schwab, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> is it the normal behavior of directory-files to use default-directory
>>> when it is called with empty string or is it a bug?
>> That is the normal behviour of every file related function.  It is
>> basically what expand-file-name defines.
>
> Indeed, although I don't think it's documented, and code had probably
> better not rely on it.

Ok i see, thank you Stefan and Andreas, maybe that should be documented, for
all file related functions.

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: directory-files called with empty string
  2009-12-09  6:58     ` Thierry Volpiatto
@ 2009-12-09 14:27       ` Stefan Monnier
  2009-12-09 17:35         ` Thierry Volpiatto
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2009-12-09 14:27 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: Andreas Schwab, emacs-devel

>>>> is it the normal behavior of directory-files to use default-directory
>>>> when it is called with empty string or is it a bug?
>>> That is the normal behviour of every file related function.  It is
>>> basically what expand-file-name defines.
>> Indeed, although I don't think it's documented, and code had probably
>> better not rely on it.
> Ok i see, thank you Stefan and Andreas, maybe that should be documented, for
> all file related functions.

I prefer to keep features which are accidental undocumented, unless we
really consider them as good features (even if we bumped into them by
accident), in which case they can be documented and their use can
be blessed.


        Stefan




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: directory-files called with empty string
  2009-12-09 14:27       ` Stefan Monnier
@ 2009-12-09 17:35         ` Thierry Volpiatto
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Volpiatto @ 2009-12-09 17:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Andreas Schwab, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>>>> is it the normal behavior of directory-files to use default-directory
>>>>> when it is called with empty string or is it a bug?
>>>> That is the normal behviour of every file related function.  It is
>>>> basically what expand-file-name defines.
>>> Indeed, although I don't think it's documented, and code had probably
>>> better not rely on it.
>> Ok i see, thank you Stefan and Andreas, maybe that should be documented, for
>> all file related functions.
>
> I prefer to keep features which are accidental undocumented, unless we
> really consider them as good features (even if we bumped into them by
> accident), in which case they can be documented and their use can
> be blessed.
Yes i understand, but it is not a good feature IMHO.
These kind of functions should return an error with empty string, as
empty string is not a valid path.
But maybe this "feature" is used somewhere?

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-12-09 17:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-08 21:20 directory-files called with empty string Thierry Volpiatto
2009-12-08 22:47 ` Andreas Schwab
2009-12-09  1:34   ` Stefan Monnier
2009-12-09  6:58     ` Thierry Volpiatto
2009-12-09 14:27       ` Stefan Monnier
2009-12-09 17:35         ` Thierry Volpiatto

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).