Skip to content

Commit

Permalink
ob-tangle: New tangle-finished hook
Browse files Browse the repository at this point in the history
* lisp/ob-tangle.el (org-babel-tangle, org-babel-tangle-finished-hook):
Create a new hook, `org-babel-tangle-finished-hook', and run it at the
end of `org-babel-tangle'.
(org-babel-pre-tangle-hook): Update docstring to mention buffer the hook
is run in, to match the docstring of `org-babel-tangle-finished-hook`.
  • Loading branch information
tecosaur committed Sep 23, 2022
1 parent d240386 commit 6a82d17
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lisp/ob-tangle.el
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ then the name of the language is used."
:type 'hook)

(defcustom org-babel-pre-tangle-hook '(save-buffer)
"Hook run at the beginning of `org-babel-tangle'."
"Hook run at the beginning of `org-babel-tangle' in the original buffer."
:group 'org-babel
:version "24.1"
:type 'hook)
Expand All @@ -89,6 +89,13 @@ then the name of the language is used."
:version "24.1"
:type 'hook)

(defcustom org-babel-tangle-finished-hook nil
"Hook run at the very end of `org-babel-tangle' in the original buffer.
In this way, it is the counterpart to `org-babel-pre-tangle-hook'."
:group 'org-babel
:package-version '(Org . "9.6")
:type 'hook)

(defcustom org-babel-tangle-comment-format-beg "[[%link][%source-name]]"
"Format of inserted comments in tangled code files.
The following format strings can be used to insert special
Expand Down Expand Up @@ -322,6 +329,7 @@ matching a regular expression."
(org-babel-with-temp-filebuffer file
(run-hooks 'org-babel-post-tangle-hook)))
path-collector))
(run-hooks 'org-babel-tangle-finished-hook)
path-collector))))

(defun org-babel-interpret-file-mode (mode)
Expand Down

0 comments on commit 6a82d17

Please sign in to comment.