Browse Source

ob-ruby.el: Funcall command if it's a function from inf-ruby-implementations

* lisp/ob-ruby.el (org-babel-ruby-initiate-session): When 'command'
is a function from 'inf-ruby-implementations', use 'funcall' to get
a command string for the first arg of 'run-ruby-or-pop-to-buffer'.
This is like what 'run-ruby' does.

Reported-by: Aaron Madlon-Kay <aaron@madlon-kay.com>
Ref: https://orgmode.org/list/CAHvKJZsAUtYOKV1bH_r9BXqE_d6k11qg4dfxvqCUVUxjmGohGw@mail.gmail.com
Juri Linkov 4 years ago
parent
commit
57a70d5053
1 changed files with 7 additions and 4 deletions
  1. 7 4
      lisp/ob-ruby.el

+ 7 - 4
lisp/ob-ruby.el

@@ -159,13 +159,16 @@ If there is not a current inferior-process-buffer in SESSION
 then create one.  Return the initialized session."
   (unless (string= session "none")
     (require 'inf-ruby)
-    (let* ((cmd (cdr (or (assq :ruby params)
-			 (assoc inf-ruby-default-implementation
-				inf-ruby-implementations))))
+    (let* ((command (cdr (or (assq :ruby params)
+			     (assoc inf-ruby-default-implementation
+				    inf-ruby-implementations))))
 	   (buffer (get-buffer (format "*%s*" session)))
 	   (session-buffer (or buffer (save-window-excursion
 					(run-ruby-or-pop-to-buffer
-					 cmd (or session "ruby")
+					 (if (functionp command)
+					     (funcall command)
+					   command)
+					 (or session "ruby")
 					 (unless session
 					   (inf-ruby-buffer)))
 					(current-buffer)))))