From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Lint multiple files at once
Date: Wed, 11 Oct 2017 21:48:59 -0400 [thread overview]
Message-ID: <87shep9lv8.fsf@alphaville.usersys.redhat.com> (raw)
In-Reply-To: CACqKfLdR2mSN1CF4pH2Ns0Hb5vgoZSifbBpf-G1VWymLPn=NCQ@mail.gmail.com
Luciano Passuello <lucianop@litemind.com> 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
next prev parent reply other threads:[~2017-10-12 1:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 22:12 Lint multiple files at once Luciano Passuello
2017-10-12 1:48 ` Nick Dokos [this message]
2017-10-12 21:00 ` Luciano Passuello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87shep9lv8.fsf@alphaville.usersys.redhat.com \
--to=ndokos@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).