0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-30 00:57:48 +00:00

`org-babel-comint-in-buffer' now declares it's indentation

This commit is contained in:
Eric Schulte 2009-06-11 07:32:31 -07:00
parent aa410df722
commit eacce7b29d

View file

@ -36,16 +36,14 @@
(require 'org-babel)
(require 'comint)
(defvar org-babel-comint-output-buffer nil
"this is a string to buffer output, it should be set buffer local")
(defvar org-babel-comint-output-list nil
"list to hold comint output")
(defun org-babel-comint-buffer-livep (buffer)
(and (buffer-live-p buffer) (get-buffer buffer) (get-buffer-process buffer)))
(defmacro org-babel-comint-in-buffer (buffer &rest body)
"Check BUFFER with `org-babel-comint-buffer-livep' then execute
body inside the protection of `save-window-excursion' and
`save-match-data'."
(declare (indent 1))
`(save-window-excursion
(save-match-data
(unless (org-babel-comint-buffer-livep buffer)
@ -54,17 +52,13 @@
,@body)))
(defun org-babel-comint-append-output-filter (text)
(setq string-buffer (concat string-buffer text))
(message (format "buffer0=%s" string-buffer)))
(setq string-buffer (concat string-buffer text)))
(defmacro org-babel-comint-with-output (&rest body)
`(let ((string-buffer ""))
(message (format "buffer=1%s" string-buffer))
(add-hook 'comint-output-filter-functions 'org-babel-comint-append-output-filter)
(condition-case nil (progn ,@body) (t))
(message (format "buffer=1%s" string-buffer))
(remove-hook 'comint-output-filter-functions 'org-babel-comint-append-output-filter)
(message (format "buffer=1%s" string-buffer))
string-buffer))
(defun org-babel-comint-wait-for-output (buffer)