all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* change in calling remote code blocks?
@ 2018-01-15 18:07 John Kitchin
  2018-01-15 22:49 ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: John Kitchin @ 2018-01-15 18:07 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

In org8 I used to be able to call remote code blocks (
http://kitchingroup.cheme.cmu.edu/blog/2016/02/09/Calling-remote-code-blocks-in-org-mode/
)

with a syntax like:

#+call: si.org:figure-1() :wrap html


And C-c C-c on that line would call a code block named figure-1 in the file
si.org and insert the results.

in org 9.1.6, this does nothing. Does anyone know if this got changed, and
if there is a new way to do that?

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

[-- Attachment #2: Type: text/html, Size: 1333 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: change in calling remote code blocks?
  2018-01-15 18:07 change in calling remote code blocks? John Kitchin
@ 2018-01-15 22:49 ` Nicolas Goaziou
  2018-01-16  0:08   ` John Kitchin
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2018-01-15 22:49 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode

Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> In org8 I used to be able to call remote code blocks (
> http://kitchingroup.cheme.cmu.edu/blog/2016/02/09/Calling-remote-code-blocks-in-org-mode/
> )
>
> with a syntax like:
>
> #+call: si.org:figure-1() :wrap html
>
> And C-c C-c on that line would call a code block named figure-1 in the file
> si.org and insert the results.
>
> in org 9.1.6, this does nothing. Does anyone know if this got changed, and
> if there is a new way to do that?

This sounds like a bug.

It does ring a bell. However, I couldn't find any reference to this
syntax or behaviour in the manual. Am I missing something?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: change in calling remote code blocks?
  2018-01-15 22:49 ` Nicolas Goaziou
@ 2018-01-16  0:08   ` John Kitchin
  2018-01-22 18:44     ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: John Kitchin @ 2018-01-16  0:08 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1831 bytes --]

I don't recall how I learned about that, I guess maybe in some library of
babel documentation somewhere. I confirmed it does work in 8.2.10, e.g.
just with emacs -Q.

There are a few changes in org 9 to org-babel-lob-execute-maybe
and org-babel-lob-get-info that seem to be the root cause of the change.
Notably, org-babel-lob-get-info now returns nil where it used to return the
"path" to the file and block.

So, if I put this into an org file

(progn
 (re-search-forward "call")
 (message "%s" (org-babel-lob-get-info)))   ;<- execute here


#+call: remote-call.org:test-block()

These get returned

In 8.2.10: "(remote-call.org:test-block() nil 0 nil)"
In 9.1.6: "nil"

I am not sure what all the differences are, but it seems to be where the
change in behavior came from.

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Mon, Jan 15, 2018 at 2:49 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
> > In org8 I used to be able to call remote code blocks (
> > http://kitchingroup.cheme.cmu.edu/blog/2016/02/09/Calling-
> remote-code-blocks-in-org-mode/
> > )
> >
> > with a syntax like:
> >
> > #+call: si.org:figure-1() :wrap html
> >
> > And C-c C-c on that line would call a code block named figure-1 in the
> file
> > si.org and insert the results.
> >
> > in org 9.1.6, this does nothing. Does anyone know if this got changed,
> and
> > if there is a new way to do that?
>
> This sounds like a bug.
>
> It does ring a bell. However, I couldn't find any reference to this
> syntax or behaviour in the manual. Am I missing something?
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 3152 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: change in calling remote code blocks?
       [not found] <mailman.107.1516122017.10361.emacs-orgmode@gnu.org>
@ 2018-01-18  5:48 ` edgar
  0 siblings, 0 replies; 7+ messages in thread
From: edgar @ 2018-01-18  5:48 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: mail, jkitchin

> Message: 1
> Date: Mon, 15 Jan 2018 10:07:33 -0800
> From: John Kitchin <jkitchin@andrew.cmu.edu>
> 
> with a syntax like:
> 
> #+call: si.org:figure-1() :wrap html
> 
> 
> And C-c C-c on that line would call a code block named figure-1 in the 
> file
> si.org and insert the results.
> 
> in org 9.1.6, this does nothing. Does anyone know if this got changed, 
> and
> if there is a new way to do that?
> 
> John

You may try loading the file into the library of babel 
(org-babel-lob-ingest). Then, you can call the function without a 
reference to the file

#+CAPTION: s1.org
#+BEGIN_SRC org
   ,#+NAME: figure-1
   ,#+BEGIN_SRC python
     return 2 + 2
   ,#+END_SRC
#+END_SRC

#+CAPTION: t.org
#+BEGIN_SRC org
   ,#+CALL: figure-1() :wrap html

   ,#+RESULTS:
   ,#+BEGIN_html
   4
   ,#+END_html
#+END_SRC

> Message: 7
> Date: Mon, 15 Jan 2018 23:49:54 +0100
> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> To: John Kitchin <jkitchin@andrew.cmu.edu>
> 
> This sounds like a bug.
Or missed feature?

> 
> It does ring a bell. However, I couldn't find any reference to this
> syntax or behaviour in the manual. Am I missing something?

I only found the evident:
#+BEGIN_QUOTE
By calling a named code block(2) from an Org mode buffer or
a table.  Org can call the named ‘src’ code blocks from the
*current Org mode buffer* or from the *“Library of Babel”*
#+END_QUOTE
(bold added by me).


> Message: 8
> Date: Mon, 15 Jan 2018 16:08:26 -0800
> From: John Kitchin <jkitchin@andrew.cmu.edu>

> babel documentation somewhere. I confirmed it does work in 8.2.10, e.g.
> just with emacs -Q.

It would be nice if it did :) .

Thanks for working so well on Org. I have good news: Someone to whom I 
introduced Emacs is now using it! (not my advisor... yet).

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: change in calling remote code blocks?
  2018-01-16  0:08   ` John Kitchin
@ 2018-01-22 18:44     ` Nicolas Goaziou
  2018-01-22 19:24       ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2018-01-22 18:44 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode

Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> I don't recall how I learned about that, I guess maybe in some library of
> babel documentation somewhere. I confirmed it does work in 8.2.10, e.g.
> just with emacs -Q.
>
> There are a few changes in org 9 to org-babel-lob-execute-maybe
> and org-babel-lob-get-info that seem to be the root cause of the change.
> Notably, org-babel-lob-get-info now returns nil where it used to return the
> "path" to the file and block.
>
> So, if I put this into an org file
>
> (progn
>  (re-search-forward "call")
>  (message "%s" (org-babel-lob-get-info)))   ;<- execute here
>
> #+call: remote-call.org:test-block()
>
> These get returned
>
> In 8.2.10: "(remote-call.org:test-block() nil 0 nil)"
> In 9.1.6: "nil"
>
> I am not sure what all the differences are, but it seems to be where the
> change in behavior came from.

Fixed. Thank you. I also updated documentation and added tests.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: change in calling remote code blocks?
  2018-01-22 18:44     ` Nicolas Goaziou
@ 2018-01-22 19:24       ` Nicolas Goaziou
  2018-01-23  4:36         ` numbchild
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2018-01-22 19:24 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Fixed. Thank you. I also updated documentation and added tests.

As a side note, file:name syntax is a bit weak. It prevents using colons
in a name, as reported by the linter. I don't know if the feature is
used extensively but it may be worth considering changing references
syntax to, e.g, "file::name".

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: change in calling remote code blocks?
  2018-01-22 19:24       ` Nicolas Goaziou
@ 2018-01-23  4:36         ` numbchild
  0 siblings, 0 replies; 7+ messages in thread
From: numbchild @ 2018-01-23  4:36 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-mode, John Kitchin

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

I agree. use `file::name` is better.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Tue, Jan 23, 2018 at 3:24 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
> > Fixed. Thank you. I also updated documentation and added tests.
>
> As a side note, file:name syntax is a bit weak. It prevents using colons
> in a name, as reported by the linter. I don't know if the feature is
> used extensively but it may be worth considering changing references
> syntax to, e.g, "file::name".
>
>

[-- Attachment #2: Type: text/html, Size: 1498 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-23  4:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-15 18:07 change in calling remote code blocks? John Kitchin
2018-01-15 22:49 ` Nicolas Goaziou
2018-01-16  0:08   ` John Kitchin
2018-01-22 18:44     ` Nicolas Goaziou
2018-01-22 19:24       ` Nicolas Goaziou
2018-01-23  4:36         ` numbchild
     [not found] <mailman.107.1516122017.10361.emacs-orgmode@gnu.org>
2018-01-18  5:48 ` edgar

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.