Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass user-specified variables to the async process #22

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

rdparker
Copy link
Contributor

@rdparker rdparker commented Aug 5, 2022

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 separated vars list that may be set on a per-file basis. Any variables named here will be added to the preserved 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 Emacs load-path.

The following changes were made:

  • Augment the auto_tangle keyword to handle a vars 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 the AUTO_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.

Augment the `auto_tangle' keyword to handle a 'vars' 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 AUTO_TANGLE keyword
without having to remove any variables that are set there.
@yilkalargaw
Copy link
Owner

Thank you @rdparker. Every thing looks good so I will merge it. I will checkout the customization group branch latter.

@yilkalargaw yilkalargaw merged commit f63d7a8 into yilkalargaw:master Aug 8, 2022
@rdparker rdparker deleted the preserve-vars branch August 9, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants