From 9a7bce6241f5fc9ed982e95084641f3021314829 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 12 Dec 2020 14:13:32 +0100 Subject: [PATCH] Make elint load `require'd packages * lisp/emacs-lisp/elint.el (elint-require-form): New function to load files that are `require'd (bug#27006). (elint-special-forms): Add function. --- lisp/emacs-lisp/elint.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index ef97c8279d7..79b72ff969f 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -558,7 +558,8 @@ Return nil if there are no more forms, t otherwise." (when . elint-check-conditional-form) (unless . elint-check-conditional-form) (and . elint-check-conditional-form) - (or . elint-check-conditional-form)) + (or . elint-check-conditional-form) + (require . elint-require-form)) "Functions to call when some special form should be linted.") (defun elint-form (form env &optional nohandler) @@ -953,6 +954,13 @@ Does basic handling of `featurep' tests." (elint-form form env t)))) env) +(defun elint-require-form (form _env) + "Load `require'd files." + (pcase form + (`(require ',x) + (require x))) + nil) + ;;; ;;; Message functions ;;; -- 2.39.2