Inferior-haskell: do not insert repeated prompts. #1806
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
I found that ob-haskell.el shows multiple prompts at any code block output. This was a little annoying for me, so I tried to fix it. Then, I realized it was from the inferior-haskell: It did not remove the prompts from the process output.
For example, when starting an inferior Haskell with
M-x run-haskell
and writing a multiple line function, the "*haskell*" buffer looks like this:Therefore, I wrote a function to remove all prompts except for the last one. All continuation prompts (ending with "| ") are completely removed too. After that, I added it to the hook
comint-preoutput-filter-outputs
buffer-locally. Now, the result in the "*haskell*" buffer is:I believe that this output is easier to read, and the ob-haskell.el (and maybe other libraries) process the buffer output without the need for more code.
Is it good to include this modification?
Does this patch requires any other change?
Cheers.