Mercurial > emacs
comparison src/lread.c @ 23193:c12a3c0be4ee
(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.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sun, 06 Sep 1998 13:57:32 +0000 |
parents | b468525b44b8 |
children | 38519676398c |
comparison
equal
deleted
inserted
replaced
23192:1ea9db09a678 | 23193:c12a3c0be4ee |
---|---|
647 Fcons (file, Qnil))); | 647 Fcons (file, Qnil))); |
648 else | 648 else |
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 } | 657 find its handler even if we have already inhibited |
658 | 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); | |
664 } | |
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; |
664 | 674 |
665 compiled = 1; | 675 compiled = 1; |
685 else | 695 else |
686 { | 696 { |
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); |
694 } | 705 } |
695 } | 706 } |
2106 #ifdef LISP_FLOAT_TYPE | 2117 #ifdef LISP_FLOAT_TYPE |
2107 if (isfloat_string (read_buffer)) | 2118 if (isfloat_string (read_buffer)) |
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; |
2115 | 2126 |
2116 /* Negate the value ourselves. This treats 0, NaNs, | 2127 /* Negate the value ourselves. This treats 0, NaNs, |