branch: elpa/org-auto-tangle
commit cebc4bbf738fe877a8f1908d855e4536eb8a31a2
Author: Diego Zamboni <[email protected]>
Commit: Diego Zamboni <[email protected]>
Improve auto_tangle regex
Use org-make-options-regexp instead of a handcrafted regexp, which
results in more robust matching (e.g. supports options not starting on
the first column).
---
org-auto-tangle.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/org-auto-tangle.el b/org-auto-tangle.el
index 79eaf9806f..e12c1ccea9 100644
--- a/org-auto-tangle.el
+++ b/org-auto-tangle.el
@@ -62,8 +62,8 @@ all Org buffers unless `#+auto_tangle: nil' is set.")
(widen)
(save-excursion
(goto-char (point-min))
- (when (re-search-forward "^#\\+auto_tangle: \\(.*\\)" nil :noerror)
- (match-string 1))))))
+ (when (re-search-forward (org-make-options-regexp '("auto_tangle")) nil
:noerror)
+ (match-string 2))))))
(defun org-auto-tangle-async (file)
"Invoke `org-babel-tangle-file' asynchronously on FILE."