diff options
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/lread.c b/src/lread.c index 24183532527..6a24569f552 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -796,16 +796,16 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun) | |||
| 796 | } beg_end_state = NOMINAL; | 796 | } beg_end_state = NOMINAL; |
| 797 | int in_file_vars = 0; | 797 | int in_file_vars = 0; |
| 798 | 798 | ||
| 799 | #define UPDATE_BEG_END_STATE(ch) \ | 799 | #define UPDATE_BEG_END_STATE(ch) \ |
| 800 | if (beg_end_state == NOMINAL) \ | 800 | if (beg_end_state == NOMINAL) \ |
| 801 | beg_end_state = (ch == '-' ? AFTER_FIRST_DASH : NOMINAL); \ | 801 | beg_end_state = (ch == '-' ? AFTER_FIRST_DASH : NOMINAL); \ |
| 802 | else if (beg_end_state == AFTER_FIRST_DASH) \ | 802 | else if (beg_end_state == AFTER_FIRST_DASH) \ |
| 803 | beg_end_state = (ch == '*' ? AFTER_ASTERIX : NOMINAL); \ | 803 | beg_end_state = (ch == '*' ? AFTER_ASTERIX : NOMINAL); \ |
| 804 | else if (beg_end_state == AFTER_ASTERIX) \ | 804 | else if (beg_end_state == AFTER_ASTERIX) \ |
| 805 | { \ | 805 | { \ |
| 806 | if (ch == '-') \ | 806 | if (ch == '-') \ |
| 807 | in_file_vars = !in_file_vars; \ | 807 | in_file_vars = !in_file_vars; \ |
| 808 | beg_end_state = NOMINAL; \ | 808 | beg_end_state = NOMINAL; \ |
| 809 | } | 809 | } |
| 810 | 810 | ||
| 811 | /* Skip until we get to the file vars, if any. */ | 811 | /* Skip until we get to the file vars, if any. */ |
| @@ -834,7 +834,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun) | |||
| 834 | UPDATE_BEG_END_STATE (ch); | 834 | UPDATE_BEG_END_STATE (ch); |
| 835 | ch = READCHAR; | 835 | ch = READCHAR; |
| 836 | } | 836 | } |
| 837 | 837 | ||
| 838 | while (var_end > var | 838 | while (var_end > var |
| 839 | && (var_end[-1] == ' ' || var_end[-1] == '\t')) | 839 | && (var_end[-1] == ' ' || var_end[-1] == '\t')) |
| 840 | var_end--; | 840 | var_end--; |
| @@ -880,7 +880,6 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun) | |||
| 880 | return rv; | 880 | return rv; |
| 881 | } | 881 | } |
| 882 | } | 882 | } |
| 883 | |||
| 884 | 883 | ||
| 885 | /* Value is a version number of byte compiled code if the file | 884 | /* Value is a version number of byte compiled code if the file |
| 886 | associated with file descriptor FD is a compiled Lisp file that's | 885 | associated with file descriptor FD is a compiled Lisp file that's |
| @@ -1275,7 +1274,6 @@ Return t if the file exists and loads successfully. */) | |||
| 1275 | specbind (Qinhibit_file_name_operation, Qnil); | 1274 | specbind (Qinhibit_file_name_operation, Qnil); |
| 1276 | load_descriptor_list | 1275 | load_descriptor_list |
| 1277 | = Fcons (make_number (fileno (stream)), load_descriptor_list); | 1276 | = Fcons (make_number (fileno (stream)), load_descriptor_list); |
| 1278 | |||
| 1279 | specbind (Qload_in_progress, Qt); | 1277 | specbind (Qload_in_progress, Qt); |
| 1280 | 1278 | ||
| 1281 | instream = stream; | 1279 | instream = stream; |
| @@ -1863,11 +1861,9 @@ This function preserves the position of point. */) | |||
| 1863 | 1861 | ||
| 1864 | specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list)); | 1862 | specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list)); |
| 1865 | specbind (Qstandard_output, tem); | 1863 | specbind (Qstandard_output, tem); |
| 1866 | specbind (Qlexical_binding, Qnil); | ||
| 1867 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 1864 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); |
| 1868 | BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); | 1865 | BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); |
| 1869 | if (lisp_file_lexically_bound_p (buf)) | 1866 | specbind (Qlexical_binding, lisp_file_lexically_bound_p (buf) ? Qt : Qnil); |
| 1870 | Fset (Qlexical_binding, Qt); | ||
| 1871 | readevalloop (buf, 0, filename, | 1867 | readevalloop (buf, 0, filename, |
| 1872 | !NILP (printflag), unibyte, Qnil, Qnil, Qnil); | 1868 | !NILP (printflag), unibyte, Qnil, Qnil, Qnil); |
| 1873 | unbind_to (count, Qnil); | 1869 | unbind_to (count, Qnil); |
| @@ -3336,7 +3332,6 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag) | |||
| 3336 | for (i = 0; i < size; i++) | 3332 | for (i = 0; i < size; i++) |
| 3337 | { | 3333 | { |
| 3338 | item = Fcar (tem); | 3334 | item = Fcar (tem); |
| 3339 | |||
| 3340 | /* If `load-force-doc-strings' is t when reading a lazily-loaded | 3335 | /* If `load-force-doc-strings' is t when reading a lazily-loaded |
| 3341 | bytecode object, the docstring containing the bytecode and | 3336 | bytecode object, the docstring containing the bytecode and |
| 3342 | constants values must be treated as unibyte and passed to | 3337 | constants values must be treated as unibyte and passed to |
| @@ -3394,7 +3389,6 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag) | |||
| 3394 | tem = Fcdr (tem); | 3389 | tem = Fcdr (tem); |
| 3395 | free_cons (otem); | 3390 | free_cons (otem); |
| 3396 | } | 3391 | } |
| 3397 | |||
| 3398 | return vector; | 3392 | return vector; |
| 3399 | } | 3393 | } |
| 3400 | 3394 | ||
| @@ -4024,7 +4018,6 @@ defvar_lisp (struct Lisp_Objfwd *o_fwd, | |||
| 4024 | staticpro (address); | 4018 | staticpro (address); |
| 4025 | } | 4019 | } |
| 4026 | 4020 | ||
| 4027 | |||
| 4028 | /* Similar but define a variable whose value is the Lisp Object stored | 4021 | /* Similar but define a variable whose value is the Lisp Object stored |
| 4029 | at a particular offset in the current kboard object. */ | 4022 | at a particular offset in the current kboard object. */ |
| 4030 | 4023 | ||
| @@ -4470,7 +4463,7 @@ to load. See also `load-dangerous-libraries'. */); | |||
| 4470 | doc: /* If non-nil, use lexical binding when evaluating code. | 4463 | doc: /* If non-nil, use lexical binding when evaluating code. |
| 4471 | This only applies to code evaluated by `eval-buffer' and `eval-region'. | 4464 | This only applies to code evaluated by `eval-buffer' and `eval-region'. |
| 4472 | This variable is automatically set from the file variables of an interpreted | 4465 | This variable is automatically set from the file variables of an interpreted |
| 4473 | lisp file read using `load'. */); | 4466 | Lisp file read using `load'. */); |
| 4474 | Fmake_variable_buffer_local (Qlexical_binding); | 4467 | Fmake_variable_buffer_local (Qlexical_binding); |
| 4475 | 4468 | ||
| 4476 | DEFVAR_LISP ("eval-buffer-list", Veval_buffer_list, | 4469 | DEFVAR_LISP ("eval-buffer-list", Veval_buffer_list, |