aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-03-21 20:05:23 +0000
committerRichard M. Stallman1995-03-21 20:05:23 +0000
commit84a150451b13a779f1d2e638e0b49047bc793441 (patch)
treeb5fcf0041d12783cc46a76be2c84c72136b99c6a /src
parent1fc318144926bf2254a5a101f7a73233d23c7e4e (diff)
downloademacs-84a150451b13a779f1d2e638e0b49047bc793441.tar.gz
emacs-84a150451b13a779f1d2e638e0b49047bc793441.zip
(Vload_read_function): New variable.
(readevalloop): Use that variable. (syms_of_lread): Set up Lisp variable.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lread.c b/src/lread.c
index f0afa5f0710..1af746ad9ef 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -87,6 +87,9 @@ Lisp_Object Vcurrent_load_list;
87/* Name of file actually being read by `load'. */ 87/* Name of file actually being read by `load'. */
88Lisp_Object Vload_file_name; 88Lisp_Object Vload_file_name;
89 89
90/* Function to use for reading, in `load' and friends. */
91Lisp_Object Vload_read_function;
92
90/* List of descriptors now open for Fload. */ 93/* List of descriptors now open for Fload. */
91static Lisp_Object load_descriptor_list; 94static Lisp_Object load_descriptor_list;
92 95
@@ -743,7 +746,10 @@ readevalloop (readcharfun, stream, sourcename, evalfun, printflag)
743 else 746 else
744 { 747 {
745 UNREAD (c); 748 UNREAD (c);
746 val = read0 (readcharfun); 749 if (NILP (Vload_read_function))
750 val = read0 (readcharfun);
751 else
752 val = call1 (Vload_read_function, readcharfun);
747 } 753 }
748 754
749 val = (*evalfun) (val); 755 val = (*evalfun) (val);
@@ -2083,6 +2089,11 @@ or variables, and cons cells `(provide . FEATURE)' and `(require . FEATURE)'.");
2083 "Used for internal purposes by `load'."); 2089 "Used for internal purposes by `load'.");
2084 Vcurrent_load_list = Qnil; 2090 Vcurrent_load_list = Qnil;
2085 2091
2092 DEFVAR_LISP ("load-read-function", &Vload_read_function,
2093 "Function used by `load' and `eval-region' for reading expressions.\n\
2094The default is nil, which means use the function `read'.");
2095 Vload_read_function = Qnil;
2096
2086 load_descriptor_list = Qnil; 2097 load_descriptor_list = Qnil;
2087 staticpro (&load_descriptor_list); 2098 staticpro (&load_descriptor_list);
2088 2099