From d36eccbc8fe6c1737c02a11dce1d845b3e3e5211 Mon Sep 17 00:00:00 2001 From: Robert Cochran Date: Thu, 4 Jan 2018 01:09:50 -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-file): Make `byte-compiler-error-on-warn' a safe local variable for file compliation. --- 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..3c43ab21a5 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1874,6 +1874,11 @@ byte-compile-file ;; If they change the file name, then change it for the output also. (let ((buffer-file-name filename) (dmm (default-value 'major-mode)) + ;; Ensure that byte-compile-error-on-warn is recognized as + ;; safe, even if it's not in safe-local-variable-values. + (safe-local-variable-values (append (list '(byte-compile-error-on-warn . t) + '(byte-compile-error-on-warn . nil)) + safe-local-variable-values)) ;; Ignore unsafe local variables. ;; We only care about a few of them for our purposes. (enable-local-variables :safe) -- 2.14.3