[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Make byte-compile-error-on-warn a safe variable for file com
From: |
Robert Cochran |
Subject: |
Re: [PATCH] Make byte-compile-error-on-warn a safe variable for file compilation |
Date: |
Mon, 12 Feb 2018 20:49:40 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
[ Sending this again... Internet was acting up at the time, and it seems
like Gnus didn't do the resend properly... ]
Eli Zaretskii <address@hidden> writes:
> I asked for a comment near the autoload explaining why we use the
> autoload cookie instead of the usual way of marking variables safe.
Right. Misremembered where exactly you wanted the note.
At any rate, I did add a comment note above the autoload. New patch
attached.
Thanks,
--
~Robert Cochran
GPG Fingerprint - BD0C 5F8B 381C 64F0 F3CE E7B9 EC9A 872C 41B2 77C2
>From af8f27a1d393847136a5b2932d86f28c525321a8 Mon Sep 17 00:00:00 2001
From: Robert Cochran <address@hidden>
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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 2f5f9f8c05..6db3617c04 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -295,6 +295,11 @@ byte-compile-error-on-warn
"If true, the byte-compiler reports warnings with `error'."
:group 'bytecomp
:type 'boolean)
+;; This needs to be autoloaded because it needs to be available to
+;; Emacs before the byte compiler is loaded, otherwise Emacs will not
+;; know that this variable is marked as safe until it is too late.
+;; (See https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00261.html )
+;;;###autoload(put 'byte-compile-error-on-warn 'safe-local-variable 'booleanp)
(defconst byte-compile-warning-types
'(redefine callargs free-vars unresolved
--
2.14.3