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

feat: expose exclusion pattern for async-inject-variables as configuration var #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions ob-async.el
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,22 @@ functionality may be implemented separately.")
block. You can use this hook to perform language-specific
initialization which would normally execute in your init file.")

(defvar ob-async-inject-variables "\\borg-babel.+"
(defvar ob-async-inject-variables-inclusion-pattern "\\borg-babel.+"
"Regex of variables that should be injected into the async process.
It's a good idea to include any variables that are prefixed with `org-babel'.
Add additional variables like \"\\(\\borg-babel.+\\|sql-connection-alist\\)\".")

(defvaralias 'ob-async-inject-variables 'ob-async-inject-variables-inclusion-pattern)

(defvar ob-async-inject-variables-exclusion-pattern "-overlay"
"Regex of variables to exclude injecting into the async process.
It's a good idea to exclude variables that contain propertized text.

Variables with values containing overlays may contain ‘-overlay’ in the name and
are an example of variables to add to the exclusion pattern. Listing of
additional variables can be conducted as is done with
‘ob-async-inject-variable-inclusion-pattern’.")

;;;###autoload
(defalias 'org-babel-execute-src-block:async 'ob-async-org-babel-execute-src-block)

Expand Down Expand Up @@ -161,7 +172,9 @@ block."
;; Initialize the new Emacs process with org-babel functions
(setq exec-path ',exec-path)
(setq load-path ',load-path)
,(async-inject-variables ob-async-inject-variables)
,(async-inject-variables
ob-async-inject-variables-inclusion-pattern nil
ob-async-inject-variables-exclusion-pattern)
(package-initialize)
(setq ob-async-pre-execute-src-block-hook ',ob-async-pre-execute-src-block-hook)
(run-hooks 'ob-async-pre-execute-src-block-hook)
Expand Down