emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jack Kamm <jackkamm@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Liu Hui <liuhui1610@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] Set Python shell in Org edit buffer
Date: Sun, 14 Jan 2024 09:23:13 -0800	[thread overview]
Message-ID: <87il3v3k3i.fsf@gmail.com> (raw)
In-Reply-To: <87a5pdqt21.fsf@localhost>

Ihor Radchenko <yantar92@posteo.net> writes:

>> It's annoying there's no way to tell ESS to start new session instead of
>> evaluating in existing one. Here are a few alternatives we could
>> consider to deal with this:
>>
>> 1. Change the worg/ORG-NEWS, to suggest users make sure the session
>> exists (either by evaluating a source block or call "M-x R" in edit
>> block) before running ess-eval-line.
>>
>> 2. Add ob-R and ob-julia customization options (as previously suggested)
>> to explicitly control the startup behavior (either to auto-start, or not).
>>
>> 3. Submit PR to ESS to add a variable we could let-bind, to force it to
>> start an associated session rather than evaluate in an existing
>> non-associated sessions.
>>
>> Currently I lean towards a combination of #1 and #3, but am not sure,
>> and happy to go with whatever you think is best.
>
> We can also advice `ess-request-a-process' as a temporary workaround.

My concern is that advising `ess-request-a-process' would cause
maintenance burden on ob-R. It would require some knowledge about the
ESS internals to maintain properly.

Reading through `ess-request-a-process' is rather daunting, and it
doesn't look straightforward to patch it to behave as we want. I think
the reason is because ESS allows you to call `rename-buffer' on the
inferior R session, and still have it remain associated with its editing
buffers. Which is quite a different model than the way python.el works.

After some more thought, I'm now leaning towards #2 as the best and
simplest option. In particular, I think ob-R should have an option
`org-babel-R-start-session-on-edit', which would have 2 options, nil
(default) or t. No need to add an option for the current "earmuffs"
behavior unless we find someone who actually wants it. Then, update Worg
documentation to suggest manually calling "M-x R" if session hasn't
already started yet, or to set `org-babel-R-start-session-on-edit' if
the user would like that behavior.

The alternative (trying to make `ess-eval-line' smart enough to start
new session without user intervention) seems overcomplicated from Org
development/maintenance POV, for too little gain. Clear documentation
and configuration options on Org side are good enough. This is a bit of
an edge case anyways, and unless there is interest from the ESS
developers, I think it is too much struggle to try and change how ESS
works for this. (But thank you for emailing ESS to ask).


  reply	other threads:[~2024-01-14 17:24 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05 10:18 [PATCH] Set Python shell in Org edit buffer Liu Hui
2023-12-05 11:51 ` Ihor Radchenko
2023-12-06  4:41   ` Liu Hui
2023-12-06 13:23     ` Ihor Radchenko
2023-12-07  4:45       ` Liu Hui
2023-12-07 10:36         ` Ihor Radchenko
2023-12-07 14:17           ` Liu Hui
2023-12-07 15:19             ` Ihor Radchenko
2023-12-08 10:19               ` Liu Hui
2023-12-08 13:09                 ` Ihor Radchenko
2023-12-09  2:33                   ` Liu Hui
2023-12-09 10:32                     ` Ihor Radchenko
2023-12-09 13:36                       ` Liu Hui
2023-12-27  6:04                         ` Jack Kamm
2023-12-28 11:48                           ` Ihor Radchenko
2023-12-31 18:31                             ` Jack Kamm
2024-01-05 13:45                               ` Ihor Radchenko
2024-01-05 23:29                                 ` Christopher M. Miles
2024-01-12 11:58                                   ` [ob-clojure] Clojure sessions in Org Src buffers (was: [PATCH] Set Python shell in Org edit buffer) Ihor Radchenko
2024-01-07  6:07                                 ` [PATCH] Set Python shell in Org edit buffer Jack Kamm
2024-01-07 12:54                                   ` Ihor Radchenko
2024-01-07 19:06                                     ` Jack Kamm
2024-01-07 23:14                                       ` William Denton
2024-01-08 12:26                                       ` Ihor Radchenko
2024-01-09  4:09                                         ` Jack Kamm
2024-01-09  4:25                                           ` Jack Kamm
2024-01-09 18:16                                           ` Ihor Radchenko
2024-01-10  6:21                                             ` Jack Kamm
2024-01-10 12:18                                               ` [FR] Add buffer-local setting to request specific ESS process/session name (was: [PATCH] Set Python shell in Org edit buffer) Ihor Radchenko
2024-01-10 19:14                                                 ` Sparapani, Rodney
2024-01-10 19:15                                                   ` Sparapani, Rodney
2024-01-10 19:31                                                     ` Ihor Radchenko
2024-01-10 19:39                                                       ` Sparapani, Rodney
2024-01-10 20:15                                                         ` Ihor Radchenko
2024-01-10 21:44                                                           ` [External] " Richard M. Heiberger
2024-01-10 21:53                                                             ` Ihor Radchenko
2024-01-21 11:48                                                           ` [PATCH] " Ihor Radchenko
2024-01-21 18:21                                                             ` Sparapani, Rodney
2024-01-22 12:13                                                               ` Ihor Radchenko
2024-01-22 13:46                                                                 ` Martin Maechler
2024-01-25 13:09                                                                   ` Ihor Radchenko
2024-01-25 15:23                                                                     ` Sparapani, Rodney
2024-01-25 15:33                                                                       ` Ihor Radchenko
2024-01-25 15:42                                                                         ` Sparapani, Rodney
2024-01-25 22:47                                                                           ` Ihor Radchenko
2024-01-10 12:19                                               ` [PATCH] Set Python shell in Org edit buffer Ihor Radchenko
2024-01-14 17:23                                                 ` Jack Kamm [this message]
2024-01-16 13:49                                                   ` Ihor Radchenko
2024-01-16 16:05                                                     ` Jack Kamm
2024-01-28 19:12                                                       ` Ihor Radchenko
2024-01-29  4:23                                                         ` Jack Kamm
2023-12-27  6:07                       ` Jack Kamm
2023-12-28 11:51                         ` Ihor Radchenko
2023-12-29 16:04                           ` Jack Kamm
2023-12-31 13:05                             ` Ihor Radchenko
2023-12-31 18:14                               ` Jack Kamm
2024-01-05 14:00                                 ` Ihor Radchenko
2023-12-29 22:20                 ` Jack Kamm
2023-12-30  7:08                   ` Liu Hui
2024-01-28 20:35         ` Ihor Radchenko
2024-01-29  4:21           ` Jack Kamm
2024-01-29 13:31             ` 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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87il3v3k3i.fsf@gmail.com \
    --to=jackkamm@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=liuhui1610@gmail.com \
    --cc=yantar92@posteo.net \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).