From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73609: 29.1; use-package overwrites custom variables in byte-compiled files Date: Thu, 03 Oct 2024 14:02:23 +0300 Message-ID: <86frpdzby8.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14517"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73609@debbugs.gnu.org To: Al Haji-Ali Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 03 13:03:19 2024 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 1swJc5-0003dJ-Ka for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Oct 2024 13:03:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swJbr-0005Rv-2K; Thu, 03 Oct 2024 07:03:03 -0400 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 1swJbp-0005R5-2o for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 07:03:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swJbo-00049u-Nk for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 07:03:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=XeYXPZPDIpQOvPwGvkAIir8eKzpNbmUi9+5s3876Qis=; b=YG+HocXBrVi/Jpydp9GuFxCxwoxorkYNVXEJJTvFlGX/hh19Sa9YCphYb0PoN5/QCIYU5hIrnAZ1DqoI/3CnQuYqDnRgwm1ix/PW/p/TnxSheV8VOG9z+T8kfRlQJl43X6kZVEVfZsZchqKuhESx1hhYM+1BwSqc+9ImD0tmwskJKzpjpYiVINKWThS3liHYVqsv7stGtD6Kc6Xm3ju5RE+3QrBv3wVotIHHT7/Tx+4kCCDyqLuoyoThMYvl5xNgHnd4dzWrIRGnDmoEmRt2CMAhn8xE1E2luJ/mjbvOPryvSbgKkCxNkaYiE67J4SjwbzOY3c2cjJGmEKJNYiCMPA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1swJbq-0004Xk-Aq for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 07:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Oct 2024 11:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73609 X-GNU-PR-Package: emacs Original-Received: via spool by 73609-submit@debbugs.gnu.org id=B73609.172795335517432 (code B ref 73609); Thu, 03 Oct 2024 11:03:02 +0000 Original-Received: (at 73609) by debbugs.gnu.org; 3 Oct 2024 11:02:35 +0000 Original-Received: from localhost ([127.0.0.1]:60122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swJbO-0004X6-Sa for submit@debbugs.gnu.org; Thu, 03 Oct 2024 07:02:35 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swJbN-0004Wu-Qn for 73609@debbugs.gnu.org; Thu, 03 Oct 2024 07:02:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1swJbG-00045G-Qg; Thu, 03 Oct 2024 07:02:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=XeYXPZPDIpQOvPwGvkAIir8eKzpNbmUi9+5s3876Qis=; b=rFo076Xr/U0S N5Fvx6RIfVRDSen7p8niPBc3QgAseRsnOaCJD8iuDag8/7w6gE01ovVaXV7Bb/rjIJi3JBYhhUgNm mBNqqeXcCpSJItVF+/dJtYd4RO0DB/yp8YRqRjlHmJ4PbjiDAyJ0B5JQ+sLWxcKT9R6G+rHrH/M3w ay47aRNMNGlto9zZ9sg3Zqfc1rQ1+bIgbYTs0ZcacuCV+isRpvRFQpCmSEmGOGvL04ddluHS72g1n 0nawqrEbuYwNXrVHXEArZj5JDqT7HDOZkEHb7NVRvryvFsOYG9NzatDARATM4Jh6BLhH0bk5bRLjm 3yVlXxQgrE86CsR1sZBIIw==; In-Reply-To: (message from Al Haji-Ali on Thu, 03 Oct 2024 06:47:51 +0100) 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:292897 Archived-At: > From: Al Haji-Ali > Date: Thu, 03 Oct 2024 06:47:51 +0100 > > > In my config file, I have a use-package statement like this > > ,---- > | (use-package org > | :custom > | (org-log-reschedule nil)) > `---- > > If I byte-compile my config file, run Emacs and run: > > ,---- > | (message "START value is %S" org-log-reschedule) > | (setq org-log-reschedule t) > | (message "BEFORE value is %S" org-log-reschedule) > | (define-advice enable-theme (:before (theme) enable-theme@debug) > | (message "Loading theme %S" theme))) > | (require 'use-package) > | (message "AFTER value is %S" org-log-reschedule) > `---- > > I get the messages: > ,---- > | START value is nil > | BEFORE value is t > | Loading theme `use-package` > | AFTER value is nil > `---- > > I believe that is because, in my byte-compiled config, `use-package` is no longer required since all `use-package` statements are expanded. This means that `use-package-core` is also no longer required and in that file, a naked (enable-theme 'use-package) statement, which resets all custom random variables, is always executed. This is exactly what happens when I eventually require `use-package`. > > I can fix this by simply always requiring `use-package` in my config so that the enable-theme statement in `use-package-core` is executed before I modify any variables. Alternatively, this small patch seems to fix the root cause of the issue. Can you try this with the latest emacs-30 branch of the Emacs Git repository? I believe some changes were done to use-package there, and they might fix your problem as well. Thanks.