Re: [O] Haskell org-mode problems redux
Gosh, it worked. So I wasn't crazy or remiss, rather, I just didn't know how deep the rabbit hole was. Thanks! One odd thing still. I tried to run #+begin_src haskell :set prompt-cont "" #+end_src and like other times before trying to run Haskell blocks it complained saying executing Haskell code block... org-babel-script-escape: ‘org-babel-script-escape’ expects a string so I add :results output to the #+begin line and it works. Would anyone know what that is about? On Thu, May 30, 2019 at 3:25 PM Bruno Barbier wrote: > > Hi Lawrence, > > > Lawrence Bottorff writes: > > > I've been trying to get Haskell to work in babel code blocks for a long > > time. A year or so ago I tried and eventually gave up. I tried again > > recently . . . same old problems, i.e., the code block is evaluated > > exclusively by the ghci REPL, which doesn't understand or play well with > an > > org babel code block. > > > ... > > S, any ideas? > > I'm using the header arguments: > > > :prologue ":{\n" :epilogue ":}\n" > > > > to request org to insert those multiline tags :{ :} > (so, I'm not using ":set +m"). > > I'm defining these header args as headline properties (so that I don't > have to enter them again and again). Something like that: > > #+begin_example > ,** A title >:PROPERTIES: >:header-args:haskell: :prologue ":{\n" :epilogue ":}\n" >:END: > #+end_example > > I'm telling ghci to not insert a prompt, when waiting for the end of a > multiline. > > #+begin_src haskell > :set prompt-cont "" > #+end_src > > > Configured like this, it seems to be working quite well for me (great > job org and GHC teams!). > > > #+begin_src haskell > doubleSmallNumber x = > if x > 10 > then x > else x * 2 > #+end_src > > No error. > > #+begin_src haskell > let > showMe :: Int -> [String] > showMe x = [show x, show $ doubleSmallNumber x] > in > [ ["x", "doubleSmallNumber x"] > , showMe 3 > , showMe 13 > ] > #+end_src > > #+RESULTS: > | x | doubleSmallNumber x | > | 3 | 6 | > | 13 | 13 | > > > > My config: > > | ghci | 8.6.3 | > | emacs | 26.1 | > | org | 9.2.3 | > | OS| linux | > > > If it doesn't work for you on GNU/Linux, post the example and I will try > it on my computer (sorry, I won't be able to help you with Microsoft > Windows though). > > > > Bruno > > > > LB >
Re: [O] Haskell org-mode problems redux
Hi Lawrence, Lawrence Bottorff writes: > I've been trying to get Haskell to work in babel code blocks for a long > time. A year or so ago I tried and eventually gave up. I tried again > recently . . . same old problems, i.e., the code block is evaluated > exclusively by the ghci REPL, which doesn't understand or play well with an > org babel code block. > ... > S, any ideas? I'm using the header arguments: :prologue ":{\n" :epilogue ":}\n" to request org to insert those multiline tags :{ :} (so, I'm not using ":set +m"). I'm defining these header args as headline properties (so that I don't have to enter them again and again). Something like that: #+begin_example ,** A title :PROPERTIES: :header-args:haskell: :prologue ":{\n" :epilogue ":}\n" :END: #+end_example I'm telling ghci to not insert a prompt, when waiting for the end of a multiline. #+begin_src haskell :set prompt-cont "" #+end_src Configured like this, it seems to be working quite well for me (great job org and GHC teams!). #+begin_src haskell doubleSmallNumber x = if x > 10 then x else x * 2 #+end_src No error. #+begin_src haskell let showMe :: Int -> [String] showMe x = [show x, show $ doubleSmallNumber x] in [ ["x", "doubleSmallNumber x"] , showMe 3 , showMe 13 ] #+end_src #+RESULTS: | x | doubleSmallNumber x | | 3 | 6 | | 13 | 13 | My config: | ghci | 8.6.3 | | emacs | 26.1 | | org | 9.2.3 | | OS| linux | If it doesn't work for you on GNU/Linux, post the example and I will try it on my computer (sorry, I won't be able to help you with Microsoft Windows though). Bruno > LB
[O] Haskell org-mode problems redux
I've been trying to get Haskell to work in babel code blocks for a long time. A year or so ago I tried and eventually gave up. I tried again recently . . . same old problems, i.e., the code block is evaluated exclusively by the ghci REPL, which doesn't understand or play well with an org babel code block. Before, the recipe was to add `:set +m` to either the top of the block or run it in the REPL to allow "multiple lines" declarations, e.g., functions. Then there was the `let` in front of a function declaration, which is also a REPL workaround. Now it seems you need the :{ ... :} trick to get all the code block lines to be seen as together, i.e., #+begin_src haskell :results raw :{ doubleSmallNumber x = if x > 10 then x else x * 2 :} #+end_src otherwise the block is treated as though it is being fed into the REPL one at a time with no idea these lines are together making a function declaration. I'm on latest org, have installed Haskell stack 8.6.3 on Ubuntu (Haskell stack 8.6.5 on Windows). The maddening thing is the intermittent behavior, i.e., sometimes it likes what you're doing: #+begin_src haskell :results raw tripleMe x = x + x + x #+end_src and #+begin_src haskell :results raw [x | x <- [0..100], x `mod` 2 == 0 && x `mod` 7 == 0] #+end_src #+RESULTS: Prelude> [0,14,28,42,56,70,84,98] [0,14,28,42,56,70,84,98] work fine -- but often enough when trying to declare a function with type declaration first I get cryptic errors -- which are then solved with the :{ ... :} REPL kludge. One other oddness is starting a ghci session with babel creates a different sort of REPL than just starting one with haskell-mode . . . and the two REPLs seem to clash and not like each other around. Declaring :session *haskell* doesn't seem to matter. . . . I was in touch with Rob Moss who claims to have it all working with GHC 4.4 from Debian and spacemacs, but when I tried all that I wasn't able to reproduce his results, rather, the same old problems. S, any ideas? It seems like ob-haskell -- which is now built in, not separate? -- needs some attention. Or somebody who has the proverbial silver bullet comes forth to save the day. LB
Re: [O] A recent fix caused other face highlighting issue
Nicolas Goaziou writes: > Hello, > > stardiviner writes: > >> This commit "42abf5c6954dee8410e33d0c5140d3b36c9d1c15" try to fix >> org-do-emphasis-faces function on strike-through fontification on heading. >> But >> it failed on verbatim like ~code~, =verbatim= etc. Can it be reverted? or >> provide >> another solution? > > I reverted the commit. I Cc'ed Kévin, as the author of the patch. > > Regards, Hi! Thanks for the revert; as I mentioned in the previous discussion[1], my patch was more of a workaround anyway. Stefan Monnier committed a proper fix in bug#35476, so strike-through will work with headings on Emacs 27. [1] http://lists.gnu.org/archive/html/emacs-orgmode/2019-04/msg00236.html
Re: [O] Vertical bars in org file break export to ics
Hello, thu...@arcor.de (Thomas Plass) writes: > michael wrote at 08:57 on May 30, 2019: > : for the following *.org file running org-icalendar-export-to-ics will fail > : with "Args out of range: [nil nil], 2". > : > : * This is a test > : <2020-01-01 Mi> > : > : | | | > : | | | | | > > Org recognizes the last two lines as a genuine Org table (with two > rows), not as a collection of vertical bars having a completely > different meaning. > > Making the export more robust by gracefully handling unequal > numbers of columns won't help you as I guess you wish to have the > vertical bars exported verbatim (which Org won't do). You're right. Meanwhile, I made export more robust in this case. > Your best bet is probably to choose an unreserved character for use in > the graphics, possibly just before exporting. Unicode code point > 0xFFE4 FULLWIDTH BROKEN BAR looks similar. Or use ": ", i.e., fixed-width area, or \vert as the first bar. Regards, -- Nicolas Goaziou
Re: [O] A recent fix caused other face highlighting issue
Hello, stardiviner writes: > This commit "42abf5c6954dee8410e33d0c5140d3b36c9d1c15" try to fix > org-do-emphasis-faces function on strike-through fontification on heading. But > it failed on verbatim like ~code~, =verbatim= etc. Can it be reverted? or > provide > another solution? I reverted the commit. I Cc'ed Kévin, as the author of the patch. Regards, -- Nicolas Goaziou
Re: [O] Vertical bars in org file break export to ics
Hello michael, michael wrote at 08:57 on May 30, 2019: : for the following *.org file running org-icalendar-export-to-ics will fail : with "Args out of range: [nil nil], 2". : : * This is a test : <2020-01-01 Mi> : : | | | : | | | | | Org recognizes the last two lines as a genuine Org table (with two rows), not as a collection of vertical bars having a completely different meaning. Making the export more robust by gracefully handling unequal numbers of columns won't help you as I guess you wish to have the vertical bars exported verbatim (which Org won't do). Your best bet is probably to choose an unreserved character for use in the graphics, possibly just before exporting. Unicode code point 0xFFE4 FULLWIDTH BROKEN BAR looks similar. Regards Thomas
Re: [O] Vertical bars in org file break export to ics
On Thursday, 30 May 2019 at 08:57, michael wrote: > (The reason i have these vertical bars in my files is that i tend to use > graphics created with Emacs artist mode for the purpose of network > documentation.) Whether this is a bug or not, I will leave for others to decide. However, if you are going to use artist mode, I suggest putting the lines within a src block with ditaa as the language. #+begin_src ditaa | | | | | | | | | #+end_src which gives you the benefit of having C-c ' put you into artist mode automatically. -- Eric S Fraga via Emacs 27.0.50, Org release_9.2.3-379-gff2bf2
[O] Vertical bars in org file break export to ics
Hello list, for the following *.org file running org-icalendar-export-to-ics will fail with "Args out of range: [nil nil], 2". * This is a test <2020-01-01 Mi> | | | | | | | | The error also occurs without any personal configuration files loaded using the following software versions: - Org Version: latest from org-mode.org - Emacs Version:26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8) of 2019-04-12 (The reason i have these vertical bars in my files is that i tend to use graphics created with Emacs artist mode for the purpose of network documentation.) Is it me or could this be an org-mode bug? Thanks for your effort in advance! Michael