From 41218eafa9285844ea4e84c52e265b2c0232c1ba Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 13 Dec 2020 21:21:37 +0200 Subject: [PATCH] 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. --- lisp/ob-ruby.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/ob-ruby.el b/lisp/ob-ruby.el index 5ed29f889..2e33bfa29 100644 --- a/lisp/ob-ruby.el +++ b/lisp/ob-ruby.el @@ -159,13 +159,16 @@ org-babel-ruby-initiate-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))))) -- 2.25.1