Added diff for babel tangle
This commit is contained in:
parent
487e056acc
commit
8bfbfe48db
9
emacs/org/+babel-diff.el
Normal file
9
emacs/org/+babel-diff.el
Normal file
|
@ -0,0 +1,9 @@
|
|||
(defun org-babel-execute:diff (body params)
|
||||
"Applies diff patches. Use with care.
|
||||
See https://emacs.stackexchange.com/questions/63517/org-mode-evaluate-diff-code-block"
|
||||
(with-temp-buffer
|
||||
(insert body "\n")
|
||||
(shell-command-on-region (point-min) (point-max) "patch --strip=1" "*patch*")
|
||||
(prog1
|
||||
(with-current-buffer "*patch*" (buffer-string))
|
||||
(kill-buffer "*patch*"))))
|
Loading…
Reference in New Issue
Block a user