Skip to content

Instantly share code, notes, and snippets.

@joostkremers
Created May 11, 2013 23:18
Show Gist options
  • Select an option

  • Save joostkremers/5561773 to your computer and use it in GitHub Desktop.

Select an option

Save joostkremers/5561773 to your computer and use it in GitHub Desktop.
Emacs lisp code to run pandoc on each buffer where pandoc-mode is activated.
(defun pandoc-process-all-buffers (prefix)
"Run pandoc on all buffers with pandoc-mode enabled."
(interactive "P")
(let ((buffers (buffer-list)))
(mapc #'(lambda (buffer)
(set-buffer buffer)
(when pandoc-mode
(when (or (and prefix (y-or-n-p (format "Process buffer `%s' with pandoc? (y/n)" (buffer-name buffer))))
(not prefix))
(pandoc-run-pandoc nil))))
buffers)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment