GNU bug report logs - #73609
29.1; use-package overwrites custom variables in byte-compiled files

Previous Next

Package: emacs;

Reported by: Al Haji-Ali <abdo.haji.ali <at> gmail.com>

Date: Thu, 3 Oct 2024 05:51:02 UTC

Severity: normal

Found in version 29.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: John Wiegley <johnw <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 73609 <at> debbugs.gnu.org, Al Haji-Ali <abdo.haji.ali <at> gmail.com>
Subject: bug#73609: 29.1; use-package overwrites custom variables in byte-compiled files
Date: Sat, 12 Oct 2024 08:22:45 -0700
I don’t fully understand. The purpose of of `:custom (X Y)` is exactly to customize X to the value Y using the value setting functions of the customization framework.

Is the user expecting that byte-compilation would cause the value to be set without loading use-package?

I need a bit more clarity. Also, a much simpler approach to assessing what use-package is “doing” is to expand the macro, as that should make the intended behavior obvious.

John

> On Oct 12, 2024, at 1:07 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Al Haji-Ali <abdo.haji.ali <at> gmail.com>
>> Cc: 73609 <at> debbugs.gnu.org
>> Date: Fri, 11 Oct 2024 23:25:08 +0100
>> 
>> 
>> 
>>> 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.
>> 
>> I just tried it on the main branch (version 31.0.50) and saw the same behaviour. I also checked the part of the code that I think is the reason and it remains the same.
>> 
>> Here's how I am able to reproduce the issue:
>> 
>> --8<---------------cut here---------------start------------->8---
>> ;;; 1. Run emacs -Q
>> ;;; 2. Define the following function
>> 
>> (defun bug-73609 (&optional setup)
>>  (let ((filename (file-name-concat temporary-file-directory "temp.el")))
>>    (if setup
>>        (progn (write-region "(use-package org\n:custom\n(org-log-reschedule 'note))"
>>                             nil filename)
>>               (require 'use-package)
>>               (byte-compile-file filename))
>>      (load (concat filename "c"))
>>      (message "START value is %S, use-package is%s loaded"
>>               org-log-reschedule
>>               (if (featurep 'use-package)
>>                   ""
>>                 " NOT"))
>>      (setq org-log-reschedule t)
>>      (message "BEFORE value is %S" org-log-reschedule)
>>      (define-advice enable-theme (:before (theme) enable-theme <at> debug)
>>        (message "Loading theme %S" theme))
>>      (require 'use-package)
>>      (message "AFTER value is %S" org-log-reschedule))))
>> 
>> ;;; 3. Call
>> (bug-73609 t)
>> 
>> ;;; 4. Restart `emacs -Q` and redefine the function above
>> ;;; 5. Run
>> (bug-73609)
>> 
>> ;; The output is
>> ; START value is note, use-package is NOT loaded
>> ; BEFORE value is t
>> ; Loading theme use-package
>> ; Loading theme user
>> ; AFTER value is note
>> --8<---------------cut here---------------end--------------->8---
>> 
>> 
>> I expect the final line to be
>> 
>> ; AFTER value is t
>> 
>> as I do not expect that loading `use-package` would change the value of the variable `org-log-reschedule`.
> 
> John, any suggestions or ideas?





This bug report was last modified 198 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.