emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ob-ruby.el: Don't reuse the same buffer among different name


From: Kyle Meyer
Subject: Re: [PATCH] ob-ruby.el: Don't reuse the same buffer among different named
Date: Sun, 13 Dec 2020 04:03:29 GMT

Aaron Madlon-Kay writes:

>> +                                     (run-ruby-or-pop-to-buffer
>> +                                      cmd (or session "ruby")
>> +                                      (unless session
>> +                                        (inf-ruby-buffer)))
>
> I have just run into an issue with this: If you don't specify :ruby
> then `cmd' for me is calculated by
>
>     (cdr (assoc inf-ruby-default-implementation inf-ruby-implementations))
>
> which gives the function `inf-ruby--irb-command' as a result.
>
> However `run-ruby-or-pop-to-buffer' expects to get a string only.

Thanks for noting this.  Indeed it looks like the old call through
run-ruby handled this

  (run-ruby-or-pop-to-buffer
     (let ((command
            (or command
                (cdr (assoc inf-ruby-default-implementation
                            inf-ruby-implementations)))))
       (if (functionp command)
           (funcall command)
         command))
     ...)

and that's lost with this switch to run-ruby-or-pop-to-buffer.

> I'm not sure if it should be org-mode's responsibility to resolve the
> actual command string, or if it should be done by
> `run-ruby-or-pop-to-buffer'. (It kind of seems like the latter?)
>
> Any thoughts?

Given the current situation, I don't see a good option aside from doing
the functionp dance in org-babel-ruby-initiate-session as well.  Even if
inf-ruby's check was moved downstream of run-ruby-or-pop-to-buffer, I
think it'd be good to fix on ob-ruby's end to work with the current
inf-ruby.

Juri, what do you think?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]