0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 20:07:46 +00:00

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
This commit is contained in:
Juri Linkov 2020-12-13 21:21:37 +02:00 committed by Kyle Meyer
parent d7d714c7d5
commit 57a70d5053

View file

@ -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)
(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)))))