From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#59424: bug#59358: 29.0.50; failing to load .eln for init file sets user-init-file to warnings.el Date: Sun, 27 Nov 2022 20:53:27 +0100 Message-ID: References: <834juwbasq.fsf@gnu.org> <838rjwp5bg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000dd309505ee791d8c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3693"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59424@debbugs.gnu.org, akrl@sdf.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 27 20:55:23 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozNkJ-0000po-0R for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 20:55:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozNk4-0007Mr-W9; Sun, 27 Nov 2022 14:55:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozNk0-0007MU-Dv for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 14:55:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozNk0-0005aJ-49 for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 14:55:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozNjy-0008SH-6g for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 14:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 19:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59424 X-GNU-PR-Package: emacs Original-Received: via spool by 59424-submit@debbugs.gnu.org id=B59424.166957885132491 (code B ref 59424); Sun, 27 Nov 2022 19:55:02 +0000 Original-Received: (at 59424) by debbugs.gnu.org; 27 Nov 2022 19:54:11 +0000 Original-Received: from localhost ([127.0.0.1]:43920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozNj9-0008Rz-DE for submit@debbugs.gnu.org; Sun, 27 Nov 2022 14:54:11 -0500 Original-Received: from mail-ed1-f42.google.com ([209.85.208.42]:37635) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozNj7-0008Rs-3q for 59424@debbugs.gnu.org; Sun, 27 Nov 2022 14:54:09 -0500 Original-Received: by mail-ed1-f42.google.com with SMTP id l11so12934156edb.4 for <59424@debbugs.gnu.org>; Sun, 27 Nov 2022 11:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=IQHhrM3sxkeMMfQtRTqUgXTBybr2+tHXuj4wbUt9V84=; b=pnMXUvJzidaYiHU5OLRcwDoHM3RVxba6jlHBM56/KVo8tt6oN/yCYOloW6f6G9mxIK yOU6QM/jATBKqHhw/Rh4bqgEsBEVT6pdUI/uW/cUVpgVDHuBC9YjVSsa4AP7IHKbMq0U gVSR4Gwd9ch1vhBRzb9HJQtO3LmUWU29WW703y6DqhrEUDCY40t4SHSvq+Y9pgu1VuKE lapEBq4PoU2yA6fkqdDKH9iwf0r41vV5CdShghJfjWRSnfrwR4B8/HJoq2a09lGLCwpK QTC87DUbj78/KwxuAMEMxSVPMrAVEBG+yidlBOo5Vb7oJKnFVv4xZ0Aum9EQcl6+8yxs 04hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IQHhrM3sxkeMMfQtRTqUgXTBybr2+tHXuj4wbUt9V84=; b=hwYcMMuZsgM6RCjSDkXnJ7nhp5Ox8lNh9VCBTeMokxyB0fBBnsFFeZJgIJTBZYCPNw PlPEgqqtSE/VoQai+6CH9yVTcnIkLxJKh6vcYGPHdIJXmIqPAWoJ683BrzCbSLZJZRW9 WgiemLOW2q5GRhfIUjT2kCohX5j7y5SzS2jzgmjwco1MH6XYj6kS1i2v9BN48PXK7xE+ rneGeoHKjyr8ma5Jpqq5PU23z2wHO0g2nmcXvszky1hUHaqsNa2C1RBR5EKDNrD1yRLb RUnIBS12ANyUcTaDWbpwmvu1K15jgC9dJVcxinE5PMI3AuWsquxC379M3sjcKrIAcvXL tUjQ== X-Gm-Message-State: ANoB5pml9cNt2JD1w1ByRVFlU6j5iHm6tpHC6RNi5DGrE8qyu55FNGXQ nnfjq/Flr/E2hT0F3K7vnUXvsCcxje/DgfJ/Ztc= X-Google-Smtp-Source: AA0mqf4+uz09nmb18qw3hff2qwTRVje/+D65xfNWQC6VJJnpEXM+5D2u6YgOjx2s4BZBqMKIj5kL5vO4GL3I213oyJo= X-Received: by 2002:a05:6402:f01:b0:459:9dd3:2217 with SMTP id i1-20020a0564020f0100b004599dd32217mr35435044eda.163.1669578843040; Sun, 27 Nov 2022 11:54:03 -0800 (PST) In-Reply-To: <838rjwp5bg.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249244 Archived-At: --000000000000dd309505ee791d8c Content-Type: text/plain; charset="UTF-8" This patch below is what I did, *just* to get comp not to complain about the "missing" .emacs.el. Then something should be done to make it to compile .emacs, and I'm not sure where or how. I can't shake the feeling that I'm thrashing around and someone who knows the code could do it faster and cleaner. diff --git i/src/comp.c w/src/comp.c index b6072a866e..a8e67bbeb2 100644 --- i/src/comp.c +++ w/src/comp.c @@ -4473,7 +4473,10 @@ DEFUN ("comp-el-to-eln-rel-filename", Fcomp_el_to_eln_rel_filename, Lisp_Object separator = build_string ("-"); Lisp_Object path_hash = comp_hash_string (filename); - filename = concat2 (Ffile_name_nondirectory (Fsubstring (filename, Qnil, - make_fixnum (-3))), - separator); + if (suffix_p (filename, ".emacs")) + filename = concat2 (Ffile_name_nondirectory (filename), separator); + else + filename = concat2 (Ffile_name_nondirectory (Fsubstring (filename, Qnil, + make_fixnum (-3))), + separator); Lisp_Object hash = concat3 (path_hash, separator, content_hash); return concat3 (filename, hash, build_string (NATIVE_ELISP_SUFFIX)); diff --git i/src/lread.c w/src/lread.c index 0a6e4201e4..b0b08ba872 100644 --- i/src/lread.c +++ w/src/lread.c @@ -1716,7 +1716,10 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd, Fremhash (*filename, V_comp_no_native_file_h); - if (no_native - || load_no_native - || !suffix_p (*filename, ".elc")) + if (no_native || load_no_native) + return; + + bool _emacs = suffix_p (*filename, ".emacs.elc"); + + if (!_emacs && !suffix_p (*filename, ".elc")) return; @@ -1724,5 +1727,5 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd, Lisp_Object eln_path_tail = Vnative_comp_eln_load_path; Lisp_Object src_name = - Fsubstring (*filename, Qnil, make_fixnum (-1)); + Fsubstring (*filename, Qnil, make_fixnum (_emacs ? -4 : -1)); if (NILP (Ffile_exists_p (src_name))) { --000000000000dd309505ee791d8c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
This patch below is what I did, *just* to get comp not to complain a= bout the "missing" .emacs.el.

Then something should be don= e to make it to compile .emacs, and I'm not sure where or how.

I= can't shake=C2=A0the feeling that I'm thrashing around and someone= who knows the code could do it faster and cleaner.


diff --git i= /src/comp.c w/src/comp.c
index b6072a866e..a8e67bbeb2 100644
--- i/sr= c/comp.c
+++ w/src/comp.c
@@ -4473,7 +4473,10 @@ DEFUN ("comp-el= -to-eln-rel-filename", Fcomp_el_to_eln_rel_filename,
=C2=A0 =C2=A0L= isp_Object separator =3D build_string ("-");
=C2=A0 =C2=A0Lisp= _Object path_hash =3D comp_hash_string (filename);
- =C2=A0filename =3D = concat2 (Ffile_name_nondirectory (Fsubstring (filename, Qnil,
- = =C2=A0 make_fixnum (-3))),
- =C2=A0 =C2=A0 =C2=A0separator);
+ =C2= =A0if (suffix_p (filename, ".emacs"))
+ =C2=A0 =C2=A0filename = =3D concat2 (Ffile_name_nondirectory (filename), separator);
+ =C2=A0els= e
+ =C2=A0 =C2=A0filename =3D concat2 (Ffile_name_nondirectory (Fsubstri= ng (filename, Qnil,
+ =C2=A0 =C2=A0 make_fixnum (-3))),
+ se= parator);
=C2=A0 =C2=A0Lisp_Object hash =3D concat3 (path_hash, separato= r, content_hash);
=C2=A0 =C2=A0return concat3 (filename, hash, build_str= ing (NATIVE_ELISP_SUFFIX));
diff --git i/src/lread.c w/src/lread.c
in= dex 0a6e4201e4..b0b08ba872 100644
--- i/src/lread.c
+++ w/src/lread.c=
@@ -1716,7 +1716,10 @@ maybe_swap_for_eln (bool no_native, Lisp_Object = *filename, int *fd,
=C2=A0 =C2=A0 =C2=A0Fremhash (*filename, V_comp_no_n= ative_file_h);
=C2=A0
- =C2=A0if (no_native
- =C2=A0 =C2=A0 =C2=A0= || load_no_native
- =C2=A0 =C2=A0 =C2=A0|| !suffix_p (*filename, ".= elc"))
+ =C2=A0if (no_native || load_no_native)
+ =C2=A0 =C2=A0r= eturn;
+
+ =C2=A0bool _emacs =3D suffix_p (*filename, ".emacs.el= c");
+
+ =C2=A0if (!_emacs && !suffix_p (*filename, &quo= t;.elc"))
=C2=A0 =C2=A0 =C2=A0return;
=C2=A0
@@ -1724,5 +1727= ,5 @@ maybe_swap_for_eln (bool no_native, Lisp_Object *filename, int *fd,=C2=A0 =C2=A0Lisp_Object eln_path_tail =3D Vnative_comp_eln_load_path;=C2=A0 =C2=A0Lisp_Object src_name =3D
- =C2=A0 =C2=A0Fsubstring (*filen= ame, Qnil, make_fixnum (-1));
+ =C2=A0 =C2=A0Fsubstring (*filename, Qnil= , make_fixnum (_emacs ? -4 : -1));
=C2=A0 =C2=A0if (NILP (Ffile_exists_p= (src_name)))
=C2=A0 =C2=A0 =C2=A0{

--000000000000dd309505ee791d8c--