branch: elpa/org-auto-tangle
commit f1898c3d79555cdf27b82a75b065a297b0bd07ad
Author: lispy-dobby <[email protected]>
Commit: GitHub <[email protected]>
reverted the change to org-auto-tangle-find-value
---
org-auto-tangle.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/org-auto-tangle.el b/org-auto-tangle.el
index c15bad7b9c..a6a6fdf9a5 100644
--- a/org-auto-tangle.el
+++ b/org-auto-tangle.el
@@ -55,9 +55,15 @@ If nil (default), auto-tangle will only happen on buffers
with
the `#+auto_tangle: t' keyword. If t, auto-tangle will happen on
all Org buffers unless `#+auto_tangle: nil' is set.")
-(defun org-auto-tangle-find-value ()
- "Search the `auto_tangle' property in the current buffer and extracts it
when found."
- (cadar (org-collect-keywords '("auto_tangle"))))
+(defun org-auto-tangle-find-value (buffer)
+ "Search the `auto_tangle' property in BUFFER and extracts it when found."
+ (with-current-buffer buffer
+ (save-restriction
+ (widen)
+ (save-excursion
+ (goto-char (point-min))
+ (when (re-search-forward "^#\\+auto_tangle: \\(.*\\)" nil :noerror)
+ (match-string 1))))))
(defun org-auto-tangle-async (file)
"Invoke `org-babel-tangle-file' asynchronously on FILE."