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: Sun, 13 Oct 2024 18:31:39 +0100 Message-ID: References: <86frpdzby8.fsf@gnu.org> <86wmidycat.fsf@gnu.org> <3BD8C402-58DE-429C-8C90-744471B95007@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24425"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73609@debbugs.gnu.org To: John Wiegley , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 13 19:42:07 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 1t02bX-0006Di-41 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Oct 2024 19:42:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t02bF-00028o-F1; Sun, 13 Oct 2024 13:41:49 -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 1t02bD-00028g-VX for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 13:41:48 -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 1t02bD-0004Pb-K4 for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 13:41:47 -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:References:In-Reply-To:From:To:Subject; bh=AbWZ8mbIqnsPEZgpCf5ZKpif5RkXN5/sENMg3bmFKaE=; b=onvWOoJxcnAFkk6wHYzKPYTI9NME+O03nVeaffQV6pqaTTqK9DD+yljdurpTbdtht0ZSNFieS3frcBEXwUyKVnXLbkotdoi0R0voWp7R7eElWqt5rdXnwag4YAtYAsqPkPgz/dHrjZJ0khvjahsmVfEyX6S09JgLe/xnzO6dQr2Pvw0VJ2RdMZwdO2muAQHGK7L4iJwkedKNWClil25SPWPzwJHgaK7jERU06Bo8nYU/dbrebE6pvr7vuKO6fb+DWGi4KX6uQSh5n9nC1oX38L7JUT7QrfSoOIewGRYDVazYef9RrNzijeNBUpA5L4TaqwxAsTIkoeJhuCKyBEdc0A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t02bS-0000Bj-IM for bug-gnu-emacs@gnu.org; Sun, 13 Oct 2024 13:42: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: Sun, 13 Oct 2024 17:42: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.1728841283555 (code B ref 73609); Sun, 13 Oct 2024 17:42:02 +0000 Original-Received: (at 73609) by debbugs.gnu.org; 13 Oct 2024 17:41:23 +0000 Original-Received: from localhost ([127.0.0.1]:53043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t02ap-00008r-0O for submit@debbugs.gnu.org; Sun, 13 Oct 2024 13:41:23 -0400 Original-Received: from mail-wm1-f48.google.com ([209.85.128.48]:43479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t02am-00008h-G0 for 73609@debbugs.gnu.org; Sun, 13 Oct 2024 13:41:21 -0400 Original-Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-431160cdbd0so21762545e9.1 for <73609@debbugs.gnu.org>; Sun, 13 Oct 2024 10:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728841204; x=1729446004; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=AbWZ8mbIqnsPEZgpCf5ZKpif5RkXN5/sENMg3bmFKaE=; b=eQabZv782WgeWYHgsbTU9DA9nwl7HbbOFQXuXC8H7/9d2ucR6fDtrOr3FMPysL3xIi UymrbML21j2tnkiXNgFUoFi0GsLevIE6pu1finr9w7F77xE94oWpQ1JdW/2WCOxBD7rr IE/hQchnaQhkAVA0ysPsvgwD+1dz5ZPLFX7CHlEyL2WDKfX0tOuK24M9BthZP5cKMcdt z6/pzM2VqMOnHrTULN/G9y6hC+QWmsk8Rl9mgRFqA0Oq+/p1Mwh/L6hDBsVfkjGUcb6m SqMtQW/l6pl/5rfTsGsnAg65n3kxkjffO4lDvxzY2i4dzQZRMAKIacWdT0O373AMN9Hu mMyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728841204; x=1729446004; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AbWZ8mbIqnsPEZgpCf5ZKpif5RkXN5/sENMg3bmFKaE=; b=iCAB0P5sjmcqFpMidMW5uRuT3EqKGH8ymq+HPKengt981w3R160N5cdLOmwLCT0+2v lboqeUKSo2kh4CVzs6dJZUv/5XJ38SlkH5GKnDGO35eExOYrtS118kLw1lWNPWuXuKt+ XLdYhuRvhlzniernfjCPZjn2TqT7IAmMtYfwBHykoc90br5fmchtjYvg9O6PlSf/cFNC OTkDr8DVfFYFa/3cu95/BjFsJ5PseD7ibuej0tyVigiA7m8E1Av25kZQWTyFnYpOJUW9 nZJ1WUvETFaxMkQ7PHEfqs5oDZxJsmpx2jb9nPZzsI1vNop0j5zAeaUhcr2b/nc7400o MQPQ== X-Gm-Message-State: AOJu0YwGOXMrZrZ/WvtnnljnhYk2Dlug9GjYv6qZH/oHGR+0L+EW/p0t ozfDFGd6rDaniirZ6M7SKoYPYklEdO5v5BL6n20253HTTGspU115XxfC90GB X-Google-Smtp-Source: AGHT+IEp4Ebo8fY81A5lopw7HRVKG5hgKhs02lASTJspgg/fmzrq//0I1s5MstiNYlT6J7wN3GXLiQ== X-Received: by 2002:a05:600c:4e8e:b0:430:4db2:2b88 with SMTP id 5b1f17b1804b1-4311d891c4cmr68550725e9.5.1728841203375; Sun, 13 Oct 2024 10:40: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 5b1f17b1804b1-431182ffabdsm98451035e9.14.2024.10.13.10.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2024 10:40:02 -0700 (PDT) In-Reply-To: <3BD8C402-58DE-429C-8C90-744471B95007@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:293543 Archived-At: Hello, On 12/10/2024, John Wiegley wrote: > I don=E2=80=99t fully understand. The purpose of of `:custom (X Y)` is ex= actly to customize X to the value Y using the value setting functions of th= e customization framework. > > Is the user expecting that byte-compilation would cause the value to be s= et without loading use-package? No, the point is that this is already the case, and that is causing a discr= epancy between having a compiled file vs not. The original message had the = context, but if you've seen that already, here's another crack at explainin= g. Apologies for the repetition. The function definition above essentially has the sequence: 1- load a file that uses `use-package` with a `:custom` statement to set a = variable.=20 2- modify said variable to some other value. 3- require `use-package`. 4- Check value of variable. If the file is not compiled, then `use-package` is loaded in step 1 in orde= r to expand the `use-package` statement. This means that the third step doe= sn't do anything, and the value of the variable is set to whatever I had in= step 2. However, if the file is compiled, the first step does not load `use-package= `, due to lazy loading and since all `use-package` macro calls are expanded= in a compiled file. This means that the loading of `use-package` happens i= n the third step, after I have modified the variable. The in turns loads `u= se-package-core` and the 'use-package theme is enabled, which resets the va= lue of all custom variables that were set using `:custom` statements. The f= inal result is that value of the variable in step 4 is the one from step 1,= rather than step 2. I hope this clarifies the issue. I included a potential patch in my origina= l message which fixes the issue, but I am not sure if it would have uninten= ded consequences, -- Al