I have been trying to make auto-save compilation rules for my org
files.
I have tested the following functions in the interpreter:
(defun async-shell-command-no-window (command)
(interactive)
(let ((display-buffer-alist
(list
(cons
"\\*Async Shell Command\\*.*"
(cons #'display-buffer-no-window nil)))))
(async-shell-command
command)))
(defun haozeke/org-pandoc-markdown (dir &optional pargs)
"A wrapper to generate yaml metadata markdown files. Takes the output
directory followed by pandoc arguments"
(if (not (file-exists-p dir)) (make-directory dir))
(async-shell-command-no-window
(concat "pandoc -f org -t markdown -s " pargs " " (buffer-name) " -o "
dir "/" (file-name-sans-extension (buffer-name)) ".md")))
(haozeke/org-pandoc-markdown "./")
Where the first function has been adapted from this question.
The error I get is:
run-hooks: Wrong number of arguments: (lambda (dir &optional pargs) "A wrapper to generate yaml metadata markdown files. Takes the output
directory followed by pandoc arguments" (if (not (file-exists-p dir)) (make-directory dir)) (async-shell-command-no-window (concat "pandoc -f org -t markdown -s " pargs " " (buffer-name) " -o " dir ".md"))), 0
The local variable setup I have is:
# Local Variables:
# after-save-hook: haozeke/org-pandoc-markdown "test"
# End: