(Fload): Handle case where openp finds a magic file
but it has no `load' handler or that handler calls `load'. If FOUND != FILE, find FOUND's handler even if inhibited for FILE.
This commit is contained in:
parent
84f473b019
commit
5e24a1f76c
1 changed files with 17 additions and 6 deletions
23
src/lread.c
23
src/lread.c
|
@ -649,15 +649,25 @@ Return t if file exists.")
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
/* If FD is 0, that means openp found a remote file. */
|
||||
/* If FD is 0, that means openp found a magic file. */
|
||||
if (fd == 0)
|
||||
{
|
||||
handler = Ffind_file_name_handler (found, Qload);
|
||||
return call5 (handler, Qload, found, noerror, nomessage, Qt);
|
||||
if (NILP (Fequal (found, file)))
|
||||
/* If FOUND is a different file name from FILE,
|
||||
find its handler even if we have already inhibited
|
||||
the `load' operation on FILE. */
|
||||
handler = Ffind_file_name_handler (found, Qt);
|
||||
else
|
||||
handler = Ffind_file_name_handler (found, Qload);
|
||||
if (! NILP (handler))
|
||||
return call5 (handler, Qload, found, noerror, nomessage, Qt);
|
||||
}
|
||||
|
||||
/* Load .elc files directly, but not when they are
|
||||
remote and have no handler! */
|
||||
if (!bcmp (&(XSTRING (found)->data[XSTRING (found)->size - 4]),
|
||||
".elc", 4))
|
||||
".elc", 4)
|
||||
&& fd != 0)
|
||||
{
|
||||
struct stat s1, s2;
|
||||
int result;
|
||||
|
@ -687,7 +697,8 @@ Return t if file exists.")
|
|||
/* We are loading a source file (*.el). */
|
||||
if (!NILP (Vload_source_file_function))
|
||||
{
|
||||
close (fd);
|
||||
if (fd != 0)
|
||||
close (fd);
|
||||
return call4 (Vload_source_file_function, found, file,
|
||||
NILP (noerror) ? Qnil : Qt,
|
||||
NILP (nomessage) ? Qnil : Qt);
|
||||
|
@ -2108,7 +2119,7 @@ read1 (readcharfun, pch, first_in_list)
|
|||
{
|
||||
/* Compute NaN and infinities using 0.0 in a variable,
|
||||
to cope with compilers that think they are smarter
|
||||
than us. */
|
||||
than we are. */
|
||||
double zero = 0.0;
|
||||
|
||||
double value;
|
||||
|
|
Loading…
Add table
Reference in a new issue