bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#15648: 24.2.50; gnutls SSL connection to IMAP server causes emacs to


From: Stefan Monnier
Subject: bug#15648: 24.2.50; gnutls SSL connection to IMAP server causes emacs to crash completely
Date: Thu, 24 Oct 2013 20:59:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> Good point.  The problem is the use of file-exists-p (which tests if
>> Elisp code can reach this file) instead of another function along the
>> lines of file-accessible-directory-p, which checks whether the file name
>> is reachable to C-level system primitives.
> Note that the predicate "file-accessible-directory-p" is also one of

I didn't mean to say that file-accessible-directory-p is the
right answer.  Only that something *like it* should be used.
I.e. a function specifically meant to give you some idea about whether
that file is known to the OS primitives.

>> expand-file-name is not the right function, even if in some cases it may
>> happen to help.
> Why isn't it the right one?
> The function name describes it as "Convert filename NAME to absolute,
> and *canonicalize* it." (emphasis added)

You give too much meaning to "canonicalize": it does not imply that it's
the name used outside of Emacs.  It just means to try and remove things
like "<something>/../foo/<somethingelse>".

So the output will be a "somewhat canonicalized Elisp file name".
Not necessarily an "OS-level file name".  `cygwin-mount' happens to use
expand-file-name to convert the name from one form to another, basically
for pragmatic reasons: that's what exists and it is called often enough
that it works OK in practice.

> It seems that any proper Magic File handler should (by definition)
> hook into expand-file-name to provide an absolute canonicalized path,

Think of a magic file handler that provides access to members of a zip
or tar archive or think of file name handlers for Tramp.
These "canonical" file names still won't help you.

> Alternatively, how else would you recommend generally and portably
> canonicalizing a Magic file path?

You'd first have to define what kind of "canonicalizing" you want to do.
I think in the present case what you want is to turn an Elisp file name
into a file name understood by OS-level primitives (or nil if that
can't be done).  We don't have such a function right now.  So my
recommendation is to add such a function.


        Stefan





reply via email to

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