branch: externals/relint commit 5572c5770ceba5b3aff3864a49985cadd32e71d4 Author: Mattias Engdegård <matti...@acm.org> Commit: Mattias Engdegård <matti...@acm.org>
Emacs 26 compatibility: `directory-files-recursively` The PREDICATE argument to `directory-files-recursively` was added in Emacs 27.1; use it conditionally. --- relint.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/relint.el b/relint.el index 81d46be..10f5d74 100644 --- a/relint.el +++ b/relint.el @@ -2391,10 +2391,13 @@ TARGET is the file or directory to use for a repeated run." (cons total-errors total-suppressed))) (defun relint--tree-files (dir) - (directory-files-recursively - dir (rx bos (not (any ".")) (* anything) ".el" eos) nil - ;; Save time by not pointlessly descending into huge .git directories. - (lambda (s) (not (string-suffix-p "/.git" s))))) + (let ((re (rx bos (not (any ".")) (* anything) ".el" eos))) + (if (>= emacs-major-version 27) + (directory-files-recursively + dir re nil + ;; Save time by not pointlessly descending into huge .git directories. + (lambda (s) (not (string-suffix-p "/.git" s)))) + (directory-files-recursively dir re)))) (defun relint--scan-buffer (buffer) "Scan BUFFER; return (COMPLAINTS . SUPPRESSED) where