diff options
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 176 |
1 files changed, 89 insertions, 87 deletions
diff --git a/src/lread.c b/src/lread.c index f0423f166dd..57c7df74127 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -145,7 +145,6 @@ static int read_emacs_mule_char (int, int (*) (int, Lisp_Object), | |||
| 145 | static void readevalloop (Lisp_Object, FILE *, Lisp_Object, bool, | 145 | static void readevalloop (Lisp_Object, FILE *, Lisp_Object, bool, |
| 146 | Lisp_Object, Lisp_Object, | 146 | Lisp_Object, Lisp_Object, |
| 147 | Lisp_Object, Lisp_Object); | 147 | Lisp_Object, Lisp_Object); |
| 148 | static Lisp_Object load_unwind (Lisp_Object); | ||
| 149 | 148 | ||
| 150 | /* Functions that read one byte from the current source READCHARFUN | 149 | /* Functions that read one byte from the current source READCHARFUN |
| 151 | or unreads one byte. If the integer argument C is -1, it returns | 150 | or unreads one byte. If the integer argument C is -1, it returns |
| @@ -562,7 +561,7 @@ read_emacs_mule_char (int c, int (*readbyte) (int, Lisp_Object), Lisp_Object rea | |||
| 562 | c = DECODE_CHAR (charset, code); | 561 | c = DECODE_CHAR (charset, code); |
| 563 | if (c < 0) | 562 | if (c < 0) |
| 564 | Fsignal (Qinvalid_read_syntax, | 563 | Fsignal (Qinvalid_read_syntax, |
| 565 | Fcons (build_string ("invalid multibyte form"), Qnil)); | 564 | list1 (build_string ("invalid multibyte form"))); |
| 566 | return c; | 565 | return c; |
| 567 | } | 566 | } |
| 568 | 567 | ||
| @@ -672,7 +671,7 @@ read_filtered_event (bool no_switch_frame, bool ascii_required, | |||
| 672 | { | 671 | { |
| 673 | if (error_nonascii) | 672 | if (error_nonascii) |
| 674 | { | 673 | { |
| 675 | Vunread_command_events = Fcons (val, Qnil); | 674 | Vunread_command_events = list1 (val); |
| 676 | error ("Non-character input-event"); | 675 | error ("Non-character input-event"); |
| 677 | } | 676 | } |
| 678 | else | 677 | else |
| @@ -952,10 +951,10 @@ safe_to_load_version (int fd) | |||
| 952 | /* Callback for record_unwind_protect. Restore the old load list OLD, | 951 | /* Callback for record_unwind_protect. Restore the old load list OLD, |
| 953 | after loading a file successfully. */ | 952 | after loading a file successfully. */ |
| 954 | 953 | ||
| 955 | static Lisp_Object | 954 | static void |
| 956 | record_load_unwind (Lisp_Object old) | 955 | record_load_unwind (Lisp_Object old) |
| 957 | { | 956 | { |
| 958 | return Vloads_in_progress = old; | 957 | Vloads_in_progress = old; |
| 959 | } | 958 | } |
| 960 | 959 | ||
| 961 | /* This handler function is used via internal_condition_case_1. */ | 960 | /* This handler function is used via internal_condition_case_1. */ |
| @@ -966,7 +965,7 @@ load_error_handler (Lisp_Object data) | |||
| 966 | return Qnil; | 965 | return Qnil; |
| 967 | } | 966 | } |
| 968 | 967 | ||
| 969 | static Lisp_Object | 968 | static void |
| 970 | load_warn_old_style_backquotes (Lisp_Object file) | 969 | load_warn_old_style_backquotes (Lisp_Object file) |
| 971 | { | 970 | { |
| 972 | if (!NILP (Vold_style_backquotes)) | 971 | if (!NILP (Vold_style_backquotes)) |
| @@ -976,7 +975,6 @@ load_warn_old_style_backquotes (Lisp_Object file) | |||
| 976 | args[1] = file; | 975 | args[1] = file; |
| 977 | Fmessage (2, args); | 976 | Fmessage (2, args); |
| 978 | } | 977 | } |
| 979 | return Qnil; | ||
| 980 | } | 978 | } |
| 981 | 979 | ||
| 982 | DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, | 980 | DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, |
| @@ -1041,10 +1039,12 @@ While the file is in the process of being loaded, the variable | |||
| 1041 | is bound to the file's name. | 1039 | is bound to the file's name. |
| 1042 | 1040 | ||
| 1043 | Return t if the file exists and loads successfully. */) | 1041 | Return t if the file exists and loads successfully. */) |
| 1044 | (Lisp_Object file, Lisp_Object noerror, Lisp_Object nomessage, Lisp_Object nosuffix, Lisp_Object must_suffix) | 1042 | (Lisp_Object file, Lisp_Object noerror, Lisp_Object nomessage, |
| 1043 | Lisp_Object nosuffix, Lisp_Object must_suffix) | ||
| 1045 | { | 1044 | { |
| 1046 | register FILE *stream; | 1045 | FILE *stream; |
| 1047 | register int fd = -1; | 1046 | int fd; |
| 1047 | int fd_index; | ||
| 1048 | ptrdiff_t count = SPECPDL_INDEX (); | 1048 | ptrdiff_t count = SPECPDL_INDEX (); |
| 1049 | struct gcpro gcpro1, gcpro2, gcpro3; | 1049 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 1050 | Lisp_Object found, efound, hist_file_name; | 1050 | Lisp_Object found, efound, hist_file_name; |
| @@ -1055,7 +1055,6 @@ Return t if the file exists and loads successfully. */) | |||
| 1055 | Lisp_Object handler; | 1055 | Lisp_Object handler; |
| 1056 | bool safe_p = 1; | 1056 | bool safe_p = 1; |
| 1057 | const char *fmode = "r"; | 1057 | const char *fmode = "r"; |
| 1058 | Lisp_Object tmp[2]; | ||
| 1059 | int version; | 1058 | int version; |
| 1060 | 1059 | ||
| 1061 | #ifdef DOS_NT | 1060 | #ifdef DOS_NT |
| @@ -1088,19 +1087,23 @@ Return t if the file exists and loads successfully. */) | |||
| 1088 | else | 1087 | else |
| 1089 | file = Fsubstitute_in_file_name (file); | 1088 | file = Fsubstitute_in_file_name (file); |
| 1090 | 1089 | ||
| 1091 | |||
| 1092 | /* Avoid weird lossage with null string as arg, | 1090 | /* Avoid weird lossage with null string as arg, |
| 1093 | since it would try to load a directory as a Lisp file. */ | 1091 | since it would try to load a directory as a Lisp file. */ |
| 1094 | if (SBYTES (file) > 0) | 1092 | if (SCHARS (file) == 0) |
| 1095 | { | 1093 | { |
| 1096 | ptrdiff_t size = SBYTES (file); | 1094 | fd = -1; |
| 1097 | 1095 | errno = ENOENT; | |
| 1096 | } | ||
| 1097 | else | ||
| 1098 | { | ||
| 1099 | Lisp_Object suffixes; | ||
| 1098 | found = Qnil; | 1100 | found = Qnil; |
| 1099 | GCPRO2 (file, found); | 1101 | GCPRO2 (file, found); |
| 1100 | 1102 | ||
| 1101 | if (! NILP (must_suffix)) | 1103 | if (! NILP (must_suffix)) |
| 1102 | { | 1104 | { |
| 1103 | /* Don't insist on adding a suffix if FILE already ends with one. */ | 1105 | /* Don't insist on adding a suffix if FILE already ends with one. */ |
| 1106 | ptrdiff_t size = SBYTES (file); | ||
| 1104 | if (size > 3 | 1107 | if (size > 3 |
| 1105 | && !strcmp (SSDATA (file) + size - 3, ".el")) | 1108 | && !strcmp (SSDATA (file) + size - 3, ".el")) |
| 1106 | must_suffix = Qnil; | 1109 | must_suffix = Qnil; |
| @@ -1113,20 +1116,28 @@ Return t if the file exists and loads successfully. */) | |||
| 1113 | must_suffix = Qnil; | 1116 | must_suffix = Qnil; |
| 1114 | } | 1117 | } |
| 1115 | 1118 | ||
| 1116 | fd = openp (Vload_path, file, | 1119 | if (!NILP (nosuffix)) |
| 1117 | (!NILP (nosuffix) ? Qnil | 1120 | suffixes = Qnil; |
| 1118 | : !NILP (must_suffix) ? Fget_load_suffixes () | 1121 | else |
| 1119 | : Fappend (2, (tmp[0] = Fget_load_suffixes (), | 1122 | { |
| 1120 | tmp[1] = Vload_file_rep_suffixes, | 1123 | suffixes = Fget_load_suffixes (); |
| 1121 | tmp))), | 1124 | if (NILP (must_suffix)) |
| 1122 | &found, Qnil); | 1125 | { |
| 1126 | Lisp_Object arg[2]; | ||
| 1127 | arg[0] = suffixes; | ||
| 1128 | arg[1] = Vload_file_rep_suffixes; | ||
| 1129 | suffixes = Fappend (2, arg); | ||
| 1130 | } | ||
| 1131 | } | ||
| 1132 | |||
| 1133 | fd = openp (Vload_path, file, suffixes, &found, Qnil); | ||
| 1123 | UNGCPRO; | 1134 | UNGCPRO; |
| 1124 | } | 1135 | } |
| 1125 | 1136 | ||
| 1126 | if (fd == -1) | 1137 | if (fd == -1) |
| 1127 | { | 1138 | { |
| 1128 | if (NILP (noerror)) | 1139 | if (NILP (noerror)) |
| 1129 | xsignal2 (Qfile_error, build_string ("Cannot open load file"), file); | 1140 | report_file_error ("Cannot open load file", file); |
| 1130 | return Qnil; | 1141 | return Qnil; |
| 1131 | } | 1142 | } |
| 1132 | 1143 | ||
| @@ -1164,6 +1175,17 @@ Return t if the file exists and loads successfully. */) | |||
| 1164 | #endif | 1175 | #endif |
| 1165 | } | 1176 | } |
| 1166 | 1177 | ||
| 1178 | if (fd < 0) | ||
| 1179 | { | ||
| 1180 | /* Pacify older GCC with --enable-gcc-warnings. */ | ||
| 1181 | IF_LINT (fd_index = 0); | ||
| 1182 | } | ||
| 1183 | else | ||
| 1184 | { | ||
| 1185 | fd_index = SPECPDL_INDEX (); | ||
| 1186 | record_unwind_protect_int (close_file_unwind, fd); | ||
| 1187 | } | ||
| 1188 | |||
| 1167 | /* Check if we're stuck in a recursive load cycle. | 1189 | /* Check if we're stuck in a recursive load cycle. |
| 1168 | 1190 | ||
| 1169 | 2000-09-21: It's not possible to just check for the file loaded | 1191 | 2000-09-21: It's not possible to just check for the file loaded |
| @@ -1179,11 +1201,7 @@ Return t if the file exists and loads successfully. */) | |||
| 1179 | Lisp_Object tem; | 1201 | Lisp_Object tem; |
| 1180 | for (tem = Vloads_in_progress; CONSP (tem); tem = XCDR (tem)) | 1202 | for (tem = Vloads_in_progress; CONSP (tem); tem = XCDR (tem)) |
| 1181 | if (!NILP (Fequal (found, XCAR (tem))) && (++load_count > 3)) | 1203 | if (!NILP (Fequal (found, XCAR (tem))) && (++load_count > 3)) |
| 1182 | { | 1204 | signal_error ("Recursive load", Fcons (found, Vloads_in_progress)); |
| 1183 | if (fd >= 0) | ||
| 1184 | emacs_close (fd); | ||
| 1185 | signal_error ("Recursive load", Fcons (found, Vloads_in_progress)); | ||
| 1186 | } | ||
| 1187 | record_unwind_protect (record_load_unwind, Vloads_in_progress); | 1205 | record_unwind_protect (record_load_unwind, Vloads_in_progress); |
| 1188 | Vloads_in_progress = Fcons (found, Vloads_in_progress); | 1206 | Vloads_in_progress = Fcons (found, Vloads_in_progress); |
| 1189 | } | 1207 | } |
| @@ -1196,9 +1214,8 @@ Return t if the file exists and loads successfully. */) | |||
| 1196 | 1214 | ||
| 1197 | /* Get the name for load-history. */ | 1215 | /* Get the name for load-history. */ |
| 1198 | hist_file_name = (! NILP (Vpurify_flag) | 1216 | hist_file_name = (! NILP (Vpurify_flag) |
| 1199 | ? Fconcat (2, (tmp[0] = Ffile_name_directory (file), | 1217 | ? concat2 (Ffile_name_directory (file), |
| 1200 | tmp[1] = Ffile_name_nondirectory (found), | 1218 | Ffile_name_nondirectory (found)) |
| 1201 | tmp)) | ||
| 1202 | : found) ; | 1219 | : found) ; |
| 1203 | 1220 | ||
| 1204 | version = -1; | 1221 | version = -1; |
| @@ -1224,12 +1241,7 @@ Return t if the file exists and loads successfully. */) | |||
| 1224 | { | 1241 | { |
| 1225 | safe_p = 0; | 1242 | safe_p = 0; |
| 1226 | if (!load_dangerous_libraries) | 1243 | if (!load_dangerous_libraries) |
| 1227 | { | 1244 | error ("File `%s' was not compiled in Emacs", SDATA (found)); |
| 1228 | if (fd >= 0) | ||
| 1229 | emacs_close (fd); | ||
| 1230 | error ("File `%s' was not compiled in Emacs", | ||
| 1231 | SDATA (found)); | ||
| 1232 | } | ||
| 1233 | else if (!NILP (nomessage) && !force_load_messages) | 1245 | else if (!NILP (nomessage) && !force_load_messages) |
| 1234 | message_with_string ("File `%s' not compiled in Emacs", found, 1); | 1246 | message_with_string ("File `%s' not compiled in Emacs", found, 1); |
| 1235 | } | 1247 | } |
| @@ -1275,7 +1287,10 @@ Return t if the file exists and loads successfully. */) | |||
| 1275 | Lisp_Object val; | 1287 | Lisp_Object val; |
| 1276 | 1288 | ||
| 1277 | if (fd >= 0) | 1289 | if (fd >= 0) |
| 1278 | emacs_close (fd); | 1290 | { |
| 1291 | emacs_close (fd); | ||
| 1292 | clear_unwind_protect (fd_index); | ||
| 1293 | } | ||
| 1279 | val = call4 (Vload_source_file_function, found, hist_file_name, | 1294 | val = call4 (Vload_source_file_function, found, hist_file_name, |
| 1280 | NILP (noerror) ? Qnil : Qt, | 1295 | NILP (noerror) ? Qnil : Qt, |
| 1281 | (NILP (nomessage) || force_load_messages) ? Qnil : Qt); | 1296 | (NILP (nomessage) || force_load_messages) ? Qnil : Qt); |
| @@ -1285,26 +1300,28 @@ Return t if the file exists and loads successfully. */) | |||
| 1285 | 1300 | ||
| 1286 | GCPRO3 (file, found, hist_file_name); | 1301 | GCPRO3 (file, found, hist_file_name); |
| 1287 | 1302 | ||
| 1288 | #ifdef WINDOWSNT | 1303 | if (fd < 0) |
| 1289 | efound = ENCODE_FILE (found); | ||
| 1290 | /* If we somehow got here with fd == -2, meaning the file is deemed | ||
| 1291 | to be remote, don't even try to reopen the file locally; just | ||
| 1292 | force a failure instead. */ | ||
| 1293 | if (fd >= 0) | ||
| 1294 | { | 1304 | { |
| 1295 | emacs_close (fd); | 1305 | /* We somehow got here with fd == -2, meaning the file is deemed |
| 1296 | stream = emacs_fopen (SSDATA (efound), fmode); | 1306 | to be remote. Don't even try to reopen the file locally; |
| 1307 | just force a failure. */ | ||
| 1308 | stream = NULL; | ||
| 1309 | errno = EINVAL; | ||
| 1297 | } | 1310 | } |
| 1298 | else | 1311 | else |
| 1299 | stream = NULL; | ||
| 1300 | #else /* not WINDOWSNT */ | ||
| 1301 | stream = fdopen (fd, fmode); | ||
| 1302 | #endif /* not WINDOWSNT */ | ||
| 1303 | if (stream == 0) | ||
| 1304 | { | 1312 | { |
| 1313 | #ifdef WINDOWSNT | ||
| 1305 | emacs_close (fd); | 1314 | emacs_close (fd); |
| 1306 | error ("Failure to create stdio stream for %s", SDATA (file)); | 1315 | clear_unwind_protect (fd_index); |
| 1316 | efound = ENCODE_FILE (found); | ||
| 1317 | stream = emacs_fopen (SSDATA (efound), fmode); | ||
| 1318 | #else | ||
| 1319 | stream = fdopen (fd, fmode); | ||
| 1320 | #endif | ||
| 1307 | } | 1321 | } |
| 1322 | if (! stream) | ||
| 1323 | report_file_error ("Opening stdio stream", file); | ||
| 1324 | set_unwind_protect_ptr (fd_index, fclose_unwind, stream); | ||
| 1308 | 1325 | ||
| 1309 | if (! NILP (Vpurify_flag)) | 1326 | if (! NILP (Vpurify_flag)) |
| 1310 | Vpreloaded_file_list = Fcons (Fpurecopy (file), Vpreloaded_file_list); | 1327 | Vpreloaded_file_list = Fcons (Fpurecopy (file), Vpreloaded_file_list); |
| @@ -1323,7 +1340,6 @@ Return t if the file exists and loads successfully. */) | |||
| 1323 | message_with_string ("Loading %s...", file, 1); | 1340 | message_with_string ("Loading %s...", file, 1); |
| 1324 | } | 1341 | } |
| 1325 | 1342 | ||
| 1326 | record_unwind_protect (load_unwind, make_save_pointer (stream)); | ||
| 1327 | specbind (Qload_file_name, found); | 1343 | specbind (Qload_file_name, found); |
| 1328 | specbind (Qinhibit_file_name_operation, Qnil); | 1344 | specbind (Qinhibit_file_name_operation, Qnil); |
| 1329 | specbind (Qload_in_progress, Qt); | 1345 | specbind (Qload_in_progress, Qt); |
| @@ -1375,19 +1391,6 @@ Return t if the file exists and loads successfully. */) | |||
| 1375 | 1391 | ||
| 1376 | return Qt; | 1392 | return Qt; |
| 1377 | } | 1393 | } |
| 1378 | |||
| 1379 | static Lisp_Object | ||
| 1380 | load_unwind (Lisp_Object arg) /* Used as unwind-protect function in load. */ | ||
| 1381 | { | ||
| 1382 | FILE *stream = XSAVE_POINTER (arg, 0); | ||
| 1383 | if (stream != NULL) | ||
| 1384 | { | ||
| 1385 | block_input (); | ||
| 1386 | fclose (stream); | ||
| 1387 | unblock_input (); | ||
| 1388 | } | ||
| 1389 | return Qnil; | ||
| 1390 | } | ||
| 1391 | 1394 | ||
| 1392 | static bool | 1395 | static bool |
| 1393 | complete_filename_p (Lisp_Object pathname) | 1396 | complete_filename_p (Lisp_Object pathname) |
| @@ -1494,7 +1497,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, | |||
| 1494 | fn = alloca (fn_size = 100 + want_length); | 1497 | fn = alloca (fn_size = 100 + want_length); |
| 1495 | 1498 | ||
| 1496 | /* Loop over suffixes. */ | 1499 | /* Loop over suffixes. */ |
| 1497 | for (tail = NILP (suffixes) ? Fcons (empty_unibyte_string, Qnil) : suffixes; | 1500 | for (tail = NILP (suffixes) ? list1 (empty_unibyte_string) : suffixes; |
| 1498 | CONSP (tail); tail = XCDR (tail)) | 1501 | CONSP (tail); tail = XCDR (tail)) |
| 1499 | { | 1502 | { |
| 1500 | ptrdiff_t fnlen, lsuffix = SBYTES (XCAR (tail)); | 1503 | ptrdiff_t fnlen, lsuffix = SBYTES (XCAR (tail)); |
| @@ -1523,7 +1526,6 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, | |||
| 1523 | if ((!NILP (handler) || !NILP (predicate)) && !NATNUMP (predicate)) | 1526 | if ((!NILP (handler) || !NILP (predicate)) && !NATNUMP (predicate)) |
| 1524 | { | 1527 | { |
| 1525 | bool exists; | 1528 | bool exists; |
| 1526 | last_errno = ENOENT; | ||
| 1527 | if (NILP (predicate)) | 1529 | if (NILP (predicate)) |
| 1528 | exists = !NILP (Ffile_readable_p (string)); | 1530 | exists = !NILP (Ffile_readable_p (string)); |
| 1529 | else | 1531 | else |
| @@ -1578,7 +1580,10 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, | |||
| 1578 | { | 1580 | { |
| 1579 | fd = emacs_open (pfn, O_RDONLY, 0); | 1581 | fd = emacs_open (pfn, O_RDONLY, 0); |
| 1580 | if (fd < 0) | 1582 | if (fd < 0) |
| 1581 | last_errno = errno; | 1583 | { |
| 1584 | if (errno != ENOENT) | ||
| 1585 | last_errno = errno; | ||
| 1586 | } | ||
| 1582 | else | 1587 | else |
| 1583 | { | 1588 | { |
| 1584 | struct stat st; | 1589 | struct stat st; |
| @@ -1682,11 +1687,10 @@ build_load_history (Lisp_Object filename, bool entire) | |||
| 1682 | Vload_history); | 1687 | Vload_history); |
| 1683 | } | 1688 | } |
| 1684 | 1689 | ||
| 1685 | static Lisp_Object | 1690 | static void |
| 1686 | readevalloop_1 (Lisp_Object old) | 1691 | readevalloop_1 (int old) |
| 1687 | { | 1692 | { |
| 1688 | load_convert_to_unibyte = ! NILP (old); | 1693 | load_convert_to_unibyte = old; |
| 1689 | return Qnil; | ||
| 1690 | } | 1694 | } |
| 1691 | 1695 | ||
| 1692 | /* Signal an `end-of-file' error, if possible with file name | 1696 | /* Signal an `end-of-file' error, if possible with file name |
| @@ -1756,7 +1760,7 @@ readevalloop (Lisp_Object readcharfun, | |||
| 1756 | 1760 | ||
| 1757 | specbind (Qstandard_input, readcharfun); /* GCPROs readcharfun. */ | 1761 | specbind (Qstandard_input, readcharfun); /* GCPROs readcharfun. */ |
| 1758 | specbind (Qcurrent_load_list, Qnil); | 1762 | specbind (Qcurrent_load_list, Qnil); |
| 1759 | record_unwind_protect (readevalloop_1, load_convert_to_unibyte ? Qt : Qnil); | 1763 | record_unwind_protect_int (readevalloop_1, load_convert_to_unibyte); |
| 1760 | load_convert_to_unibyte = !NILP (unibyte); | 1764 | load_convert_to_unibyte = !NILP (unibyte); |
| 1761 | 1765 | ||
| 1762 | /* If lexical binding is active (either because it was specified in | 1766 | /* If lexical binding is active (either because it was specified in |
| @@ -1764,8 +1768,8 @@ readevalloop (Lisp_Object readcharfun, | |||
| 1764 | lexical environment, otherwise, turn off lexical binding. */ | 1768 | lexical environment, otherwise, turn off lexical binding. */ |
| 1765 | lex_bound = find_symbol_value (Qlexical_binding); | 1769 | lex_bound = find_symbol_value (Qlexical_binding); |
| 1766 | specbind (Qinternal_interpreter_environment, | 1770 | specbind (Qinternal_interpreter_environment, |
| 1767 | NILP (lex_bound) || EQ (lex_bound, Qunbound) | 1771 | (NILP (lex_bound) || EQ (lex_bound, Qunbound) |
| 1768 | ? Qnil : Fcons (Qt, Qnil)); | 1772 | ? Qnil : list1 (Qt))); |
| 1769 | 1773 | ||
| 1770 | GCPRO4 (sourcename, readfun, start, end); | 1774 | GCPRO4 (sourcename, readfun, start, end); |
| 1771 | 1775 | ||
| @@ -2724,7 +2728,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 2724 | if (c == '$') | 2728 | if (c == '$') |
| 2725 | return Vload_file_name; | 2729 | return Vload_file_name; |
| 2726 | if (c == '\'') | 2730 | if (c == '\'') |
| 2727 | return Fcons (Qfunction, Fcons (read0 (readcharfun), Qnil)); | 2731 | return list2 (Qfunction, read0 (readcharfun)); |
| 2728 | /* #:foo is the uninterned symbol named foo. */ | 2732 | /* #:foo is the uninterned symbol named foo. */ |
| 2729 | if (c == ':') | 2733 | if (c == ':') |
| 2730 | { | 2734 | { |
| @@ -2819,9 +2823,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 2819 | goto retry; | 2823 | goto retry; |
| 2820 | 2824 | ||
| 2821 | case '\'': | 2825 | case '\'': |
| 2822 | { | 2826 | return list2 (Qquote, read0 (readcharfun)); |
| 2823 | return Fcons (Qquote, Fcons (read0 (readcharfun), Qnil)); | ||
| 2824 | } | ||
| 2825 | 2827 | ||
| 2826 | case '`': | 2828 | case '`': |
| 2827 | { | 2829 | { |
| @@ -2851,7 +2853,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 2851 | value = read0 (readcharfun); | 2853 | value = read0 (readcharfun); |
| 2852 | new_backquote_flag = saved_new_backquote_flag; | 2854 | new_backquote_flag = saved_new_backquote_flag; |
| 2853 | 2855 | ||
| 2854 | return Fcons (Qbackquote, Fcons (value, Qnil)); | 2856 | return list2 (Qbackquote, value); |
| 2855 | } | 2857 | } |
| 2856 | } | 2858 | } |
| 2857 | case ',': | 2859 | case ',': |
| @@ -2889,7 +2891,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) | |||
| 2889 | } | 2891 | } |
| 2890 | 2892 | ||
| 2891 | value = read0 (readcharfun); | 2893 | value = read0 (readcharfun); |
| 2892 | return Fcons (comma_type, Fcons (value, Qnil)); | 2894 | return list2 (comma_type, value); |
| 2893 | } | 2895 | } |
| 2894 | else | 2896 | else |
| 2895 | { | 2897 | { |
| @@ -3665,7 +3667,7 @@ read_list (bool flag, Lisp_Object readcharfun) | |||
| 3665 | } | 3667 | } |
| 3666 | invalid_syntax ("] in a list"); | 3668 | invalid_syntax ("] in a list"); |
| 3667 | } | 3669 | } |
| 3668 | tem = Fcons (elt, Qnil); | 3670 | tem = list1 (elt); |
| 3669 | if (!NILP (tail)) | 3671 | if (!NILP (tail)) |
| 3670 | XSETCDR (tail, tem); | 3672 | XSETCDR (tail, tem); |
| 3671 | else | 3673 | else |
| @@ -4232,7 +4234,7 @@ init_lread (void) | |||
| 4232 | points to the eventual installed lisp, leim | 4234 | points to the eventual installed lisp, leim |
| 4233 | directories. We should not use those now, even | 4235 | directories. We should not use those now, even |
| 4234 | if they exist, so start over from a clean slate. */ | 4236 | if they exist, so start over from a clean slate. */ |
| 4235 | Vload_path = Fcons (tem, Qnil); | 4237 | Vload_path = list1 (tem); |
| 4236 | } | 4238 | } |
| 4237 | } | 4239 | } |
| 4238 | else | 4240 | else |
| @@ -4459,8 +4461,8 @@ otherwise to default specified by file `epaths.h' when Emacs was built. */); | |||
| 4459 | This list should not include the empty string. | 4461 | This list should not include the empty string. |
| 4460 | `load' and related functions try to append these suffixes, in order, | 4462 | `load' and related functions try to append these suffixes, in order, |
| 4461 | to the specified file name if a Lisp suffix is allowed or required. */); | 4463 | to the specified file name if a Lisp suffix is allowed or required. */); |
| 4462 | Vload_suffixes = Fcons (build_pure_c_string (".elc"), | 4464 | Vload_suffixes = list2 (build_pure_c_string (".elc"), |
| 4463 | Fcons (build_pure_c_string (".el"), Qnil)); | 4465 | build_pure_c_string (".el")); |
| 4464 | DEFVAR_LISP ("load-file-rep-suffixes", Vload_file_rep_suffixes, | 4466 | DEFVAR_LISP ("load-file-rep-suffixes", Vload_file_rep_suffixes, |
| 4465 | doc: /* List of suffixes that indicate representations of \ | 4467 | doc: /* List of suffixes that indicate representations of \ |
| 4466 | the same file. | 4468 | the same file. |
| @@ -4474,7 +4476,7 @@ and, if so, which suffixes they should try to append to the file name | |||
| 4474 | in order to do so. However, if you want to customize which suffixes | 4476 | in order to do so. However, if you want to customize which suffixes |
| 4475 | the loading functions recognize as compression suffixes, you should | 4477 | the loading functions recognize as compression suffixes, you should |
| 4476 | customize `jka-compr-load-suffixes' rather than the present variable. */); | 4478 | customize `jka-compr-load-suffixes' rather than the present variable. */); |
| 4477 | Vload_file_rep_suffixes = Fcons (empty_unibyte_string, Qnil); | 4479 | Vload_file_rep_suffixes = list1 (empty_unibyte_string); |
| 4478 | 4480 | ||
| 4479 | DEFVAR_BOOL ("load-in-progress", load_in_progress, | 4481 | DEFVAR_BOOL ("load-in-progress", load_in_progress, |
| 4480 | doc: /* Non-nil if inside of `load'. */); | 4482 | doc: /* Non-nil if inside of `load'. */); |