emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Lint multiple files at once


From: Nick Dokos
Subject: Re: [O] Lint multiple files at once
Date: Wed, 11 Oct 2017 21:48:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Luciano Passuello <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]