diff options
| author | Po Lu | 2024-05-04 11:11:36 +0800 |
|---|---|---|
| committer | Po Lu | 2024-05-04 11:11:36 +0800 |
| commit | a5acc89712151645525bd2c0e2c90bf46a8e61ec (patch) | |
| tree | fb4c44a0ebc04f434931e36a119bf4b91ee41355 /src | |
| parent | d0e391957b01f101b214f055cd27bb89c8d6fec9 (diff) | |
| download | emacs-a5acc89712151645525bd2c0e2c90bf46a8e61ec.tar.gz emacs-a5acc89712151645525bd2c0e2c90bf46a8e61ec.zip | |
* src/lread.c (warn_missing_cookie): Exempt the user init file.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lread.c b/src/lread.c index f9a1a8562cb..2c856f5d42e 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1345,10 +1345,17 @@ close_file_unwind_android_fd (void *ptr) | |||
| 1345 | static void | 1345 | static void |
| 1346 | warn_missing_cookie (Lisp_Object file) | 1346 | warn_missing_cookie (Lisp_Object file) |
| 1347 | { | 1347 | { |
| 1348 | Lisp_Object msg = CALLN (Fformat, | 1348 | Lisp_Object msg; |
| 1349 | build_string ("File %s lacks `lexical-binding'" | 1349 | |
| 1350 | " directive on its first line"), | 1350 | /* The user init file should not be subject to these warnings, as |
| 1351 | file); | 1351 | Emacs doesn't insert cookies into generated init files. */ |
| 1352 | if (!NILP (Fequal (file, Vuser_init_file))) | ||
| 1353 | return; | ||
| 1354 | |||
| 1355 | file = CALLN (Fformat, | ||
| 1356 | build_string ("File %s lacks `lexical-binding'" | ||
| 1357 | " directive on its first line"), | ||
| 1358 | file); | ||
| 1352 | Vdelayed_warnings_list = Fcons (list2 (Qlexical_binding, msg), | 1359 | Vdelayed_warnings_list = Fcons (list2 (Qlexical_binding, msg), |
| 1353 | Vdelayed_warnings_list); | 1360 | Vdelayed_warnings_list); |
| 1354 | } | 1361 | } |