summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-07-02 18:42:11 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-07-02 18:42:36 +0200
commit3c125290d208e4c962635aa5af4951249af17804 (patch)
treef56ad4d31ad6d39f26def8d8a6fc491b2da0c313 /src/lread.c
parentb79cfaaf14a7aa7e8bb56fc4063bd007e0edc69a (diff)
downloademacs-3c125290d208e4c962635aa5af4951249af17804.tar.gz
emacs-3c125290d208e4c962635aa5af4951249af17804.tar.bz2
emacs-3c125290d208e4c962635aa5af4951249af17804.zip
Add sanity check for Emacsen distributed without .el files
* src/lread.c (maybe_swap_for_eln): Add sanity check for Emacsen distributed without .el files (bug#48342).
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/lread.c b/src/lread.c
index ef2bb036e35..759cc08946d 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1735,13 +1735,24 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd,
{
if (!NILP (find_symbol_value (
Qnative_comp_warning_on_missing_source)))
- call2 (intern_c_string ("display-warning"),
- Qcomp,
- CALLN (Fformat,
- build_string ("Cannot look-up eln file as no source "
- "file was found for %s"),
- *filename));
- return;
+ {
+ /* If we have an installation without any .el files,
+ there's really no point in giving a warning here,
+ because that will trigger a cascade of warnings. So
+ just do a sanity check and refuse to do anything if we
+ can't find even central .el files. */
+ if (NILP (Flocate_file_internal (build_string ("simple.el"),
+ Vload_path,
+ Qnil, Qnil)))
+ return;
+ call2 (intern_c_string ("display-warning"),
+ Qcomp,
+ CALLN (Fformat,
+ build_string ("Cannot look up eln file as "
+ "no source file was found for %s"),
+ *filename));
+ return;
+ }
}
}
Lisp_Object eln_rel_name = Fcomp_el_to_eln_rel_filename (src_name);