From 174d7af82f0e7455d6ef14f85d7f508b5ce212fa Mon Sep 17 00:00:00 2001 From: Leo Gaskin Date: Fri, 23 Feb 2024 12:29:26 +0100 Subject: [PATCH] Ensure `package-lint-main-file' always is a safe local variable Closes #22 --- elisp-check.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/elisp-check.el b/elisp-check.el index e45cc2d..a2b03b2 100644 --- a/elisp-check.el +++ b/elisp-check.el @@ -151,6 +151,12 @@ search it for further `require' statements." (cons (current-buffer) known-buffers))))) (delete-dups (apply #'append (mapcar fun requires))))) +;; Ensure `package-lint-main-file' is always respected as a file-local +;; variable, even if has not been loaded. This is necessary because +;; Emacs will only apply safe local variables in batch mode. + +(put 'package-lint-main-file 'safe-local-variable #'stringp) + (defun elisp-check--get-require (name prefix &optional known-buffers) "Return required buffers for file with package NAME.