summaryrefslogtreecommitdiff
path: root/modules/emacs/org.nix
diff options
context:
space:
mode:
authorLeonardo Santiago <[email protected]>2024-03-14 16:02:18 -0300
committerLeonardo Santiago <[email protected]>2024-03-14 16:02:18 -0300
commit1ff39bc2cff34cb4aef22785d0d70bbc90efa3f5 (patch)
tree911d6570ccb3918f2839ef87dd633c91ed346874 /modules/emacs/org.nix
first commit
Diffstat (limited to 'modules/emacs/org.nix')
-rw-r--r--modules/emacs/org.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/emacs/org.nix b/modules/emacs/org.nix
new file mode 100644
index 0000000..e5fd15c
--- /dev/null
+++ b/modules/emacs/org.nix
@@ -0,0 +1,11 @@
+{ pkgs, from-elisp }: {
+ org-tangle = block-predicate: text:
+ let blocks = (pkgs.callPackage from-elisp { inherit pkgs; }).parseOrgModeBabel text;
+ block-to-str = (block:
+ if block-predicate { inherit (block) language flags; } then
+ block.body
+ else
+ ""
+ );
+ in builtins.concatStringsSep "\n" (map block-to-str blocks);
+}