all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 59424@debbugs.gnu.org, akrl@sdf.org
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	[thread overview]
Message-ID: <CAAeL0SSPZmgtcpWktvS4ucKVCZX5a9UyioR6vKmMWMsj-bH6gA@mail.gmail.com> (raw)
In-Reply-To: <838rjwp5bg.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1955 bytes --]

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)))
     {

[-- Attachment #2: Type: text/html, Size: 2433 bytes --]

  reply	other threads:[~2022-11-27 19:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18 13:17 bug#59358: 29.0.50; failing to load .eln for init file sets user-init-file to warnings.el Juanma Barranquero
2022-11-18 14:24 ` Eli Zaretskii
2022-11-19  9:13   ` Juanma Barranquero
2022-11-19 10:21     ` Eli Zaretskii
2022-11-20 18:59       ` Andrea Corallo
2022-11-27 19:01   ` bug#59424: " Juanma Barranquero
2022-11-27 19:26     ` Eli Zaretskii
2022-11-27 19:53       ` Juanma Barranquero [this message]
2022-11-27 20:26         ` Eli Zaretskii
2022-11-27 20:29           ` Juanma Barranquero
2022-11-28 13:58           ` Andrea Corallo
2022-11-20 22:14 ` bug#59358: Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAeL0SSPZmgtcpWktvS4ucKVCZX5a9UyioR6vKmMWMsj-bH6gA@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=59424@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.