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: Thu, 04 Jan 2018 22:17:51 -0800 Message-ID: <87vaggrfqo.fsf@cochranmail.com> References: <87wp0yhsgu.fsf@cochranmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1515133010 27717 195.159.176.226 (5 Jan 2018 06:16:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 5 Jan 2018 06:16:50 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 05 07:16:46 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 1eXLJ7-0006sO-I9 for ged-emacs-devel@m.gmane.org; Fri, 05 Jan 2018 07:16:45 +0100 Original-Received: from localhost ([::1]:49325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXLL6-0004nl-Pj for ged-emacs-devel@m.gmane.org; Fri, 05 Jan 2018 01:18:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXLKL-0004j1-PG for emacs-devel@gnu.org; Fri, 05 Jan 2018 01:18:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXLKI-0002AH-He for emacs-devel@gnu.org; Fri, 05 Jan 2018 01:18:01 -0500 Original-Received: from vps28183.inmotionhosting.com ([23.235.221.66]:48829) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eXLKI-000294-9D for emacs-devel@gnu.org; Fri, 05 Jan 2018 01:17:58 -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=SSlEZRyqkCC0y4rV2/66VYwa6+uELsfhsPfDUI2iZvk=; b=el7in9v4h1Cc/9BcLsswCvYSG 2/+hH9SMLuygMP0dIetfQXoVQ/XfGllXenkhloCF6fZeaumb4uDR+3QayaLx3q+yOcXYAwd3psH9J R6I8sWYko9/p+QyCagzsnu1oU/0QBS8N1HJUVgD6hcS3OEhUfMBjWpDz7KCi9SPdpn3S+1AP2TQiJ VZb7w8uNXKDAoANz8qWkVUfgqmKmouwsnpmwCjn0umJkEWHqGEx0HCZuAB/XwV368ie628S4ymda5 zktK5hXo9HBv3ierpu+5mteqKWDvMyoy7H8LrTHVBSP/yMh2NaI/P1OOwDKcJJnN0GGPKqGMiZkXz 1DpRuwz9g==; Original-Received: from 131-191-86-130.as.clicknet.org ([131.191.86.130]:59686 helo=SoraLaptop) by vps28183.inmotionhosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1eXLKG-0006pj-O1; Thu, 04 Jan 2018 22:17:56 -0800 In-Reply-To: (Noam Postavsky's message of "Thu, 4 Jan 2018 08:22:12 -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:221608 Archived-At: Noam Postavsky writes: > On Thu, Jan 4, 2018 at 4:40 AM, Robert Cochran > wrote: > >> Attached is a patch that adds the variable `byte-compile-error-on-warn' >> to the safe variable list temporarily during calls to >> `byte-compile-file`, so that individual files can easily and simply >> include "byte-compile-error-on-warn: t" in their file local variables. > > Wouldn't it be simpler and clearer to make it permanently safe? (PS > you can use #'booleanp instead of listing t and nil). I somehow came to the conclusion that the way I did it was the simplest and cleanest to me. I noticed that `safe-local-variable-values' is nil by default and I took that as a hint (rightly or wrongly) to not touch the value directly. I was also aiming to prevent easily tampering with the variable, again, however right or wrong that particular decision seems to you. On that topic, since `safe-local-variable-values' is nil by default, where is it exactly that you would recommend I add this variable? A few quick greps didn't give me any clear ideas. Thanks for your suggestion about using #'booleanp, btw. > >> For example, something that is bothering me right now >> is that there are quite a few 'foo is obsolete' warnings during the byte >> compilation portion of the build phase. Enabling error on warning means >> that trying to byte compile files that reference stale >> functions/variables/what have you will fail, prompting patches that >> obsolete Lisp objects to also fix usage of it in the core with the >> appropriate recommended replacement. > > Solving Bug#4837 would be helpful for this, as currently there is no > practical way to fix/suppress the obsolete warnings in the code that > remains to support the obsolete option. > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=4837 Yeah, I was thinking about that. In private discussion with friends, it was mentioned that it could be a `declare' option - something like (declare no-warn-obsolete) - but that's not very satifying for anything other than defuns. This is why I was wanting the file local variables. It can be turned on slowly as warnings are fixed, in a similar vein to lexical-bindings. Even if we find that there are a few files where it can't be enabled, it can at least be enabled on the vast majority of them. My $0.02 of course. Thanks, -- ~Robert Cochran GPG Fingerprint - BD0C 5F8B 381C 64F0 F3CE E7B9 EC9A 872C 41B2 77C2