emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r116230: Fix bug #16558 with w32-shell-execute o


From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r116230: Fix bug #16558 with w32-shell-execute on remote file names.
Date: Wed, 05 Feb 2014 09:10:46 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> (if (file-name-absolute-p file) <use file>
>> (let ((dir (file-name-directory file)))
>> (if (null dir) <use file>
>> (if (faccess dir) <use (expand-file-name file)>
>> <use file>))))
> Yes, except that the primitives you use here only work on file names,
> and might go bananas when presented with something else, e.g. a URL.

AFAIK all magic file-name handlers will do something reasonable with
the above (file-name-absolute-p file) and (file-name-directory file).

But we could also let-bind file-name-handlers-alist to nil around those
calls (or use lower level code which does something similar).  We don't
need to call the Elisp primitives since we really only care about the
system-level's notion of absolute file name and file name separator.

> So using the above does not solve the basic problem, which is: do we
> have a file name on our hands or something else?  The faccess test is
> the only thing that provides us with some assurance.

The difference I suggest is:
- we don't check file-name-handlers
- we only check (faccess dir) rather than (faccess file), and only if
  there's a "dir".
- we don't bother with any of it if the file is already absolute.


        Stefan



reply via email to

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