diff --git a/global.org b/global.org index 3597782..ffab73b 100644 --- a/global.org +++ b/global.org @@ -885,6 +885,19 @@ (cl-letf (((symbol-function 'delete-file) #'ignore)) (org-babel-tangle '(4) filename))) #+END_SRC +*** Tangle file + This can be used to tangle one or more files to their output files [[https://gitlab.com/to1ne/literate-dotfiles/blob/master/elisp/tangle.el][ + Source on gitlab]] + #+BEGIN_SRC emacs-lisp + (defun tangle-file(&rest files) + "Tangle FILES or all files in the project." + (when (null files) + (setq files command-line-args-left)) + (dolist (file files) + (with-current-buffer (find-file-noselect file) + (org-babel-tangle) + (kill-buffer)))) + #+END_SRC ** elisp *** Paredit #+BEGIN_SRC emacs-lisp