aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1998-09-06 13:57:32 +0000
committerKarl Heuer1998-09-06 13:57:32 +0000
commit5e24a1f76c0aba5b5a650e1837f650fc75dc9ea3 (patch)
tree6016f510d54fa079b727bcbfe101becf4d4ced48
parent84f473b019cc929576d6e4ea27461765d9210fe7 (diff)
downloademacs-5e24a1f76c0aba5b5a650e1837f650fc75dc9ea3.tar.gz
emacs-5e24a1f76c0aba5b5a650e1837f650fc75dc9ea3.zip
(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.
-rw-r--r--src/lread.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/lread.c b/src/lread.c
index 04f34e88690..72ebd3589ba 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -649,15 +649,25 @@ Return t if file exists.")
649 return Qnil; 649 return Qnil;
650 } 650 }
651 651
652 /* If FD is 0, that means openp found a remote file. */ 652 /* If FD is 0, that means openp found a magic file. */
653 if (fd == 0) 653 if (fd == 0)
654 { 654 {
655 handler = Ffind_file_name_handler (found, Qload); 655 if (NILP (Fequal (found, file)))
656 return call5 (handler, Qload, found, noerror, nomessage, Qt); 656 /* If FOUND is a different file name from FILE,
657 find its handler even if we have already inhibited
658 the `load' operation on FILE. */
659 handler = Ffind_file_name_handler (found, Qt);
660 else
661 handler = Ffind_file_name_handler (found, Qload);
662 if (! NILP (handler))
663 return call5 (handler, Qload, found, noerror, nomessage, Qt);
657 } 664 }
658 665
666 /* Load .elc files directly, but not when they are
667 remote and have no handler! */
659 if (!bcmp (&(XSTRING (found)->data[XSTRING (found)->size - 4]), 668 if (!bcmp (&(XSTRING (found)->data[XSTRING (found)->size - 4]),
660 ".elc", 4)) 669 ".elc", 4)
670 && fd != 0)
661 { 671 {
662 struct stat s1, s2; 672 struct stat s1, s2;
663 int result; 673 int result;
@@ -687,7 +697,8 @@ Return t if file exists.")
687 /* We are loading a source file (*.el). */ 697 /* We are loading a source file (*.el). */
688 if (!NILP (Vload_source_file_function)) 698 if (!NILP (Vload_source_file_function))
689 { 699 {
690 close (fd); 700 if (fd != 0)
701 close (fd);
691 return call4 (Vload_source_file_function, found, file, 702 return call4 (Vload_source_file_function, found, file,
692 NILP (noerror) ? Qnil : Qt, 703 NILP (noerror) ? Qnil : Qt,
693 NILP (nomessage) ? Qnil : Qt); 704 NILP (nomessage) ? Qnil : Qt);
@@ -2108,7 +2119,7 @@ read1 (readcharfun, pch, first_in_list)
2108 { 2119 {
2109 /* Compute NaN and infinities using 0.0 in a variable, 2120 /* Compute NaN and infinities using 0.0 in a variable,
2110 to cope with compilers that think they are smarter 2121 to cope with compilers that think they are smarter
2111 than us. */ 2122 than we are. */
2112 double zero = 0.0; 2123 double zero = 0.0;
2113 2124
2114 double value; 2125 double value;