0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-15 17:16:26 +00:00

Revert "org-babel-comint-with-output is now fully self-contained and side-effect free"

This seems to be causing problems...

This reverts commit 0573fc4d9c.
This commit is contained in:
Eric Schulte 2009-06-11 12:55:39 -07:00
parent dc551fab04
commit 2081b95410

View file

@ -51,15 +51,15 @@ body inside the protection of `save-window-excursion' and
(set-buffer buffer) (set-buffer buffer)
,@body))) ,@body)))
(defun org-babel-comint-append-output-filter (text)
(setq string-buffer (concat string-buffer text)))
(defmacro org-babel-comint-with-output (&rest body) (defmacro org-babel-comint-with-output (&rest body)
(let ((my-filter (gensym "org-babel-comint-filter")))
`(let ((string-buffer "")) `(let ((string-buffer ""))
(flet ((,my-filter (text) (add-hook 'comint-output-filter-functions 'org-babel-comint-append-output-filter)
(setq string-buffer (concat string-buffer text))))
(add-hook 'comint-output-filter-functions ',my-filter)
(condition-case nil (progn ,@body) (t)) (condition-case nil (progn ,@body) (t))
(remove-hook 'comint-output-filter-functions ',my-filter)) (remove-hook 'comint-output-filter-functions 'org-babel-comint-append-output-filter)
string-buffer))) string-buffer))
(defun org-babel-comint-command-to-output (buffer cmd) (defun org-babel-comint-command-to-output (buffer cmd)
"Pass CMD to BUFFER using `org-babel-comint-input-command', and "Pass CMD to BUFFER using `org-babel-comint-input-command', and