emacs-orgmode
[Top][All Lists]
Advanced

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

Re: ob-shell: possibly missing initiate-session functions?


From: Matt
Subject: Re: ob-shell: possibly missing initiate-session functions?
Date: Sun, 16 Jun 2024 20:53:01 +0200
User-agent: Zoho Mail

 ---- On Mon, 10 Jun 2024 04:48:10 +0200  Suhail Singh  wrote --- 
 > Currently (Org 9.7.3), org-babel-switch-to-session invokes
 > org-babel-initiate-session which tries to invoke
 > org-babel--initiate-session.  On a related note, ob-shell defines
 > org-babel-sh-initiate-session (and uses it within
 > org-babel-execute:shell).
 > 
 > However, there are no definitions for org-babel-shell-initiate-session
 > nor org-babel-bash-initiate-session etc.  This means that trying to use
 > org-metadown (which invokes org-babel-switch-to-session) on shell and
 > bash language session blocks results in the following errors
 > respectively:
 > 
 > #+begin_comment
 >   org-babel-initiate-session: No org-babel-initiate-session function for 
 > shell!
 >   org-babel-initiate-session: No org-babel-initiate-session function for 
 > bash!
 > #+end_comment
 > 
 > Is this a bug?  If so, does org-babel-shell-initialize need to be
 > patched to set up function aliases pointing to
 > org-babel-sh-initiate-session ?
 > 
 > FWIW, I have been using such aliases in my personal config for bash and
 > shell language blocks and they seem to behave as expected.

Thank you for your message!  Yes, I would consider this a bug.

I agree, defining an alias within "org-babel-shell-initialize" seems 
reasonable.  However, it's important that "explicit-shell-file-name" is set to 
the appropriate shell name.  In your case, I suspect it's a coincidence that 
aliasing "org-babel-sh-initiate-session" works.  A "shell" block defaults to 
"explicit-shell-file-name".  This, I suspect, is "bash" in your case, yet may 
be something different on another system.  The alias would need to close over 
"explicit-shell-file-name" like is done with "org-babel-execute:name".

--
Matt Trzcinski
Emacs Org contributor (ob-shell)
Learn more about Org mode at https://orgmode.org
Support Org development at https://liberapay.com/org-mode





reply via email to

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