From 2081b95410bafb467f991da1031a4e5012e7c06a Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Thu, 11 Jun 2009 12:55:39 -0700 Subject: [PATCH] Revert "org-babel-comint-with-output is now fully self-contained and side-effect free" This seems to be causing problems... This reverts commit 0573fc4d9cd0377a93facf2e0254e67d9f6cfb71. --- lisp/org-babel-comint.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lisp/org-babel-comint.el b/lisp/org-babel-comint.el index 54c8a21a6..f015c6c7d 100644 --- a/lisp/org-babel-comint.el +++ b/lisp/org-babel-comint.el @@ -51,15 +51,15 @@ body inside the protection of `save-window-excursion' and (set-buffer buffer) ,@body))) +(defun org-babel-comint-append-output-filter (text) + (setq string-buffer (concat string-buffer text))) + (defmacro org-babel-comint-with-output (&rest body) - (let ((my-filter (gensym "org-babel-comint-filter"))) - `(let ((string-buffer "")) - (flet ((,my-filter (text) - (setq string-buffer (concat string-buffer text)))) - (add-hook 'comint-output-filter-functions ',my-filter) - (condition-case nil (progn ,@body) (t)) - (remove-hook 'comint-output-filter-functions ',my-filter)) - string-buffer))) + `(let ((string-buffer "")) + (add-hook 'comint-output-filter-functions 'org-babel-comint-append-output-filter) + (condition-case nil (progn ,@body) (t)) + (remove-hook 'comint-output-filter-functions 'org-babel-comint-append-output-filter) + string-buffer)) (defun org-babel-comint-command-to-output (buffer cmd) "Pass CMD to BUFFER using `org-babel-comint-input-command', and