aboutsummaryrefslogtreecommitdiff
path: root/doom.d/modules/literate.org
diff options
context:
space:
mode:
authorAChavali <aryadevchavali1@gmail.com>2020-02-09 12:37:06 +0000
committerAChavali <aryadevchavali1@gmail.com>2020-02-09 12:37:06 +0000
commit7e887d8af9378ba760d3db88270baa950f6a09ab (patch)
treeca043d498716e01462145131717abc51490a27e6 /doom.d/modules/literate.org
parentcf651fe3752256a8950ecc875ff6556ba9b55f2a (diff)
downloaddotfiles-7e887d8af9378ba760d3db88270baa950f6a09ab.tar.gz
dotfiles-7e887d8af9378ba760d3db88270baa950f6a09ab.tar.bz2
dotfiles-7e887d8af9378ba760d3db88270baa950f6a09ab.zip
~repositioning of documentation around code blocks
Similar to my previous refactoring, I am just repositioning some documentation around the code blocks to be at the start rather than the end. This is for the literate system particularly
Diffstat (limited to 'doom.d/modules/literate.org')
-rw-r--r--doom.d/modules/literate.org16
1 files changed, 9 insertions, 7 deletions
diff --git a/doom.d/modules/literate.org b/doom.d/modules/literate.org
index 562fb71..cfaeaa4 100644
--- a/doom.d/modules/literate.org
+++ b/doom.d/modules/literate.org
@@ -28,14 +28,14 @@ expanded file names.
* Destination for parser
Generate the destination for a literate config org file to parse to, in this
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.
#+BEGIN_SRC elisp
(defun oreodave/literate/destination(SRC)
"Parse a src.org file to a bin/src.el file"
(replace-regexp-in-string ".*/\\(\\w+\\).org"
(expand-file-name (concat oreodave/literate/bin-dir "\\1.el")) SRC))
#+END_SRC
-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.
* Parser
First we need to get some sort of parser which can, given a source org file and
a destination, parse and produce an Emacs lisp file. We'll copy this from the
@@ -80,6 +80,9 @@ literate contents.
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.
+The location is not set because this function could be easily programmed to use
+multiple /differing/ sources to produce the config. The tangle function is set
+because this is the function we'll be using for tangling all org files to ELisp files.
#+BEGIN_SRC elisp
(defun oreodave/literate/tangle-all (&optional location)
"Tangle all org files in `location' to el files in the `destination'"
@@ -91,15 +94,14 @@ directory contribute to the config.
(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.
* Load configuration
Final step of the literate cycle: load the config for the first time.
+Remove the config.el and literate.el files from the load list because:
+1) config.org is preloaded by doom
+2) literate.org is loaded by config.org, thus no need to reload it
+
#+BEGIN_SRC elisp
(let ((files (directory-files-recursively "~/.doom.d/" ".org"))) ; Load
(dolist (file (oreodave/literate/remove-mult oreodave/literate/preloaded-files files))
(load (oreodave/literate/destination file))))
#+END_SRC
-Remove the config.el and literate.el files from the load list because:
-1) config.org is preloaded by doom
-2) literate.org is loaded by config.org, thus no need to reload it