ob-restclient.el icon indicating copy to clipboard operation
ob-restclient.el copied to clipboard

Executing `org-open-at-point` in a code block doesn't show the results in the new window

Open rodrigo-morales-1 opened this issue 3 years ago • 1 comments

The default behavior (i.e. as happens with other Org Babel implementations) of org-open-at-point when it is executed in a code block is to show the results in a newly created window. However, this behavior is not present with restclient code blocks.

I think this issue happens because of the implementation of org-open-at-point which only shows the results when it is enclosed within #+begin_example and #+end_example or when each line of the results are prefixed with :, but since ob-restclient encloses the results in #+BEGIN_SRC js and #+END_SRC js, org-open-at-point doesn't consider it as part of the result.

I'll post a thread in the mailing list and link it to this issue.

rodrigo-morales-1 avatar Jun 30 '21 19:06 rodrigo-morales-1

It is unfortunate that this doesn't work with ob-restclient. The reason we use begin_src instead of begin_example is that we usually know the major mode of the result.

org-open-at-point calls org-babel-open-src-block-result when you're on a source block. This in turns calls org-babel-read-result which finally calls org-babel-read-element. Source blocks are not handled here, thus this does not work. I see no easy fix for this. Any ideas?

At the risk of sounding stupid, but which mailing list are you referring to?

alf avatar Jul 18 '21 20:07 alf