From cebc4bbf738fe877a8f1908d855e4536eb8a31a2 Mon Sep 17 00:00:00 2001 From: Diego Zamboni Date: Sat, 13 Feb 2021 22:43:01 +0100 Subject: [PATCH] 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 79eaf98..e12c1cc 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."