init
This commit is contained in:
commit
a870d79674
8 changed files with 604 additions and 0 deletions
18
lua/orgmode-babel/tangle_by_name.el
Normal file
18
lua/orgmode-babel/tangle_by_name.el
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
(defun tangle-block-by-name (block-name)
|
||||
"Tangle the org-babel code block with name BLOCK-NAME."
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward (format "#\\+NAME: %s" block-name) nil t)
|
||||
(if (org-babel-get-src-block-info)
|
||||
(org-babel-tangle-collect-block)))))
|
||||
|
||||
|
||||
(setq org-confirm-babel-evaluate nil)
|
||||
(find-file (nth 0 command-line-args-left))
|
||||
|
||||
(dolist (block-name (nthcdr 1 command-line-args-left))
|
||||
(tangle-block-by-name block-name))
|
||||
|
||||
(save-buffer)
|
||||
(save-buffers-kill-emacs)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue