diff options
| author | Eli Zaretskii | 2009-07-25 08:50:51 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2009-07-25 08:50:51 +0000 |
| commit | beb0b7f93c2fbeb2fae08d7302686febccb3d582 (patch) | |
| tree | 629beef53671c4aee5e64b1049944a1d379ef105 /src | |
| parent | 51768bc824113d16e71d4b6e5e268dc0cec8ec1f (diff) | |
| download | emacs-beb0b7f93c2fbeb2fae08d7302686febccb3d582.tar.gz emacs-beb0b7f93c2fbeb2fae08d7302686febccb3d582.zip | |
(syms_of_lread) <force_load_messages>: New variable.
(Fload): Use it to force load messages, even if NOMESSAGES is non-nil.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/lread.c | 22 |
2 files changed, 22 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 27df9aa1af5..f9f1e335384 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-07-25 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * lread.c (syms_of_lread) <force_load_messages>: New variable. | ||
| 4 | (Fload): Use it to force load messages, even if NOMESSAGES is | ||
| 5 | non-nil. | ||
| 6 | |||
| 1 | 2009-07-25 Ken Raeburn <raeburn@raeburn.org> | 7 | 2009-07-25 Ken Raeburn <raeburn@raeburn.org> |
| 2 | 8 | ||
| 3 | * coding.h (decode_coding_string, encode_coding_string): Use | 9 | * coding.h (decode_coding_string, encode_coding_string): Use |
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 | ||
| 215 | int load_dangerous_libraries; | 215 | int load_dangerous_libraries; |
| 216 | 216 | ||
| 217 | /* Non-zero means force printing messages when loading Lisp files. */ | ||
| 218 | |||
| 219 | int 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 | ||
| 219 | static Lisp_Object Vbytecomp_version_regexp; | 223 | static Lisp_Object Vbytecomp_version_regexp; |
| @@ -970,7 +974,8 @@ This function searches the directories in `load-path'. | |||
| 970 | If optional second arg NOERROR is non-nil, | 974 | If optional second arg NOERROR is non-nil, |
| 971 | report no error if FILE doesn't exist. | 975 | report no error if FILE doesn't exist. |
| 972 | Print messages at start and end of loading unless | 976 | Print messages at start and end of loading unless |
| 973 | optional third arg NOMESSAGE is non-nil. | 977 | optional third arg NOMESSAGE is non-nil (but `force-load-messages' |
| 978 | overrides that). | ||
| 974 | If optional fourth arg NOSUFFIX is non-nil, don't try adding | 979 | If optional fourth arg NOSUFFIX is non-nil, don't try adding |
| 975 | suffixes `.elc' or `.el' to the specified name FILE. | 980 | suffixes `.elc' or `.el' to the specified name FILE. |
| 976 | If optional fifth arg MUST-SUFFIX is non-nil, insist on | 981 | If 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 | |||
| 4354 | them. */); | 4359 | them. */); |
| 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. | ||
| 4364 | This 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. |
| 4359 | When Emacs loads a compiled Lisp file, it reads the first 512 bytes | 4369 | When Emacs loads a compiled Lisp file, it reads the first 512 bytes |