diff options
| author | Richard M. Stallman | 1993-06-10 21:15:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-10 21:15:55 +0000 |
| commit | c2225d0026d73b23be56993d1332096f02bdec0e (patch) | |
| tree | e62d04bcd53353ee878a9afe8dcdecb817ee5df5 /src | |
| parent | e98dda89869c4aee4291c9976cac54af56ffd835 (diff) | |
| download | emacs-c2225d0026d73b23be56993d1332096f02bdec0e.tar.gz emacs-c2225d0026d73b23be56993d1332096f02bdec0e.zip | |
(Fload): Forward all 4 args to magic-name handler.
(syms_of_lread): Set up Qload.
(Fload): Handle magic file names.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c index bc3fe8ee772..57410a71d78 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -52,7 +52,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 52 | 52 | ||
| 53 | Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list; | 53 | Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list; |
| 54 | Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist; | 54 | Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist; |
| 55 | Lisp_Object Qascii_character; | 55 | Lisp_Object Qascii_character, Qload; |
| 56 | 56 | ||
| 57 | extern Lisp_Object Qevent_symbol_element_mask; | 57 | extern Lisp_Object Qevent_symbol_element_mask; |
| 58 | 58 | ||
| @@ -318,10 +318,25 @@ Return t if file exists.") | |||
| 318 | Lisp_Object found; | 318 | Lisp_Object found; |
| 319 | /* 1 means inhibit the message at the beginning. */ | 319 | /* 1 means inhibit the message at the beginning. */ |
| 320 | int nomessage1 = 0; | 320 | int nomessage1 = 0; |
| 321 | Lisp_Object handler; | ||
| 321 | 322 | ||
| 322 | CHECK_STRING (str, 0); | 323 | CHECK_STRING (str, 0); |
| 323 | str = Fsubstitute_in_file_name (str); | 324 | str = Fsubstitute_in_file_name (str); |
| 324 | 325 | ||
| 326 | /* If file name is magic, call the handler. */ | ||
| 327 | handler = Ffind_file_name_handler (str); | ||
| 328 | if (!NILP (handler)) | ||
| 329 | { | ||
| 330 | Lisp_Object args[6]; | ||
| 331 | args[0] = handler; | ||
| 332 | args[1] = Qload; | ||
| 333 | args[2] = str; | ||
| 334 | args[3] = noerror; | ||
| 335 | args[4] = nomessage; | ||
| 336 | args[5] = nosuffix; | ||
| 337 | return Ffuncall (6, args); | ||
| 338 | } | ||
| 339 | |||
| 325 | /* Avoid weird lossage with null string as arg, | 340 | /* Avoid weird lossage with null string as arg, |
| 326 | since it would try to load a directory as a Lisp file */ | 341 | since it would try to load a directory as a Lisp file */ |
| 327 | if (XSTRING (str)->size > 0) | 342 | if (XSTRING (str)->size > 0) |
| @@ -1893,4 +1908,7 @@ or variables, and cons cells `(provide . FEATURE)' and `(require . FEATURE)'."); | |||
| 1893 | 1908 | ||
| 1894 | Qascii_character = intern ("ascii-character"); | 1909 | Qascii_character = intern ("ascii-character"); |
| 1895 | staticpro (&Qascii_character); | 1910 | staticpro (&Qascii_character); |
| 1911 | |||
| 1912 | Qload = intern ("load"); | ||
| 1913 | staticpro (&Qload); | ||
| 1896 | } | 1914 | } |