[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to interact with a shell-like process behind the scenes?
From: |
Eli Zaretskii |
Subject: |
Re: How to interact with a shell-like process behind the scenes? |
Date: |
Thu, 22 May 2025 15:25:32 +0300 |
> From: mbork@mbork.pl
> Cc: help-gnu-emacs@gnu.org
> Date: Thu, 22 May 2025 13:20:00 +0200
>
> On 2025-05-21, at 15:37, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > Another relevant example is ispell.el, which runs the spell-checking
> > program via stdin/stdout, and without the user typing any commands
> > him/herself.
>
> Thanks, I'll look into that, too.
>
> > When the sub-process dies for some reason, Emacs calls the sentinel
> > function, which can do whatever is appropriate in this case.
> >
> > So this is pretty much a very frequent paradigm in Emacs.
>
> That was what I was (kind of) expecting. It seems there is no
> abstraction over this, though (at least not built in), right?
No, because you have all the lego pieces:
. start-process
. set-process-filter and set-process-sentinel
. process-send-string and process-send-region
. accept-process-output
and the rest is up to your application: there's no higher-level
abstraction here, because what you send and how you process the
sub-process's output differs from application to application.
Re: How to interact with a shell-like process behind the scenes?, mbork, 2025/05/22
Re: How to interact with a shell-like process behind the scenes?, Ship Mints, 2025/05/21
Re: How to interact with a shell-like process behind the scenes?, Eduardo Ochs, 2025/05/22