help-gnu-emacs
[Top][All Lists]
Advanced

[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: mbork
Subject: Re: How to interact with a shell-like process behind the scenes?
Date: Sat, 24 May 2025 19:31:21 +0200

On 2025-05-22, at 15:25, Eli Zaretskii <eliz@gnu.org> wrote:

>> > 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.

I see.  I started playing around with this, and while I can't (yet) make
it work, I agree that a higher-level abstraction might not be needed (or
maybe even possible, because the outputs from different programs can be,
well, wildly different).

Thanks a lot,

-- 
Marcin Borkowski
https://mbork.pl
https://crimsonelevendelightpetrichor.net/



reply via email to

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