From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: Why is custom--inhibit-theme-enable not t by default? Date: Mon, 18 Jun 2018 15:07:53 +0100 Message-ID: References: <10b7bd657091b074d8da1bf1ae35b1f4.squirrel@dancol.org> <83h8m8owp2.fsf@gnu.org> <48a7bd1277a18dd0a68d06cd8b022062.squirrel@dancol.org> <86vaahgkvz.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529330802 20219 195.159.176.226 (18 Jun 2018 14:06:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Jun 2018 14:06:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) Cc: dancol@dancol.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 18 16:06:37 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUunl-00058g-LV for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2018 16:06:37 +0200 Original-Received: from localhost ([::1]:34954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUups-0000Vb-Ir for ged-emacs-devel@m.gmane.org; Mon, 18 Jun 2018 10:08:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUupD-0000VV-Co for emacs-devel@gnu.org; Mon, 18 Jun 2018 10:08:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUup8-0008W3-DM for emacs-devel@gnu.org; Mon, 18 Jun 2018 10:08:07 -0400 Original-Received: from [195.159.176.226] (port=51843 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUup8-0008VW-66 for emacs-devel@gnu.org; Mon, 18 Jun 2018 10:08:02 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fUumz-0004FT-2F for emacs-devel@gnu.org; Mon, 18 Jun 2018 16:05:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 59 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:FUMMg1YelIk9k9aCRGWpKw0wAkw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226453 Archived-At: On Sun 17 Jun 2018, Andy Moreton wrote: > On Tue 12 Jun 2018, dancol@dancol.org wrote: > >>>> Date: Mon, 11 Jun 2018 21:14:49 -0700 >>>> From: dancol@dancol.org >>>> >>>> A simple require of a package shouldn't have side effects, especially >>>> not >>>> ones as drastic as changing the entire appearance of the program. >>> >>> I think themes are special in this regard: loading a theme activates >>> it. >>> >> >> Why did we do it that way? Is it too late to change it? Loading _anything_ >> shouldn't activate it. I don't see a need to carve out a special case for >> themes. >> >> At the very least, we should make custom--inhibit-theme-enable a public >> variable so people can let-binding something that lets them load theme >> code normally without the expectation of serious side effects. > > The changes you made in commit aabaa9f8c8b7 ("Apply non-user themes only > when asked") break use of custom faces with use-package. E.g. in gnus: > > (use-package gnus > :custom-face > (gnus-summary-selected > ((((class color)) :foreground "Black" :background "PaleGoldenrod"))) > :config > ;; other setup > ) > > The observed symptom is that the faces are not set correctly as specified > after the :custom-face keyword. However if the same buffer is viewed in > a new frame then it is displayed with the correct customised faces. > > This is a regression introduced by this commit - please take a look. It appears that the change in cus-face.el in commit aabaa9f8c8b7 did not match the other hunks and invert the test when changing from `custom--inhibit-theme-enable' to `custom--should-apply-setting'. The following patch fixes it: diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 039c1fafa7..54f5d51358 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -342,7 +342,7 @@ custom-theme-set-faces ;; is aliased to. (if (get face 'face-alias) (setq face (get face 'face-alias))) - (if (custom--should-apply-setting theme) + (if (not (custom--should-apply-setting theme)) ;; Just update theme settings. (custom-push-theme 'theme-face face theme 'set spec) ;; Update theme settings and set the face spec.