emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dominik Schrempf <dominik.schrempf@gmail.com>
To: Bruno Barbier <brubar.cs@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Org Haskell code blocks
Date: Tue, 25 Oct 2022 20:51:45 +0200	[thread overview]
Message-ID: <87sfjbbua9.fsf@gmail.com> (raw)
In-Reply-To: <E1onOEg-0005wj-Aj@lists.gnu.org>

Hi Bruno,

glad to hear that it works for you.


Ad 'org-babel-script-escape': I use Org version 9.6. I do not temper
with 'org-babel-script-escape', it is used by the respective babel
modules --- 'ob-haskell' in this case. The error also occurs with
'cabal-repl' as process type.


Ad 'haskell-process-type': When I use 'haskell-process-type' 'auto', it
chooses 'cabal-repl' which will also fire up 'ghci' but the setup is
faulty, because it does not find any modules, as I described. I just
checked and this is not a fault of org-mode. The command 'cabal repl'
also fails to access any modules when executed in the terminal. I think
it requires a `.cabal` file, which I usually do not have when using an
Org file. I quote the help text from 'cabal repl':

    Open an interactive session for a component within the project.

I think this is not the correct default for Org mode, because usually
there is no "project", but just an Org file.

If I use 'haskell-process-type' 'ghci', all modules I have installed
along with GHC are found, as I expect them to be.


Ad scrambling: The scrambling happens with multi-line input. For example

    #+begin_src haskell :exports both :results output
    let x = 10
    let y = 12
    x*y
    [x,y]
    #+end_src

    #+results:
    :
    : ghci> 120
    : [10,12]

Do you get syntax highlighting when the source code is indented (for
example in list items).

Thanks for your reply!

Dominik

Bruno Barbier <brubar.cs@gmail.com> writes:

> Hi,
>
> Dominik Schrempf <dominik.schrempf@gmail.com> writes:
>
>> ...
>> However, the result output is still scrambled (e.g., empty
>> lines, unnecessary "ghci>" prompts in results)
>>
>
> For me, ghci is selected by default.
>
> Here is the config I've used to test it:
>
>   | emacs-version           |            28.1 |
>   | org-version             |           9.5.2 |
>   | haskell-process-type    |            auto |
>   | org-babel-script-escape | <not available> |
>
>
> Here is my simple test:
>
>   #+begin_src haskell
>     1+2
>   #+end_src
>
>   #+RESULTS:
>   : 3
>
> The variable 'org-babel-script-escape' doesn't exist in the version that
> I'm using. And, the prompt is not "ghci>" but the current module name.
>
> Which version of org are you using ? Could you try with a recent version
> and provide a minimal complete example using a minimal configuration ?
> (see the org mode manual (info "(org)Feedback")).
>
> Thanks,
>
>
> Bruno


  reply	other threads:[~2022-10-25 19:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 14:47 Org Haskell code blocks Dominik Schrempf
2022-10-25 15:08 ` Dominik Schrempf
2022-10-25 18:06   ` Bruno Barbier
2022-10-25 18:51     ` Dominik Schrempf [this message]
2022-10-26  4:19       ` Ihor Radchenko
2022-10-26  6:24         ` Dominik Schrempf
2022-10-26  6:57           ` Ihor Radchenko
2022-10-26  9:11             ` Dominik Schrempf
2022-10-27  3:32               ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfjbbua9.fsf@gmail.com \
    --to=dominik.schrempf@gmail.com \
    --cc=brubar.cs@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).