Pass user-specified variables to the async process #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a special use case for tangling my Emacs configuration where I needed some calendar variables passed to the asynchronous Emacs tangling process. This PR enhances
#+auto_tangle
with support for a colon separatedvars
list that may be set on a per-file basis. Any variables named here will be added to thepreserved
list that is passed to the async.It may also address issue #16 by allowing the user to specify
#+auto_tangle vars:load-path
in case their
ob-python
is not in the default Emacsload-path
.The following changes were made:
Augment the
auto_tangle
keyword to handle avars
option which contains a colon-separated list of variable names that will be passed and preserved in the async tangling process.Add an
org-auto-tangle
configuration group.Add an
org-auto-tangle-with-vars
configuration option.Support disabling auto-tangling by adding
nil
to theAUTO_TANGLE
keyword line without having to remove any variables that are set there.The implementation uses some functionality from org-export (ox) which would allow for extending
#+auto_tangle
in the future.In case you pick this up, I will also submit another PR that adds the existing org-auto-tangle variables to the customization group. It is on my customization branch and is currently dependent upon this change, see commit e0d1fbe there.