From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#59334: 29.0.50; loading native-compiled init file sets user-init-file to .eln Date: Thu, 17 Nov 2022 20:04:42 +0000 Message-ID: References: <8335aheqct.fsf@gnu.org> <83wn7td6l0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9239"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Juanma Barranquero , 59334@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 17 21:05:16 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 1ovl8N-00024F-IE for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Nov 2022 21:05:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovl8C-00017T-OP; Thu, 17 Nov 2022 15:05:05 -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 1ovl8B-00016v-7b for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 15:05:03 -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 1ovl8A-0002j9-Cd for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 15:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovl8A-0002rP-8P for bug-gnu-emacs@gnu.org; Thu, 17 Nov 2022 15:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Nov 2022 20:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59334 X-GNU-PR-Package: emacs Original-Received: via spool by 59334-submit@debbugs.gnu.org id=B59334.166871549610980 (code B ref 59334); Thu, 17 Nov 2022 20:05:02 +0000 Original-Received: (at 59334) by debbugs.gnu.org; 17 Nov 2022 20:04:56 +0000 Original-Received: from localhost ([127.0.0.1]:34460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovl84-0002r2-2Y for submit@debbugs.gnu.org; Thu, 17 Nov 2022 15:04:56 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:58006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovl80-0002qq-DB for 59334@debbugs.gnu.org; Thu, 17 Nov 2022 15:04:54 -0500 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 2AHK4n2l014281 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Thu, 17 Nov 2022 20:04:49 GMT In-Reply-To: <83wn7td6l0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 17 Nov 2022 16:00:11 +0200") 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:248141 Archived-At: Eli Zaretskii writes: >> From: Juanma Barranquero >> Date: Thu, 17 Nov 2022 14:30:27 +0100 >> Cc: 59334@debbugs.gnu.org >> >> M-: (gethash "init-7890dda9-d677a456.eln" comp-eln-to-el-h) RET >> >> => "d:/mypath/Home/.emacs.d/init.el" > > OK, thanks. So using this, can you propose a patch for > startup--load-user-init-file, where it figures out the name of > user-init-file? It happens in this fragment: > > ;; If we loaded a compiled file, set `user-init-file' to > ;; the source version if that exists. > (when (equal (file-name-extension user-init-file) > "elc") > (let* ((source (file-name-sans-extension user-init-file)) > (alt (concat source ".el"))) > (setq source (cond ((file-exists-p alt) alt) > ((file-exists-p source) source) > (t nil))) > (when source > (when (file-newer-than-file-p source user-init-file) > (message "Warning: %s is newer than %s" > source user-init-file) > (sit-for 1)) > (setq user-init-file source)))) > > Note that the gethash trick I suggested needs a _basename_ of the .eln > file, without any leading directories. > > (It is best if you propose a patch because it should be easy for you > to test it.) > > Andrea, do you agree with this solution? Hi Eli, yes, I'd have suggested the same. Andrea