From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Cochran Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Make byte-compile-error-on-warn a safe variable for file compilation Date: Tue, 09 Jan 2018 22:28:18 -0800 Message-ID: <87zi5mcjnh.fsf@cochranmail.com> References: <87wp0yhsgu.fsf@cochranmail.com> <87vaggrfqo.fsf@cochranmail.com> <87r2r2txqp.fsf@cochranmail.com> <87373fpujo.fsf@cochranmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1515565734 29408 195.159.176.226 (10 Jan 2018 06:28:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 10 Jan 2018 06:28:54 +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 Wed Jan 10 07:28:49 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 1eZ9sW-00076a-H0 for ged-emacs-devel@m.gmane.org; Wed, 10 Jan 2018 07:28:48 +0100 Original-Received: from localhost ([::1]:48135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZ9uU-0007L3-2k for ged-emacs-devel@m.gmane.org; Wed, 10 Jan 2018 01:30:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZ9tl-0007Kj-J2 for emacs-devel@gnu.org; Wed, 10 Jan 2018 01:30:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZ9ti-0004CI-Ex for emacs-devel@gnu.org; Wed, 10 Jan 2018 01:30:05 -0500 Original-Received: from vps28183.inmotionhosting.com ([23.235.221.66]:32633) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZ9ti-0003jU-4E for emacs-devel@gnu.org; Wed, 10 Jan 2018 01:30:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cochranmail.com; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=255JpJ4GSsHV0xUVW2yVc46apgTKH2Mro3GYNa2RQc0=; b=rAEwyfr16aL/TW+K93L/CNB8l EY5gmnRDh3TsAOSOY9tZaxKpLCXzMcb1D1EcFYUb/twLAJ8De8B2zzJy7odaLVAJsTFnmZTkZPtBS 95gmuCxWG90HC7K0EEQPn3/d4rWvQThzWj+9px8RShPyVrKuOxUST3fAlbqq1jJN4m5azFVWdfAxt p7lul9PezvqrDzGYvcZyVyUqmKHxkW3QrNVl4lhICjgZtuYEH7Ki6YXCe7gqqvXdKQKihkWlGzZm+ PKCcz7wyDB4VEz3vq3l5XUttkyrkgmsk368IuAE1JpvUHa49YtEXOAompyjsgN8Yl+Yujumwu0OSj oY0c78uGg==; Original-Received: from 131-191-86-130.as.clicknet.org ([131.191.86.130]:59966 helo=SoraLaptop) by vps28183.inmotionhosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1eZ9t0-00046e-OX; Tue, 09 Jan 2018 22:29:18 -0800 In-Reply-To: (Stefan Monnier's message of "Tue, 09 Jan 2018 08:24:35 -0500") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps28183.inmotionhosting.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - cochranmail.com X-Get-Message-Sender-Via: vps28183.inmotionhosting.com: authenticated_id: robert@cochranmail.com X-Authenticated-Sender: vps28183.inmotionhosting.com: robert@cochranmail.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 23.235.221.66 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:221775 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier writes: > That's because the var and its safety predicate are only known once the > bytecompiler is loaded, so if you iopen the file in a session where the > bytecompiler has not yet been loaded Emacs won't know about the > safety predicate. Huh. I would have guessed that the byte compiler would have been loaded automatically myself, but I suppose I can see why it wouldn't be. > For this reason the `:safe` arg of defcustom is often not useful. > Instead, you want to use the `(put ...)` form with a `;;;###autoload` > cookie in front of it, so that the safety predicate is preloaded. > Yeah, I noticed I forgot the autoload cookie, so I knew I had to do it over again anyways. Thus, new (and hopefully) final version of the patch. Please let me know if I need to do anything else. Thanks, -- ~Robert Cochran GPG Fingerprint - BD0C 5F8B 381C 64F0 F3CE E7B9 EC9A 872C 41B2 77C2 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Make-byte-compile-error-on-warn-a-safe-variable-for-.patch Content-Description: Patch to mark byte-compile-error-on-warn as a safe file local variable >From f7e5bc29caafba09766ec17853f6c6561d96434f Mon Sep 17 00:00:00 2001 From: Robert Cochran Date: Sat, 6 Jan 2018 13:19:55 -0800 Subject: [PATCH] Make byte-compile-error-on-warn a safe variable for file compilation This allows individual files to easily specify whether or not byte compilation should error on encountering warnings, ala -Werror from GCC. * lisp/emacs-lisp/bytecomp.el (byte-compile-error-on-warn): Mark as a safe local variable. --- lisp/emacs-lisp/bytecomp.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 2f5f9f8c05..a481b41aa5 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -295,6 +295,7 @@ byte-compile-error-on-warn "If true, the byte-compiler reports warnings with `error'." :group 'bytecomp :type 'boolean) +;;;###autoload(put 'byte-compile-error-on-warn 'safe-local-variable 'booleanp) (defconst byte-compile-warning-types '(redefine callargs free-vars unresolved -- 2.14.3 --=-=-=--