Problem using H in Emacs
@ConnorBaker is already working on this.
Since Mar 4, 2023.
- Dominant language
- Haskell
- Stars
- 587
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
With some hacking I managed to get H to start in GNU Emacs, but the output is
buffered, so not seen. A typical session in Emacs looks like this
x = [r|sqrt(1:5)|]
p x
:t x
x :: MonadR m => ...
So the output from the type query appears, but the output from the p command does not.
If the program is now terminated with Ctrl-C the lost output of the p command appears, so
it was clearly buffered when it shouldn't be.
To Reproduce
Under Windows, I put the following in .ghci
set -fno-ghci-sandbox
:set -XDataKinds
:set -XGADTs
:set -XPartialTypeSignatures
:set -XOverloadedLists
:set -XQuasiQuotes
:set -XScopedTypeVariables
:set -XTemplateHaskell
:set -XViewPatterns
:set -i/w/dev/github/HaskellR/H/.stack-work/dist/8a54c84f/build/H/autogen
The last set is needed to prevent Paths_H autogen module from not
being found.
Now cd to HaskellR, run some trivial command to get Emacs Haskell
mode to start, and type into Haskell mote prompte:
:m +Language.R.Instance
:m +H.Prelude.Interactive as H.Prelude
initialize defaultConfig
Expected behavior
H mode should work like ghci mode with extra features for R.
Environment
- Windows 11
- 1.0.0 of HaskellR
Additional context
Initially I tried using this in .emacs.d/init.el:
(setq haskell-program-name "stack exec H")
This didn't work, perhaps because none of the
expected output was reaching the terminal
because of buffering.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.