GNU bug report logs - #16266
24.3; `load-theme' prevents immediate setting of themed variables

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Alex Kost <alezost@HIDDEN>; dated Fri, 27 Dec 2013 07:17:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 16266 <at> debbugs.gnu.org:


Received: (at 16266) by debbugs.gnu.org; 27 Dec 2013 08:15:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 27 03:15:44 2013
Received: from localhost ([127.0.0.1]:45281 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VwSa7-0004cG-Q2
	for submit <at> debbugs.gnu.org; Fri, 27 Dec 2013 03:15:44 -0500
Received: from mail-lb0-f175.google.com ([209.85.217.175]:36890)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <alezost@HIDDEN>) id 1VwSa4-0004c5-FZ
 for 16266 <at> debbugs.gnu.org; Fri, 27 Dec 2013 03:15:41 -0500
Received: by mail-lb0-f175.google.com with SMTP id w6so4127432lbh.34
 for <16266 <at> debbugs.gnu.org>; Fri, 27 Dec 2013 00:15:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:subject:references:date:in-reply-to:message-id:user-agent
 :mime-version:content-type;
 bh=qE4Az1VMZcisEBEGBXhhkY1h7jw/a/Uk+2vlFZVfjPM=;
 b=dHJgaktr9kgxUi6QV3eN0AD2HiPLFIox1QZPEYnzdqu+ar24fNhUF/d9glYfvoo1Py
 jp8tRQ1diWpkS7iFlfxxJQ/Gs2SQ5BRwNTNgk9KIRZQiMgZL9mSWuoIQ39ZdKgJRfmEv
 ajQr6t9GBKbsJfg3E6uaKUd7SiirX4Rrumq71xVPa4EoFUHBLrfCq0Qr4S/IC006fOIM
 otZa9Ueg4x7mnTzZNcy8mpIhlBGzgk8HB6oAG/ZU/+4/BOYI0aWByf+eIG9ckagMfHjt
 jRdSGACCgiwb6PqiUH/SAIfYJyeZSvKEDICo8/QO19N7wvMdEAQnr9OFwKRa4rc1/top
 NMzQ==
X-Received: by 10.152.120.66 with SMTP id la2mr2731582lab.62.1388132139496;
 Fri, 27 Dec 2013 00:15:39 -0800 (PST)
Received: from leviafan (128-70-204-126.broadband.corbina.ru. [128.70.204.126])
 by mx.google.com with ESMTPSA id tc8sm20487567lbb.9.2013.12.27.00.15.37
 for <16266 <at> debbugs.gnu.org>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 27 Dec 2013 00:15:38 -0800 (PST)
From: Alex Kost <alezost@HIDDEN>
To: 16266 <at> debbugs.gnu.org
Subject: Re: bug#16266: 24.3;
 `load-theme' prevents immediate setting of themed variables
References: <87d2kiahne.fsf@HIDDEN>
Date: Fri, 27 Dec 2013 12:15:36 +0400
In-Reply-To: <87d2kiahne.fsf@HIDDEN> (Alex Kost's message of "Fri, 27 Dec
 2013 11:15:49 +0400")
Message-ID: <8761qaaevr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 16266
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--=-=-=
Content-Type: text/plain

I've written a micro-theme to show the bug in action and to show why NOW
arg is vital.  The following can be tested with "emacs -Q".

1. Put "test-bug-theme.el" (attached) in `custom-theme-directory' (or
another dir from `custom-theme-load-path')

2. M-x load-theme RET test-bug RET

After that `test-var1' and `test-var2' are still void (because
`custom--inhibit-theme-enable' is set to T in `load-theme').

3. Evaluate these 2 expressions:

    (defcustom test-var1 "red" "some doc")
    (defvar test-var2 "red")

`test-var1' is "blue" now and `test-var2' is "red".  That's why NOW is
so necessary: a theme can set an undefined variable which will be
defined with `defvar' only using NOW arg.

--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=test-bug-theme.el
Content-Transfer-Encoding: quoted-printable

(deftheme test-bug)

(custom-theme-set-variables
 'test-bug
 '(test-var1 "blue" t)
 '(test-var2 "blue" t))

(provide-theme 'test-bug)

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#16266; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Dec 2013 07:16:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 27 02:16:13 2013
Received: from localhost ([127.0.0.1]:45227 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VwReW-0002oj-IE
	for submit <at> debbugs.gnu.org; Fri, 27 Dec 2013 02:16:13 -0500
Received: from eggs.gnu.org ([208.118.235.92]:51223)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <alezost@HIDDEN>) id 1VwReU-0002oX-NJ
 for submit <at> debbugs.gnu.org; Fri, 27 Dec 2013 02:16:11 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <alezost@HIDDEN>) id 1VwReP-0006xy-1v
 for submit <at> debbugs.gnu.org; Fri, 27 Dec 2013 02:16:10 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:33201)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <alezost@HIDDEN>) id 1VwReO-0006xu-Vw
 for submit <at> debbugs.gnu.org; Fri, 27 Dec 2013 02:16:05 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52936)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <alezost@HIDDEN>) id 1VwReJ-00020U-Kc
 for bug-gnu-emacs@HIDDEN; Fri, 27 Dec 2013 02:16:04 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <alezost@HIDDEN>) id 1VwReE-0006xI-9G
 for bug-gnu-emacs@HIDDEN; Fri, 27 Dec 2013 02:15:59 -0500
Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:50356)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <alezost@HIDDEN>) id 1VwReE-0006xC-1G
 for bug-gnu-emacs@HIDDEN; Fri, 27 Dec 2013 02:15:54 -0500
Received: by mail-la0-f44.google.com with SMTP id ep20so4140063lab.3
 for <bug-gnu-emacs@HIDDEN>; Thu, 26 Dec 2013 23:15:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:subject:date:message-id:user-agent:mime-version
 :content-type; bh=LaHFmgXJCDTJ/GCsK5iWqf+2D3u4FYqs1w7Z8xn0xig=;
 b=KhMtdQu9MaxTiioFEUCKcR7KMyA+puxpFa4I0muuhEg70Cvt1vizLEfbMSDAJ1mEL0
 PpTaF5xGpGVD1VC0H/aBYOo+QqDzJbbZcv96YgAC1IVRJhrALSIirYKIH6cKnrrBS9/U
 s2S4RJGebfPVU74b89O7sfE87QrRm3WXM95+DSjqkyiUGJt5IC0GRcueOqnSzUchLbZA
 eGYRygHOnrd9vb055U4xyexVBNfpG+JPbRYVx71W1q7KejhxPNxCVcq/A9MC0VTfN2kc
 L71lLbBnfoDoW1DUG1g5CjdNRz2jeY2fj8kOxbNBGeCkcAe0uocDBLwYZh6ubNoxND7q
 aIaQ==
X-Received: by 10.112.204.233 with SMTP id lb9mr298698lbc.87.1388128552379;
 Thu, 26 Dec 2013 23:15:52 -0800 (PST)
Received: from leviafan (128-70-204-126.broadband.corbina.ru. [128.70.204.126])
 by mx.google.com with ESMTPSA id c15sm20373116lbq.11.2013.12.26.23.15.51
 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 26 Dec 2013 23:15:51 -0800 (PST)
From: Alex Kost <alezost@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.3; `load-theme' prevents immediate setting of themed variables
Date: Fri, 27 Dec 2013 11:15:49 +0400
Message-ID: <87d2kiahne.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Specifying optional arguments (NOW, REQUEST, COMMENT) for ARGS of
`custom-theme-set-variables' doesn't take effect.

`load-theme' function has this piece:

	(let ((custom--inhibit-theme-enable t)  ;;; why this is here?
              (buffer-file-name fn))    ;For load-history.
	  (eval-buffer))

Because of that, a big piece of `custom-theme-set-variables' function is
never evaluated:

      (unless custom--inhibit-theme-enable      ;;; this var is always T
	;; Now set the variable.
	(let* ((now (nth 2 entry))
	       (requests (nth 3 entry))
	       (comment (nth 4 entry))
	       set)
          ...
          ))

I found a very similar letter to emacs.devel mailing list:
<http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00473.html>.

As far as I can see, this bug is in 24.3.50 as well.


In GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.8.2)
 of 2013-08-07 on -mnt-storage-buildroots-staging-i686-eric





Acknowledgement sent to Alex Kost <alezost@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#16266; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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