From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Al Haji-Ali Newsgroups: gmane.emacs.bugs Subject: bug#73609: 29.1; use-package overwrites custom variables in byte-compiled files Date: Thu, 03 Oct 2024 06:47:51 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32855"; mail-complaints-to="usenet@ciao.gmane.io" To: 73609@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 03 07:51:10 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 1swEk0-0008Mi-Ja for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Oct 2024 07:51:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1swEjw-0004TE-6l; Thu, 03 Oct 2024 01:51:04 -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 1swEju-0004T2-Bn for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 01:51:03 -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 1swEjt-0008SD-8y for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 01:51:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=hPKQNHjj1J2FBqHo6hlITWiWFRedSNKZZOqZuipmZ30=; b=akF8y1TuiZmIgWZjBIT+rg+rx9HczGqN4EdoFWpY7F6ys7XNHuNTVJzrKTsxgsYutNHtuQX+1sDx+9Rw21UflrMzfhmoNKtXlNN5QHDzFVrgAWWDy9Nm00BoYfyvpbEq/Dq9DzkH3S5dz5E85sbm8q65pHUalU5ui6yFnmODusIT4UVTw74Rxx1HMzzvnfnDHf6XFOVz+YPH0/QSt+EZT3527FCobu0FRfnD5kIWQz20PoDakAAmYPw7b6gfVfofA9n3QbmutvMVOx5P4JWEUYEN17CkICZsJ2/irnNjHJBKbMlLnOZPbuDyKm4th0ChqrWz98/+5owfx0n7F7EkSw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1swEju-0004ne-KV for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 01:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Al Haji-Ali Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Oct 2024 05:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73609 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.172793461318350 (code B ref -1); Thu, 03 Oct 2024 05:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Oct 2024 05:50:13 +0000 Original-Received: from localhost ([127.0.0.1]:59732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swEj6-0004lr-ML for submit@debbugs.gnu.org; Thu, 03 Oct 2024 01:50:13 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:58712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swEj4-0004ih-Fc for submit@debbugs.gnu.org; Thu, 03 Oct 2024 01:50:11 -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 1swEj2-0004M4-Pu for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 01:50:08 -0400 Original-Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1swEj1-0008Lo-5g for bug-gnu-emacs@gnu.org; Thu, 03 Oct 2024 01:50:08 -0400 Original-Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a8a837cec81so36770966b.2 for ; Wed, 02 Oct 2024 22:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727934604; x=1728539404; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=hPKQNHjj1J2FBqHo6hlITWiWFRedSNKZZOqZuipmZ30=; b=OSLsl97W7w30xZKcMY5sBDALrRlHpTLpqUqofED+cgnXWXsUdH7RYscB0Fi0lNW4W9 QviCme8X5FwUOeuHB4CVT2X/bEZxEBIcrbYKWbLEufmvsu1fqo5ykx/qXIhrl5GhlBXu mOHiuD3iFp/kt/6Mdjf9j2D8puvlNAf2HX80aNLY98JBpTQKRjV4wz/R8Q35RKFtCQaS 7YkuBEYwip6bFPtCMVbTxqU4++oJHAh6gbZJ+ZALm4cfSAa1K3gOk59ThOR9vJgh5tDc +nXq/piLIeUQdlFrtnU1Y8OXT0rbZQQp5lZjDubPCz6qIe4xd7iJpITCqWbxDXiJv8YT Hurw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727934604; x=1728539404; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hPKQNHjj1J2FBqHo6hlITWiWFRedSNKZZOqZuipmZ30=; b=e4Kv2WuJeRDqhxkV5joOTEANvA4Z8fGe2tS5mEZMJgD9IzzqszGTywo3x8K5yEvOQP D7BJ9WABkwfxbunNZFSbaiBLiWTCeYpw5suJk9uRvesnSBZ+fUmH2mEV3xL7wFXj+h4R zCRZdZNmWfJGSxFVX2j4fiHAAstpFD5yfLAbxwCJB5JGJeCD9p2ZcZiUJTodulUJ+k8s SktSc5QLhVnkYu5Bg9XUooA4nA1VJoKvn1r/9HhQ85SnPHkVulv6PwkpmsEG/6dl9zbb JgQvecePx7Ycp0Ofe4XfrVeHXlNcD0xu6XvNzHhZlDlT4ED1+DgNVzvDRCKATCa5zgKs GXIA== X-Gm-Message-State: AOJu0YxOOcJFrpxYPlolgamg8kzsrAgB1XX3AluOZ4M9k2LKrx1i8Ffu isnn+6Y4P9nufPfoiyJ8ViJ+HzsbxLPlD96jqq1pq0l+ss34lcvViYh8BA== X-Google-Smtp-Source: AGHT+IG/3YAtgm8MEnHAHjsqMQMU4XUKS0IK+/+0kd1JgebB0gdqve6j2oWwXRsjYRXxDZD+MQ1Zdg== X-Received: by 2002:a05:6402:430e:b0:5c8:7bbd:1c4f with SMTP id 4fb4d7f45d1cf-5c8b18b7a8amr4914957a12.7.1727934603573; Wed, 02 Oct 2024 22:50:03 -0700 (PDT) Original-Received: from localhost (sgyl-45-b2-v4wan-166941-cust3717.vm6.cable.virginm.net. [82.37.190.134]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c8ca3de7b6sm312556a12.27.2024.10.02.22.50.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 22:50:02 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=abdo.haji.ali@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:292881 Archived-At: 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. --8<---------------cut here---------------start------------->8--- diff --git a/use-package-core.el b/use-package-core.el index bb523f6..5b1a414 100644 --- a/use-package-core.el +++ b/use-package-core.el @@ -38,7 +38,8 @@ ;; Necessary in order to avoid having those variables saved by custom.el. (deftheme use-package)) -(enable-theme 'use-package) +(unless (memq 'use-package custom-known-themes) + (enable-theme 'use-package)) ;; Remove the synthetic use-package theme from the enabled themes, so ;; iterating over them to "disable all themes" won't disable it. (setq custom-enabled-themes (remq 'use-package custom-enabled-themes)) --8<---------------cut here---------------end--------------->8--- -- Al