From abfb93bb3779799a773ffc4def4cd8bfb2c83d62 Mon Sep 17 00:00:00 2001 From: AChavali Date: Mon, 30 Dec 2019 23:29:11 +0000 Subject: ~tangle-all takes a location to source files from Instead of being attached to the doom.d private config set, I can use this function to route to another directory if wished --- doom.d/modules/literate.org | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'doom.d') diff --git a/doom.d/modules/literate.org b/doom.d/modules/literate.org index dba59b0..59ab9cf 100644 --- a/doom.d/modules/literate.org +++ b/doom.d/modules/literate.org @@ -53,18 +53,20 @@ case the bin folder in the private directory This is not fitted onto the parser because the parser could be fitted to multiple /differing/ outputs easily if it isn't specified a destination. * Procedure for all files -We need a procedure that parses all the org files in the doom-private-dir and -modules directory into Emacs lisp files, using the parser function we've made. -Assume all org files in the private directory contribute to the config. +A procedure that parses all the org files in a given directory into Emacs lisp +files, using the parser function made. Assume all org files in the "location" +directory contribute to the config. #+BEGIN_SRC elisp -(defun oreodave/literate/tangle-all () +(defun oreodave/literate/tangle-all (location) (interactive) (message "Starting compilation process") - (let ((files (directory-files-recursively "~/.doom.d/" ".org"))) + (let ((files (directory-files-recursively location ".org"))) (dolist (file files) (message "Compiling and parsing %s" file) (oreodave/literate/tangle file (oreodave/literate/destination file))))) #+END_SRC +The location is not set because this function could be easily programmed to use +multiple /differing/ sources to produce the config. * Hook on save Now we need to make a hook that, when the current buffer is an org file in the doom directory, will run the literate config procedure from above. -- cgit v1.2.3-13-gbd6f