[Top][All Lists]

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

Re: [Emacs-diffs] master 0528a7c: Ensure that expand-file-name returns a

From: Eli Zaretskii
Subject: Re: [Emacs-diffs] master 0528a7c: Ensure that expand-file-name returns an absolute file name
Date: Tue, 09 Jul 2019 17:50:57 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden,  address@hidden
> Date: Mon, 08 Jul 2019 23:46:06 -0400
> > In the bug discussion I explained why I thought this alternative was
> > better.
> I didn't see it there.


> You mentioned that you preferred to avoid the inf-loop, but that
> doesn't mean you prefer for expand-file-name to use an arbitrary
> (hopefully) absolute file name as default default directory over
> signaling an error.

It isn't entirely arbitrary.  A relative file name can be interpreted
by taking some directory as cwd.  Is there a better candidate for that
than invocation-directory?  We cannot use "." and we cannot use nil in
this case, for obvious reasons.

> Signaling a clear error here would have helped the programmer find the
> real problem and fix it quickly, whereas the patch we installed caters
> to broken code, encouraging bad practices.

I think expand-file-name should try to avoid signaling an error as
much as possible, because it is called by many primitives and core
functions.  If we signal an error, we risk getting the users into a
situation where they cannot even shut down Emacs, let alone do
something less trivial.

reply via email to

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