From: Matt <matt@excalamus.com>
To: "Suhail Singh" <suhailsingh247@gmail.com>
Cc: "Org mailing list" <emacs-orgmode@gnu.org>
Subject: Re: ob-shell: possibly missing initiate-session functions?
Date: Sun, 16 Jun 2024 20:53:01 +0200 [thread overview]
Message-ID: <1902265471c.11e1aa5961508019.932872149697165868@excalamus.com> (raw)
In-Reply-To: <87cyop3445.fsf@gmail.com>
---- 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
next prev parent reply other threads:[~2024-06-16 18:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 2:48 ob-shell: possibly missing initiate-session functions? Suhail Singh
2024-06-16 18:53 ` Matt [this message]
2024-06-16 22:54 ` Suhail Singh
2024-06-17 15:45 ` Ihor Radchenko
2024-06-17 18:29 ` Suhail Singh
2024-06-18 12:46 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1902265471c.11e1aa5961508019.932872149697165868@excalamus.com \
--to=matt@excalamus.com \
--cc=emacs-orgmode@gnu.org \
--cc=suhailsingh247@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.