emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: comint-output-filter-functions and multi-line input


From: Ihor Radchenko
Subject: Re: comint-output-filter-functions and multi-line input
Date: Tue, 18 Oct 2022 06:00:36 +0000

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Ihor Radchenko [2022-10-16 08:48:11] wrote:
>> Each line is submitted to shell via comint-send-input and, AFAIK, the
>> result can be collected using `comint-output-filter-functions'.
>
> `comint-output-filter-functions` is probably run too late.  It's meant
> for code to react to changes in the *buffer*, I think (take with
> a heavy dose of salt, because I could never really understand the
> design).
> I suspect that `comint-preoutput-filter-functions` is closer to what you
> need/want.

I tried to use the suggested hook, but it is also supplied with
redundant empty output.

For some contents, I am trying to debug

#+begin_src bash :session test :results output
if true
 then
  echo "hello"
fi
#+end_src

#+RESULTS:
: > > > hello
  ^ ^ ^
  excessive empty output lines matching the number of extra lines in the script.

source blocks with multi-line input executed using 'ob-shell.

The main work is done in `org-babel-sh-evaluate' that feeds bash comint
buffer line by line with comint-send-input and read the output using
comint-output-filter-functions (in org-babel-comint-with-output).

-- 
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 via email to

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