emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: directory-sep-char


From: Stefan Monnier
Subject: Re: directory-sep-char
Date: Sun, 25 Nov 2001 14:47:08 -0500

> > > After bitter experiences fixing elisp files only to discover that
> > > `directory-sep-char' was deprecated, I'd like to know if it's ok to
> > > apply this patch and then go over the following files
> > Is it really obsolete ?
> We decided to deprecate it (about a year ago, I think).

Yes, I remember it.

> > I don't know how important it is (I actually don't use non-Unix systems),
> > but I think it's worth considering whether Emacs should try to
> > display paths in unix style or in native style.
> 
> I agree with the goal, but unfortunately making it happen is very
> hard.
> 
> The problem is that the assumption that `/' is a directory separator
> is built into the Emacs code in too many places.  We solved this on
> the C level (see the IS_DIRECTORY_SEP macro), but many Lisp files have
> `/' hard-wired into them as well.  What's more, quite a few of those
> places have regexps set up on the assumption that `/' is the
> separator, and other places use the backslashes in file names for
> conflicting purposes (such as quoting).
> 
> Making all this support directory-sep-char is a lifetime's work that
> no one will probably ever invest.
> 
> The MS-DOS port never supported directory-sep-char (it always behaves
> as if its value were `/').  The Windows port heroically tried to
> support it for a few years, but Andrew and Jason came to the
> conclusion that it couldn't be supported in a consistent manner (even
> if you set it to `\', the forward slash keeps creeping in in all kinds
> of places, and some functions break).  So we decided to be honest and
> drop it.

My question was not so much about whether we should eliminate dependencies
on `/' but whether we should keep `directory-sep-char' for use as the
"esthetically preferred directory separator".  That's how I used it in
uniquify.el where I neither depend on `/' nor on `directory-sep-char' for
correctness but I use `directory-sep-char' for display (just as Jason
mentioned).
This kind of use is "harmless" (the underlying primitives have to handle
both / and native directory separators anyway so both forms of filenames
should be equivalent) but is an added value to the user who can chose
her favorite display.  Of course, this value might be irrelevant since
the user has to get used to / appearing as a directory separator anyway.
I guess the question boils down to:
Should we keep the current "sometimes display / sometimes something else"
or should we just stop trying to display native paths or should we
strive to display paths in native form as much as possible ?

Since `directory-sep-char' was deprecated a while back, I guess it means
the decision has been made to not try and display native paths.
Sorry for being slow,


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]