summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2010-09-03 07:51:13 -0600
committerEric Schulte <schulte.eric@gmail.com>2010-09-03 07:55:59 -0600
commit48114acd2a9755e16840f16b42e0257c3f1b6bb2 (patch)
treed940fec818c47b2a74f98d49e84fc982cbef60b4
parent006ebbcd8094b58da4f01a9531f429e35258086b (diff)
downloadorg-mode-48114acd2a9755e16840f16b42e0257c3f1b6bb2.tar.gz
ob-tangle: adding pre-tangle hook for customization of tangle preparation
* lisp/ob-tangle.el (org-babel-pre-tangle-hook): defines new tangle hook (org-babel-tangle): calls new tangle hook
-rw-r--r--lisp/ob-tangle.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index adc054a..a87ee44 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -53,6 +53,11 @@ then the name of the language is used."
:group 'org-babel
:type 'hook)
+(defcustom org-babel-pre-tangle-hook '(save-buffer)
+ "Hook run at the beginning of `org-babel-tangle'."
+ :group 'org-babel
+ :type 'hook)
+
(defun org-babel-find-file-noselect-refresh (file)
"Find file ensuring that the latest changes on disk are
represented in the file."
@@ -127,7 +132,7 @@ TARGET-FILE can be used to specify a default export file for all
source blocks. Optional argument LANG can be used to limit the
exported source code blocks by language."
(interactive)
- (save-buffer)
+ (run-hooks 'org-babel-pre-tangle-hook)
(save-excursion
(let ((block-counter 0)
(org-babel-default-header-args