Skip to content

Commit

Permalink
Improve auto_tangle regex
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
zzamboni committed Feb 13, 2021
1 parent be9007a commit cebc4bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions org-auto-tangle.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit cebc4bb

Please sign in to comment.