diff options
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 62 |
1 files changed, 27 insertions, 35 deletions
diff --git a/src/lread.c b/src/lread.c index 39378bb11dd..94ae4dd4282 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -80,7 +80,7 @@ static Lisp_Object Qascii_character, Qload, Qload_file_name; | |||
| 80 | Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; | 80 | Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; |
| 81 | static Lisp_Object Qinhibit_file_name_operation; | 81 | static Lisp_Object Qinhibit_file_name_operation; |
| 82 | static Lisp_Object Qeval_buffer_list; | 82 | static Lisp_Object Qeval_buffer_list; |
| 83 | static Lisp_Object Qlexical_binding; | 83 | Lisp_Object Qlexical_binding; |
| 84 | static Lisp_Object Qfile_truename, Qdo_after_load_evaluation; /* ACM 2006/5/16 */ | 84 | static Lisp_Object Qfile_truename, Qdo_after_load_evaluation; /* ACM 2006/5/16 */ |
| 85 | 85 | ||
| 86 | /* Used instead of Qget_file_char while loading *.elc files compiled | 86 | /* Used instead of Qget_file_char while loading *.elc files compiled |
| @@ -3189,7 +3189,7 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj | |||
| 3189 | /* Check for text properties in each interval. | 3189 | /* Check for text properties in each interval. |
| 3190 | substitute_in_interval contains part of the logic. */ | 3190 | substitute_in_interval contains part of the logic. */ |
| 3191 | 3191 | ||
| 3192 | INTERVAL root_interval = STRING_INTERVALS (subtree); | 3192 | INTERVAL root_interval = string_get_intervals (subtree); |
| 3193 | Lisp_Object arg = Fcons (object, placeholder); | 3193 | Lisp_Object arg = Fcons (object, placeholder); |
| 3194 | 3194 | ||
| 3195 | traverse_intervals_noorder (root_interval, | 3195 | traverse_intervals_noorder (root_interval, |
| @@ -3211,7 +3211,7 @@ substitute_in_interval (INTERVAL interval, Lisp_Object arg) | |||
| 3211 | Lisp_Object object = Fcar (arg); | 3211 | Lisp_Object object = Fcar (arg); |
| 3212 | Lisp_Object placeholder = Fcdr (arg); | 3212 | Lisp_Object placeholder = Fcdr (arg); |
| 3213 | 3213 | ||
| 3214 | SUBSTITUTE (interval->plist, interval->plist = true_value); | 3214 | SUBSTITUTE (interval->plist, interval_set_plist (interval, true_value)); |
| 3215 | } | 3215 | } |
| 3216 | 3216 | ||
| 3217 | 3217 | ||
| @@ -3715,11 +3715,11 @@ it defaults to the value of `obarray'. */) | |||
| 3715 | SET_SYMBOL_VAL (XSYMBOL (sym), sym); | 3715 | SET_SYMBOL_VAL (XSYMBOL (sym), sym); |
| 3716 | } | 3716 | } |
| 3717 | 3717 | ||
| 3718 | ptr = &AREF (obarray, XINT(tem)); | 3718 | ptr = aref_addr (obarray, XINT(tem)); |
| 3719 | if (SYMBOLP (*ptr)) | 3719 | if (SYMBOLP (*ptr)) |
| 3720 | XSYMBOL (sym)->next = XSYMBOL (*ptr); | 3720 | set_symbol_next (sym, XSYMBOL (*ptr)); |
| 3721 | else | 3721 | else |
| 3722 | XSYMBOL (sym)->next = 0; | 3722 | set_symbol_next (sym, NULL); |
| 3723 | *ptr = sym; | 3723 | *ptr = sym; |
| 3724 | return sym; | 3724 | return sym; |
| 3725 | } | 3725 | } |
| @@ -3797,9 +3797,13 @@ OBARRAY defaults to the value of the variable `obarray'. */) | |||
| 3797 | if (EQ (AREF (obarray, hash), tem)) | 3797 | if (EQ (AREF (obarray, hash), tem)) |
| 3798 | { | 3798 | { |
| 3799 | if (XSYMBOL (tem)->next) | 3799 | if (XSYMBOL (tem)->next) |
| 3800 | XSETSYMBOL (AREF (obarray, hash), XSYMBOL (tem)->next); | 3800 | { |
| 3801 | Lisp_Object sym; | ||
| 3802 | XSETSYMBOL (sym, XSYMBOL (tem)->next); | ||
| 3803 | ASET (obarray, hash, sym); | ||
| 3804 | } | ||
| 3801 | else | 3805 | else |
| 3802 | XSETINT (AREF (obarray, hash), 0); | 3806 | ASET (obarray, hash, make_number (0)); |
| 3803 | } | 3807 | } |
| 3804 | else | 3808 | else |
| 3805 | { | 3809 | { |
| @@ -3812,7 +3816,7 @@ OBARRAY defaults to the value of the variable `obarray'. */) | |||
| 3812 | XSETSYMBOL (following, XSYMBOL (tail)->next); | 3816 | XSETSYMBOL (following, XSYMBOL (tail)->next); |
| 3813 | if (EQ (following, tem)) | 3817 | if (EQ (following, tem)) |
| 3814 | { | 3818 | { |
| 3815 | XSYMBOL (tail)->next = XSYMBOL (following)->next; | 3819 | set_symbol_next (tail, XSYMBOL (following)->next); |
| 3816 | break; | 3820 | break; |
| 3817 | } | 3821 | } |
| 3818 | } | 3822 | } |
| @@ -3922,13 +3926,12 @@ init_obarray (void) | |||
| 3922 | /* Fmake_symbol inits fields of new symbols with Qunbound and Qnil, | 3926 | /* Fmake_symbol inits fields of new symbols with Qunbound and Qnil, |
| 3923 | so those two need to be fixed manually. */ | 3927 | so those two need to be fixed manually. */ |
| 3924 | SET_SYMBOL_VAL (XSYMBOL (Qunbound), Qunbound); | 3928 | SET_SYMBOL_VAL (XSYMBOL (Qunbound), Qunbound); |
| 3925 | XSYMBOL (Qunbound)->function = Qunbound; | 3929 | set_symbol_function (Qunbound, Qunbound); |
| 3926 | XSYMBOL (Qunbound)->plist = Qnil; | 3930 | set_symbol_plist (Qunbound, Qnil); |
| 3927 | /* XSYMBOL (Qnil)->function = Qunbound; */ | ||
| 3928 | SET_SYMBOL_VAL (XSYMBOL (Qnil), Qnil); | 3931 | SET_SYMBOL_VAL (XSYMBOL (Qnil), Qnil); |
| 3929 | XSYMBOL (Qnil)->constant = 1; | 3932 | XSYMBOL (Qnil)->constant = 1; |
| 3930 | XSYMBOL (Qnil)->declared_special = 1; | 3933 | XSYMBOL (Qnil)->declared_special = 1; |
| 3931 | XSYMBOL (Qnil)->plist = Qnil; | 3934 | set_symbol_plist (Qnil, Qnil); |
| 3932 | 3935 | ||
| 3933 | Qt = intern_c_string ("t"); | 3936 | Qt = intern_c_string ("t"); |
| 3934 | SET_SYMBOL_VAL (XSYMBOL (Qt), Qt); | 3937 | SET_SYMBOL_VAL (XSYMBOL (Qt), Qt); |
| @@ -3947,10 +3950,11 @@ init_obarray (void) | |||
| 3947 | void | 3950 | void |
| 3948 | defsubr (struct Lisp_Subr *sname) | 3951 | defsubr (struct Lisp_Subr *sname) |
| 3949 | { | 3952 | { |
| 3950 | Lisp_Object sym; | 3953 | Lisp_Object sym, tem; |
| 3951 | sym = intern_c_string (sname->symbol_name); | 3954 | sym = intern_c_string (sname->symbol_name); |
| 3952 | XSETTYPED_PVECTYPE (sname, size, PVEC_SUBR); | 3955 | XSETTYPED_PVECTYPE (sname, size, PVEC_SUBR); |
| 3953 | XSETSUBR (XSYMBOL (sym)->function, sname); | 3956 | XSETSUBR (tem, sname); |
| 3957 | set_symbol_function (sym, tem); | ||
| 3954 | } | 3958 | } |
| 3955 | 3959 | ||
| 3956 | #ifdef NOTDEF /* Use fset in subr.el now! */ | 3960 | #ifdef NOTDEF /* Use fset in subr.el now! */ |
| @@ -3983,7 +3987,7 @@ defvar_int (struct Lisp_Intfwd *i_fwd, | |||
| 3983 | nil if address contains 0. */ | 3987 | nil if address contains 0. */ |
| 3984 | void | 3988 | void |
| 3985 | defvar_bool (struct Lisp_Boolfwd *b_fwd, | 3989 | defvar_bool (struct Lisp_Boolfwd *b_fwd, |
| 3986 | const char *namestring, int *address) | 3990 | const char *namestring, bool *address) |
| 3987 | { | 3991 | { |
| 3988 | Lisp_Object sym; | 3992 | Lisp_Object sym; |
| 3989 | sym = intern_c_string (namestring); | 3993 | sym = intern_c_string (namestring); |
| @@ -4121,18 +4125,13 @@ init_lread (void) | |||
| 4121 | difference between initialized and !initialized in this case, | 4125 | difference between initialized and !initialized in this case, |
| 4122 | so we'll have to do it unconditionally when Vinstallation_directory | 4126 | so we'll have to do it unconditionally when Vinstallation_directory |
| 4123 | is non-nil. */ | 4127 | is non-nil. */ |
| 4124 | #ifdef HAVE_NS | ||
| 4125 | /* loadpath already includes the app-bundle's site-lisp. */ | ||
| 4126 | if (!no_site_lisp && !egetenv ("EMACSLOADPATH") && !loadpath) | ||
| 4127 | #else | ||
| 4128 | if (!no_site_lisp && !egetenv ("EMACSLOADPATH")) | 4128 | if (!no_site_lisp && !egetenv ("EMACSLOADPATH")) |
| 4129 | #endif | ||
| 4130 | { | 4129 | { |
| 4131 | Lisp_Object sitelisp; | 4130 | Lisp_Object sitelisp; |
| 4132 | sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); | 4131 | sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); |
| 4133 | if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path); | 4132 | if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path); |
| 4134 | } | 4133 | } |
| 4135 | #else | 4134 | #else /* !CANNOT_DUMP */ |
| 4136 | if (NILP (Vpurify_flag)) | 4135 | if (NILP (Vpurify_flag)) |
| 4137 | { | 4136 | { |
| 4138 | normal = PATH_LOADSEARCH; | 4137 | normal = PATH_LOADSEARCH; |
| @@ -4270,12 +4269,7 @@ init_lread (void) | |||
| 4270 | load_path_check (); | 4269 | load_path_check (); |
| 4271 | 4270 | ||
| 4272 | /* Add the site-lisp directories at the front. */ | 4271 | /* Add the site-lisp directories at the front. */ |
| 4273 | #ifdef HAVE_NS | ||
| 4274 | /* loadpath already includes the app-bundle's site-lisp. */ | ||
| 4275 | if (!no_site_lisp && !loadpath) | ||
| 4276 | #else | ||
| 4277 | if (!no_site_lisp) | 4272 | if (!no_site_lisp) |
| 4278 | #endif | ||
| 4279 | { | 4273 | { |
| 4280 | Lisp_Object sitelisp; | 4274 | Lisp_Object sitelisp; |
| 4281 | sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); | 4275 | sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); |
| @@ -4299,7 +4293,7 @@ init_lread (void) | |||
| 4299 | be missing unless something went extremely (and improbably) | 4293 | be missing unless something went extremely (and improbably) |
| 4300 | wrong, in which case the build will fail in obvious ways. */ | 4294 | wrong, in which case the build will fail in obvious ways. */ |
| 4301 | } | 4295 | } |
| 4302 | #endif /* CANNOT_DUMP */ | 4296 | #endif /* !CANNOT_DUMP */ |
| 4303 | 4297 | ||
| 4304 | Vvalues = Qnil; | 4298 | Vvalues = Qnil; |
| 4305 | 4299 | ||
| @@ -4323,12 +4317,10 @@ dir_warning (const char *format, Lisp_Object dirname) | |||
| 4323 | /* Don't log the warning before we've initialized!! */ | 4317 | /* Don't log the warning before we've initialized!! */ |
| 4324 | if (initialized) | 4318 | if (initialized) |
| 4325 | { | 4319 | { |
| 4326 | char *buffer; | ||
| 4327 | ptrdiff_t message_len; | ||
| 4328 | USE_SAFE_ALLOCA; | 4320 | USE_SAFE_ALLOCA; |
| 4329 | SAFE_ALLOCA (buffer, char *, | 4321 | char *buffer = SAFE_ALLOCA (SBYTES (dirname) |
| 4330 | SBYTES (dirname) + strlen (format) - (sizeof "%s" - 1) + 1); | 4322 | + strlen (format) - (sizeof "%s" - 1) + 1); |
| 4331 | message_len = esprintf (buffer, format, SDATA (dirname)); | 4323 | ptrdiff_t message_len = esprintf (buffer, format, SDATA (dirname)); |
| 4332 | message_dolog (buffer, message_len, 0, STRING_MULTIBYTE (dirname)); | 4324 | message_dolog (buffer, message_len, 0, STRING_MULTIBYTE (dirname)); |
| 4333 | SAFE_FREE (); | 4325 | SAFE_FREE (); |
| 4334 | } | 4326 | } |
| @@ -4549,8 +4541,7 @@ to load. See also `load-dangerous-libraries'. */); | |||
| 4549 | Vbytecomp_version_regexp | 4541 | Vbytecomp_version_regexp |
| 4550 | = build_pure_c_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); | 4542 | = build_pure_c_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); |
| 4551 | 4543 | ||
| 4552 | Qlexical_binding = intern ("lexical-binding"); | 4544 | DEFSYM (Qlexical_binding, "lexical-binding"); |
| 4553 | staticpro (&Qlexical_binding); | ||
| 4554 | DEFVAR_LISP ("lexical-binding", Vlexical_binding, | 4545 | DEFVAR_LISP ("lexical-binding", Vlexical_binding, |
| 4555 | doc: /* Whether to use lexical binding when evaluating code. | 4546 | doc: /* Whether to use lexical binding when evaluating code. |
| 4556 | Non-nil means that the code in the current buffer should be evaluated | 4547 | Non-nil means that the code in the current buffer should be evaluated |
| @@ -4558,6 +4549,7 @@ with lexical binding. | |||
| 4558 | This variable is automatically set from the file variables of an | 4549 | This variable is automatically set from the file variables of an |
| 4559 | interpreted Lisp file read using `load'. Unlike other file local | 4550 | interpreted Lisp file read using `load'. Unlike other file local |
| 4560 | variables, this must be set in the first line of a file. */); | 4551 | variables, this must be set in the first line of a file. */); |
| 4552 | Vlexical_binding = Qnil; | ||
| 4561 | Fmake_variable_buffer_local (Qlexical_binding); | 4553 | Fmake_variable_buffer_local (Qlexical_binding); |
| 4562 | 4554 | ||
| 4563 | DEFVAR_LISP ("eval-buffer-list", Veval_buffer_list, | 4555 | DEFVAR_LISP ("eval-buffer-list", Veval_buffer_list, |