From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: Byte-compilation of custom themes Date: Thu, 01 Feb 2018 00:45:54 +0000 Message-ID: <87po5po7ul.fsf@tcd.ie> References: <87efmk2qk0.fsf@tcd.ie> <87vafjhu04.fsf@tcd.ie> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1517445877 19107 195.159.176.226 (1 Feb 2018 00:44:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Feb 2018 00:44:37 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 01 01:44:33 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 1eh2z2-0003Ag-Kk for ged-emacs-devel@m.gmane.org; Thu, 01 Feb 2018 01:44:08 +0100 Original-Received: from localhost ([::1]:44509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eh313-0005ZP-M3 for ged-emacs-devel@m.gmane.org; Wed, 31 Jan 2018 19:46:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eh30u-0005Ys-Sy for emacs-devel@gnu.org; Wed, 31 Jan 2018 19:46:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eh30t-0003mj-OB for emacs-devel@gnu.org; Wed, 31 Jan 2018 19:46:04 -0500 Original-Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:40249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eh30t-0003lj-FT for emacs-devel@gnu.org; Wed, 31 Jan 2018 19:46:03 -0500 Original-Received: by mail-wm0-x22d.google.com with SMTP id v123so2450208wmd.5 for ; Wed, 31 Jan 2018 16:46:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=R+Pn2AwuFkaVU5oSLDhAUeXHD4KrfgxmGTmSPehr1Qs=; b=oAO6YCYtpK5knqJpFng2Eqp5wixlXKJhzW6QMtLPOOIpA4vg0vQg3prpvKF7rWhoiu 3MOHE6ustJbSnwMreARTzB/apaoX/vcNLYRoVkcowFR1iZL8TQjQTIQz6Ft5ztuaeLNT FDWCPwLrnktpolP97j1UvFn4RW9HyVuawtnU3Emz7Y4lPZodpq7SdQ1+0X+ni4AZduer vP2900FJrm7Tb+oGxqnhxbZps3qqHxl69yod9VREJqqJsrv8ymmIxGT0Jabm2Juodof2 88tFcd3ko3n+GFYPE0n3m1Zs3UXIc98anA+3uBVk6c5C938u0ih4fPojOTm3mVJ5pNJF NJUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=R+Pn2AwuFkaVU5oSLDhAUeXHD4KrfgxmGTmSPehr1Qs=; b=hpcUObVZPyqg+pX8BQxo/mm0YFc/kDO75zKm3TVzMXyXVdg9cRt+sTM+2PuCQZLxQr dDdnrlItNfQqoQQq52Cp95zTj7eByevjkVwJ/b9nUaWmo4KvJLxAwC5sq7whDVbOTVOL 3XUXoRcgPMSoMNIgKAl+4EE4meR3bx7/wFceQ5Nngk/h9JOD7GONLAu8Mu+2Myr2zNYk Ukh63TgJrtcJxgjwwbfz8dRdrHVu9WG0TPMFWjm6IAzkegu16Q74a52n/VD7vy/7ETTx hjlf0yXTPJvqEHSIw/UkVIbiSd+6WYEOvEZfD8857wCpFowZJ2COM2wBbCnJ34dkJ2BE K8TA== X-Gm-Message-State: AKwxyteLeK+sa7xLLOgAkh70eoPjadOoa7rGJ0pnz6shiw1/mbdmHBMX 23fz4GnVJybOZSIWG5JguQCpUQ== X-Google-Smtp-Source: AH8x227yotsCL1Dkg9+unXu3zGy4cXCE5d9StwJjcwTnIv01kuMT6R7WhlJWaa88XGcCptUTR+mScA== X-Received: by 10.80.175.4 with SMTP id g4mr44186383edd.156.1517445961485; Wed, 31 Jan 2018 16:46:01 -0800 (PST) Original-Received: from localhost ([2a02:8084:4f41:8c80:9c34:da08:a010:edfc]) by smtp.gmail.com with ESMTPSA id b12sm9738951eda.81.2018.01.31.16.45.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jan 2018 16:46:00 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Tue, 30 Jan 2018 21:26:37 -0500") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22d 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:222344 Archived-At: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Clarify-byte-compilation-of-Custom-Themes-in-Elisp-m.patch >From 49288975a810d1f2186f656cede92db93ee85c56 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 31 Jan 2018 23:23:49 +0000 Subject: [PATCH] Clarify byte-compilation of "Custom Themes" in Elisp manual * doc/lispref/customize.texi (Custom Themes): Clarify status of byte-compiled custom themes. Suggested in https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00824.html. --- doc/lispref/customize.texi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 6c7ca260ab..7fea507fd0 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -1432,7 +1432,9 @@ Custom Themes would be evaluated when loading the theme, but that is bad form. To protect against loading themes containing malicious code, Emacs displays the source file and asks for confirmation from the user -before loading any non-built-in theme for the first time. +before loading any non-built-in theme for the first time. As +such, themes are not ordinarily byte-compiled, and source files +always take precedence when Emacs is looking for a theme to load. The following functions are useful for programmatically enabling and disabling themes: -- 2.15.1 --=-=-= Content-Type: text/plain Stefan Monnier writes: >> diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi >> index 6c7ca260ab..7fea507fd0 100644 >> --- a/doc/lispref/customize.texi >> +++ b/doc/lispref/customize.texi >> @@ -1432,7 +1432,9 @@ Custom Themes >> would be evaluated when loading the theme, but that is bad form. >> To protect against loading themes containing malicious code, Emacs >> displays the source file and asks for confirmation from the user >> -before loading any non-built-in theme for the first time. >> +before loading any non-built-in theme for the first time. As >> +such, themes are not ordinarily byte-compiled, and source files >> +always take precedence when Emacs is looking for a theme to load. >> >> The following functions are useful for programmatically enabling and >> disabling themes: > > Sounds good to me. I attach a patch with this amendment. If it is up to scratch, would someone please push it? >> Why are built-in themes not exempt to this safety net, though? > > They're not? There is code which tries to exempt them, so if they're > not, it's a bug in that code. Sorry, I should have been clearer. As documented, load-theme indeed exempts built-in themes from the custom-theme-load-confirm check. What I meant to ask is why built-in themes are not byte-compiled in addition to being considered safe. Are there any arguments against doing this, other than any performance gain being negligible? >> Finally, would you care to post your helpful explanation as an answer to >> my Stack Exchange question, or would you rather I paraphrased this >> thread? > > Feel free to post my answer there, Done: https://emacs.stackexchange.com/a/38510/15748. Thanks, -- Basil --=-=-=--