GNU bug report logs - #28904
modes changed outside Customize

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch (Charles A. Roelli)

Date: Thu, 19 Oct 2017 19:47:02 UTC

Severity: minor

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28904 in the body.
You can then email your comments to 28904 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28904; Package emacs. (Thu, 19 Oct 2017 19:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to charles <at> aurox.ch (Charles A. Roelli):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 19 Oct 2017 19:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: charles <at> aurox.ch (Charles A. Roelli)
To: bug-gnu-emacs <at> gnu.org
Subject: modes changed outside Customize
Date: Thu, 19 Oct 2017 21:46:33 +0200
From emacs -q (26.0.90):

M-x column-number-mode
C-x z				> Repeat it to turn it back off.
M-x load-theme RET tango RET 	> Any theme will do.

Notice that column numbers are turned on again in the mode line.  They
should not be on.

If you type M-x customize-variable RET column-number-mode RET right
before loading the theme in the above steps, you'll see something like
this:

Hide Column Number Mode: off (nil)
    State : CHANGED outside Customize.
   Non-nil if Column-Number mode is enabled.
   See the ‘column-number-mode’ command
   for a description of this minor mode.

I think it's the fact that column-number-mode is considered as
"CHANGED outside Customize" that causes column-number-mode to be
erroneously turned on when you load a theme.  So I suspect the issue
is in customize-mark-as-set, which is called by the column-number-mode
function defined by define-minor-mode.  I tried to debug a call to
customize-mark-as-set with Edebug, but I haven't had much time to see
why it might cause the above issue.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28904; Package emacs. (Mon, 24 Aug 2020 23:05:01 GMT) Full text and rfc822 format available.

Message #8 received at 28904 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: charles <at> aurox.ch
Cc: 28904 <at> debbugs.gnu.org
Subject: Re: bug#28904: modes changed outside Customize
Date: Mon, 24 Aug 2020 20:04:06 -0300
[Message part 1 (text/plain, inline)]
charles <at> aurox.ch (Charles A. Roelli) writes:

>>From emacs -q (26.0.90):
>
> M-x column-number-mode
> C-x z > Repeat it to turn it back off.
> M-x load-theme RET tango RET > Any theme will do.
>
> Notice that column numbers are turned on again in the mode line.  They
> should not be on.

I can reproduce this with latest master.

This was introduced in commit fccf278488785f482c7c50ac0713aa8f60dafbe9.
The issue is that we are pushing the new value to the user theme only if
it is not the saved-value or the standard-value.  So if the user ever goes
back
to one of those two values (in the recipe, by turning `column-number-mode'
off),
then we never store that value in the user theme.

And because we have the wrong value stored, loading a theme steps over
the user preference.

So I think the fix would be to keep the user theme in sync with the
actual value, at any time.
[Message part 2 (text/html, inline)]
[0001-Keep-the-user-theme-in-sync-when-marking-a-variable-.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28904; Package emacs. (Thu, 27 Aug 2020 14:24:01 GMT) Full text and rfc822 format available.

Message #11 received at 28904 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 28904 <at> debbugs.gnu.org, charles <at> aurox.ch
Subject: Re: bug#28904: modes changed outside Customize
Date: Thu, 27 Aug 2020 16:23:05 +0200
Mauro Aranda <maurooaranda <at> gmail.com> writes:

> And because we have the wrong value stored, loading a theme steps over
> the user preference.
>
> So I think the fix would be to keep the user theme in sync with the
> actual value, at any time.

Makes sense to me.  I've now applied your patch to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 27 Aug 2020 14:24:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 28904 <at> debbugs.gnu.org and charles <at> aurox.ch (Charles A. Roelli) Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 27 Aug 2020 14:24:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Sep 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 211 days ago.

Previous Next


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