Browse Source

babel: small wait on new ruby sessions to allow process to start

* contrib/babel/lisp/langs/org-babel-ruby.el (org-babel-ruby-initiate-session):
   Adding a small wait after stating a new ruby session.  This avoids
   errors with `ansi-color-process-output' not being able to find the
   process mark.
Eric Schulte 15 years ago
parent
commit
6e34e75888
1 changed files with 3 additions and 2 deletions
  1. 3 2
      contrib/babel/lisp/langs/org-babel-ruby.el

+ 3 - 2
contrib/babel/lisp/langs/org-babel-ruby.el

@@ -129,9 +129,10 @@ Emacs-lisp table, otherwise return the results as a string."
   "If there is not a current inferior-process-buffer in SESSION
 then create.  Return the initialized session."
   (unless (string= session "none")
-    (let ((session-buffer (save-window-excursion (run-ruby nil session) (current-buffer))))
+    (let ((session-buffer (save-window-excursion
+			    (run-ruby nil session) (current-buffer))))
       (if (org-babel-comint-buffer-livep session-buffer)
-          session-buffer
+	  (progn (sit-for .25) session-buffer)
         (sit-for .5)
         (org-babel-ruby-initiate-session session)))))