Function: org-babel-comint-async-register

org-babel-comint-async-register is a byte-compiled function defined in ob-comint.el.gz.

Signature

(org-babel-comint-async-register SESSION-BUFFER ORG-BUFFER INDICATOR-REGEXP CHUNK-CALLBACK FILE-CALLBACK &optional PROMPT-HANDLING)

Documentation

Set local org-babel-comint-async variables in SESSION-BUFFER.

ORG-BUFFER is added to org-babel-comint-async-buffers if not present. org-babel-comint-async-indicator, org-babel-comint-async-chunk-callback, and org-babel-comint-async-file-callback are set to INDICATOR-REGEXP, CHUNK-CALLBACK, and FILE-CALLBACK respectively. PROMPT-HANDLING may be either of the symbols filter-prompts, in which case prompts matching comint-prompt-regexp are filtered from output before it is passed to CHUNK-CALLBACK, or disable-prompt-filtering, in which case this behavior is disabled. For backward-compatibility, the default value of nil is equivalent to filter-prompts.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ob-comint.el.gz
(defun org-babel-comint-async-register
    (session-buffer org-buffer indicator-regexp
		    chunk-callback file-callback
                    &optional prompt-handling)
  "Set local org-babel-comint-async variables in SESSION-BUFFER.
ORG-BUFFER is added to `org-babel-comint-async-buffers' if not
present.  `org-babel-comint-async-indicator',
`org-babel-comint-async-chunk-callback', and
`org-babel-comint-async-file-callback' are set to
INDICATOR-REGEXP, CHUNK-CALLBACK, and FILE-CALLBACK respectively.
PROMPT-HANDLING may be either of the symbols `filter-prompts', in
which case prompts matching `comint-prompt-regexp' are filtered
from output before it is passed to CHUNK-CALLBACK, or
`disable-prompt-filtering', in which case this behavior is
disabled.  For backward-compatibility, the default value of `nil'
is equivalent to `filter-prompts'."
  (org-babel-comint-in-buffer session-buffer
    (setq org-babel-comint-async-indicator indicator-regexp
	  org-babel-comint-async-chunk-callback chunk-callback
	  org-babel-comint-async-file-callback file-callback)
    (setq org-babel-comint-async-remove-prompts-p
          (org-babel-comint--remove-prompts-p prompt-handling))
    (unless (memq org-buffer org-babel-comint-async-buffers)
      (setq org-babel-comint-async-buffers
	    (cons org-buffer org-babel-comint-async-buffers)))
    (add-hook 'comint-output-filter-functions
	      'org-babel-comint-async-filter nil t)))