From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Lint multiple files at once Date: Wed, 11 Oct 2017 21:48:59 -0400 Message-ID: <87shep9lv8.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2Scr-0007gF-Ou for emacs-orgmode@gnu.org; Wed, 11 Oct 2017 21:49:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2Sco-0002RW-My for emacs-orgmode@gnu.org; Wed, 11 Oct 2017 21:49:29 -0400 Received: from [195.159.176.226] (port=59752 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2Sco-0002Qv-CB for emacs-orgmode@gnu.org; Wed, 11 Oct 2017 21:49:26 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e2ScR-0000Pl-EU for emacs-orgmode@gnu.org; Thu, 12 Oct 2017 03:49:03 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Luciano Passuello writes: > Hello all, > > I love org-lint, but I couldn't find an easy way to get a report on > multiple files. > I'd like to analyze all files in a folder, getting all problems found > using a single command. > > Any suggestions? > Here's one way: --8<---------------cut here---------------start------------->8--- (defun org-lint-dir (directory) (let* ((files (directory-files directory t ".*\\.org$"))) (org-lint-list files))) (defun org-lint-list (files) (cond (files (org-lint-file (car files)) (org-lint-list (cdr files))))) (defun org-lint-file (file) (let ((buf) (lint)) (setq buf (find-file-noselect file)) (with-current-buffer buf (if (setq lint (org-lint)) (print (list file lint)))))) (org-lint-dir "/home/nick/lib/org") --8<---------------cut here---------------end--------------->8--- -- Nick