emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Jack Kamm <jackkamm@gmail.com>
Cc: emacs-orgmode@gnu.org, matt@excalamus.com, jeremiejuste@gmail.com
Subject: Re: [PATCH] Async sessions: Fix prompt removal regression in ob-R
Date: Sun, 20 Oct 2024 09:34:59 +0000	[thread overview]
Message-ID: <875xpnrubg.fsf@localhost> (raw)
In-Reply-To: <87ed4b45r7.fsf@gmail.com>

Jack Kamm <jackkamm@gmail.com> writes:

>> Rather than `t', I'd use something more descriptive like 'disable-prompt-filtering.
>
> Is the attached patch what you had in mind? If so I will squash it with
> the previous patch.

Your variant is even better than what I had in mind.

> But first -- note that the current patch is on top of bugfix. I had
> mentioned this in my original email but want to double check if it's
> OK. In particular, I'm not sure if it's acceptable for bugfix branch
> anymore, now that I'm changing the function signature of
> `org-babel-comint-async-register' (albeit in a backward-compatible way).
>
> I had originally proposed bugfix since I use R's table() function a lot
> (as in my original example), and it was causing me problems when I
> belatedly upgraded my work machine to Org 9.7.  But if you prefer, I can
> rebase onto main.
>
> Another possibility would be to add a hardcoded check on bugfix to skip
> the prompt filtering if the major-mode is R or Python; then on main,
> revert the hard-coded check, and update the signature of
> `org-babel-comint-async-register' to set it properly with a
> variable. But not sure it's worth the hassle -- I might just switch to
> using main branch on my work machine at that point.

I think that it is ok for bugfix as the patch essentially reverses the
commit that introduced the regression for ob-R and ob-python. (The
original patch was fixing a problem with ob-shell). So, that patch is
fairly trivial.

We might want to document the signature change in ORG-NEWS on main
though, as an additional patch for main.

For reference, here is the official policy on bugfix branch:
https://orgmode.org/worg/org-maintenance.html#release-types

> +    (setq org-babel-comint-async-remove-prompts-p
> +          (let ((prompt-handling (or prompt-handling 'filter-prompts)))
> +            (cond
> +             ((eq prompt-handling 'disable-prompt-filtering) nil)
> +             ((eq prompt-handling 'filter-prompts) t)
> +             (t (error (format "Unrecognized prompt handling behavior %s"
> +                               (symbol-name prompt-handling)))))))

nitpick: I'd rather add (eq prompt-handling nil) as a cond clause, to
make it more explicit.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


      reply	other threads:[~2024-10-20  9:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-22 21:45 [PATCH] Async sessions: Fix prompt removal regression in ob-R Jack Kamm
2024-10-02 17:05 ` Ihor Radchenko
2024-10-15  7:03   ` Jack Kamm
2024-10-19  7:58     ` Ihor Radchenko
2024-10-20  7:01       ` Jack Kamm
2024-10-20  9:34         ` Ihor Radchenko [this message]

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=875xpnrubg.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=jackkamm@gmail.com \
    --cc=jeremiejuste@gmail.com \
    --cc=matt@excalamus.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 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).