From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luciano Passuello Subject: Re: Lint multiple files at once Date: Thu, 12 Oct 2017 18:00:53 -0300 Message-ID: References: <87shep9lv8.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2kbY-0005fi-GU for emacs-orgmode@gnu.org; Thu, 12 Oct 2017 17:01:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2kbU-0001vs-Lo for emacs-orgmode@gnu.org; Thu, 12 Oct 2017 17:01:20 -0400 Received: from vps2.litemind.com ([192.159.65.166]:59280) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2kbU-0001vV-Gm for emacs-orgmode@gnu.org; Thu, 12 Oct 2017 17:01:16 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:45861) by vps2.litemind.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1e2kbT-0008K9-A8 for emacs-orgmode@gnu.org; Thu, 12 Oct 2017 17:01:15 -0400 Received: by mail-lf0-f48.google.com with SMTP id n69so7346971lfn.2 for ; Thu, 12 Oct 2017 14:01:15 -0700 (PDT) In-Reply-To: <87shep9lv8.fsf@alphaville.usersys.redhat.com> 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: Nick Dokos Cc: emacs-orgmode@gnu.org Hi Nick, Thank you very much, it works! Being an elips newbie, it helped me a lot reading and understanding your code snippet. Next step is beautify the output, and send it to a buffer/file. I'll try to do that myself as a learning exercise. Regards On Wed, Oct 11, 2017 at 10:48 PM, Nick Dokos wrote: > 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 > >