aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/lread.c b/src/lread.c
index 8741bff6284..0fb93031ad4 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -214,6 +214,10 @@ static Lisp_Object Vloads_in_progress;
214 214
215int load_dangerous_libraries; 215int load_dangerous_libraries;
216 216
217/* Non-zero means force printing messages when loading Lisp files. */
218
219int force_load_messages;
220
217/* A regular expression used to detect files compiled with Emacs. */ 221/* A regular expression used to detect files compiled with Emacs. */
218 222
219static Lisp_Object Vbytecomp_version_regexp; 223static Lisp_Object Vbytecomp_version_regexp;
@@ -970,7 +974,8 @@ This function searches the directories in `load-path'.
970If optional second arg NOERROR is non-nil, 974If optional second arg NOERROR is non-nil,
971report no error if FILE doesn't exist. 975report no error if FILE doesn't exist.
972Print messages at start and end of loading unless 976Print messages at start and end of loading unless
973optional third arg NOMESSAGE is non-nil. 977optional third arg NOMESSAGE is non-nil (but `force-load-messages'
978overrides that).
974If optional fourth arg NOSUFFIX is non-nil, don't try adding 979If optional fourth arg NOSUFFIX is non-nil, don't try adding
975suffixes `.elc' or `.el' to the specified name FILE. 980suffixes `.elc' or `.el' to the specified name FILE.
976If optional fifth arg MUST-SUFFIX is non-nil, insist on 981If optional fifth arg MUST-SUFFIX is non-nil, insist on
@@ -1164,7 +1169,7 @@ Return t if the file exists and loads successfully. */)
1164 error ("File `%s' was not compiled in Emacs", 1169 error ("File `%s' was not compiled in Emacs",
1165 SDATA (found)); 1170 SDATA (found));
1166 } 1171 }
1167 else if (!NILP (nomessage)) 1172 else if (!NILP (nomessage) && !force_load_messages)
1168 message_with_string ("File `%s' not compiled in Emacs", found, 1); 1173 message_with_string ("File `%s' not compiled in Emacs", found, 1);
1169 } 1174 }
1170 1175
@@ -1186,7 +1191,7 @@ Return t if the file exists and loads successfully. */)
1186 newer = 1; 1191 newer = 1;
1187 1192
1188 /* If we won't print another message, mention this anyway. */ 1193 /* If we won't print another message, mention this anyway. */
1189 if (!NILP (nomessage)) 1194 if (!NILP (nomessage) && !force_load_messages)
1190 { 1195 {
1191 Lisp_Object msg_file; 1196 Lisp_Object msg_file;
1192 msg_file = Fsubstring (found, make_number (0), make_number (-1)); 1197 msg_file = Fsubstring (found, make_number (0), make_number (-1));
@@ -1208,7 +1213,7 @@ Return t if the file exists and loads successfully. */)
1208 emacs_close (fd); 1213 emacs_close (fd);
1209 val = call4 (Vload_source_file_function, found, hist_file_name, 1214 val = call4 (Vload_source_file_function, found, hist_file_name,
1210 NILP (noerror) ? Qnil : Qt, 1215 NILP (noerror) ? Qnil : Qt,
1211 NILP (nomessage) ? Qnil : Qt); 1216 (NILP (nomessage) || force_load_messages) ? Qnil : Qt);
1212 return unbind_to (count, val); 1217 return unbind_to (count, val);
1213 } 1218 }
1214 } 1219 }
@@ -1231,7 +1236,7 @@ Return t if the file exists and loads successfully. */)
1231 if (! NILP (Vpurify_flag)) 1236 if (! NILP (Vpurify_flag))
1232 Vpreloaded_file_list = Fcons (file, Vpreloaded_file_list); 1237 Vpreloaded_file_list = Fcons (file, Vpreloaded_file_list);
1233 1238
1234 if (NILP (nomessage)) 1239 if (NILP (nomessage) || force_load_messages)
1235 { 1240 {
1236 if (!safe_p) 1241 if (!safe_p)
1237 message_with_string ("Loading %s (compiled; note unsafe, not compiled in Emacs)...", 1242 message_with_string ("Loading %s (compiled; note unsafe, not compiled in Emacs)...",
@@ -1280,7 +1285,7 @@ Return t if the file exists and loads successfully. */)
1280 prev_saved_doc_string = 0; 1285 prev_saved_doc_string = 0;
1281 prev_saved_doc_string_size = 0; 1286 prev_saved_doc_string_size = 0;
1282 1287
1283 if (!noninteractive && NILP (nomessage)) 1288 if (!noninteractive && (NILP (nomessage) || force_load_messages))
1284 { 1289 {
1285 if (!safe_p) 1290 if (!safe_p)
1286 message_with_string ("Loading %s (compiled; note unsafe, not compiled in Emacs)...done", 1291 message_with_string ("Loading %s (compiled; note unsafe, not compiled in Emacs)...done",
@@ -4354,6 +4359,11 @@ incompatible byte codes can make Emacs crash when it tries to execute
4354them. */); 4359them. */);
4355 load_dangerous_libraries = 0; 4360 load_dangerous_libraries = 0;
4356 4361
4362 DEFVAR_BOOL ("force-load-messages", &force_load_messages,
4363 doc: /* Non-nil means force printing messages when loading Lisp files.
4364This overrides the value of the NOMESSAGE argument to `load'. */);
4365 force_load_messages = 0;
4366
4357 DEFVAR_LISP ("bytecomp-version-regexp", &Vbytecomp_version_regexp, 4367 DEFVAR_LISP ("bytecomp-version-regexp", &Vbytecomp_version_regexp,
4358 doc: /* Regular expression matching safe to load compiled Lisp files. 4368 doc: /* Regular expression matching safe to load compiled Lisp files.
4359When Emacs loads a compiled Lisp file, it reads the first 512 bytes 4369When Emacs loads a compiled Lisp file, it reads the first 512 bytes