Subject: bug#28904: modes changed outside Customize

From: [email-masked] (Charles A. Roelli)
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.