Re: [BUG] Tangling of clojure code blocks is broken [9.7 (9.7-??-0807107 @ /Users/ag/.emacs.d/.local/straight/build-30.0.50/org/)]

2023-05-07 Thread Ag
Setting :results output header makes it work as expected. Without it -
it's as I described, wrapped.

On Mon, May 8, 2023 at 12:18 AM Ag Ibragimov  wrote:
>
> Ihor Radchenko  writes:
>
> > I see the expected result on my side.
>
> I'm using the latest, org-version reports "Org mode version 9.7 
> (9.7-??-fdea200 ..."
> This particular line here is causing the problem I described:
>
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/ob-clojure.el#n191
>
> ```emacs-lisp
> (if cljs-p
> "(binding [cljs.core/*print-fn* (constantly nil)]"
>   "(binding [*out* (java.io.StringWriter.)]") ;;; <- this one
> ```
>


-- 
Regards,
Ag.



Re: [BUG] Tangling of clojure code blocks is broken [9.7 (9.7-??-0807107 @ /Users/ag/.emacs.d/.local/straight/build-30.0.50/org/)]

2023-05-07 Thread Ag Ibragimov
Ihor Radchenko  writes:

> I see the expected result on my side.

I'm using the latest, org-version reports "Org mode version 9.7 (9.7-??-fdea200 
..."
This particular line here is causing the problem I described:

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/ob-clojure.el#n191

```emacs-lisp
(if cljs-p
"(binding [cljs.core/*print-fn* (constantly nil)]"
  "(binding [*out* (java.io.StringWriter.)]") ;;; <- this one
```



Re: org mode to github markdown

2023-05-07 Thread General discussions about Org-mode.


Uwe Brauer  writes:

> There seems no export backend for (github) markdown

I think you are looking for "ox-gfm".

I can find it via [search engine] and on melpa.

-- 
Best,


RY



Re: org mode to github markdown

2023-05-07 Thread Max Nikulin

On 08/05/2023 02:45, Ihor Radchenko wrote:

In particular, vanilla
markdown allow direct HTML fragments, which are disabled in
GitHub/Reddit/many other websites for security reasons.


GitHub allows some HTML tags. I have noticed e.g. floating  and 
 collapsed fragments in

https://github.com/org-roam/org-roam/blob/main/README.md
see
https://github.com/org-roam/org-roam/blob/main/README.md?plain=1

P.S. GitHub allows raw  in .org files as well:
https://github.com/alphapapa/org-ql/blob/master/README.org?plain=1




Re: org mode to github markdown

2023-05-07 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>> There seems however to (github) markdow exporter (I also checked the
>> package-list)
>> 
>> Anybody has a suggestion?

> ox-pandoc

Ok, thanks but I meant including it in email, that is import org syntax
to github md before sending the mail (like org-mime but not html instead
github markdown)


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: org mode to github markdown

2023-05-07 Thread Ihor Radchenko
Uwe Brauer  writes:

> There seems however to (github) markdow exporter (I also checked the
> package-list)
>
> Anybody has a suggestion?

ox-pandoc

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org mode to github markdown

2023-05-07 Thread Ihor Radchenko
Bernt Hansen  writes:

> (who has been away from the org-mode mailing list for way too many years...)

Welcome back. Your GTD config got me started with Org years back :)

> I'm not sure I fully understand your question.
> You are looking for an org-mode export to markdown?  Isn't that already 
> included in recent org versions?
>
> C-c C-e C-s m M

Markdown is not a single standard. There are several variations of the
syntax. See https://en.wikipedia.org/wiki/Markdown

We support the most basic "vanilla" markdown in ox-md.el. But Github
uses its own flavour, which we do not export to. In particular, vanilla
markdown allow direct HTML fragments, which are disabled in
GitHub/Reddit/many other websites for security reasons. Instead, they
invent new markdown constructs that are explicitly supported. But there
are numerous Markdown syntax extensions - it is hard to support them
unless we have a dedicated maintainer.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org mode to github markdown

2023-05-07 Thread Bernt Hansen
Hi Uwe,

I'm not sure I fully understand your question.
You are looking for an org-mode export to markdown?  Isn't that already 
included in recent org versions?

C-c C-e C-s m M

Regards,
Bernt

(who has been away from the org-mode mailing list for way too many years...)

On 5/7/23 13:25, Uwe Brauer wrote:
> 
> Hi
> 
> I am using very very often org-mime either to edit an message (gnus)
> buffer as a org buffer, and then I sometimes export it to html when
> needed.
> 
> There seems no export backend for (github) markdown
> 
> On the other hand I still prefer to reply to github issues via email,
> and not editing the web interface
> 
> There seems however to (github) markdow exporter (I also checked the
> package-list)
> 
> Anybody has a suggestion?
> 
> Regards
> 
> Uwe Brauer





org mode to github markdown

2023-05-07 Thread Uwe Brauer



Hi 

I am using very very often org-mime either to edit an message (gnus)
buffer as a org buffer, and then I sometimes export it to html when
needed.

There seems no export backend for (github) markdown

On the other hand I still prefer to reply to github issues via email,
and not editing the web interface

There seems however to (github) markdow exporter (I also checked the
package-list)

Anybody has a suggestion?

Regards

Uwe Brauer 
-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/




Re: [PATCH] ob-sqlite: Use a transient in-memory database by default

2023-05-07 Thread Max Nikulin

On 07/05/2023 03:40, Rudolf Adamkovič wrote:

SQLite shell, which defaults to in-memory for good reasons.


Explicit :memory argument still suppresses the following warning:


Connected to a transient *in-memory* *database*.
Use ".open FILENAME" to reopen on a persistent database.


I am not an active sqlite user and I have never tried it from Org. 
However mostly I used it with files. The case for in-memory database was 
unit tests for python functions.


Babel allows to compute values of header arguments and I am not in favor 
of silently treat nil (due to e.g. a error in the called function) as 
disabled persistence. Ihor's idea with a warning is better from my point 
of view.






Re: Suggestion: for each listed keybinding, also name the command

2023-05-07 Thread Yuval Langer
On Fri, May 5, 2023 at 1:51 PM Yuval Langer  wrote:> …
> I want to add command names into the org-mode guide. I have attached
> an example of such an addition.
> …

I have:

- Added all the obvious commands to the `- {{{kbd(…)}}} ::` lines.
- Left several of these lines without a command where I've the manual
do the same.

(Thanks, Ihor Radchenko!)
From 6ee788814224436652cc46ae435005d9d8830ed0 Mon Sep 17 00:00:00 2001
From: Yuval Langer 
Date: Fri, 5 May 2023 11:57:37 +0300
Subject: [PATCH] doc/org-guide.org: Add command names to listed keybindings

TINYCHANGE
---
 doc/org-guide.org | 272 +++---
 1 file changed, 138 insertions(+), 134 deletions(-)

diff --git a/doc/org-guide.org b/doc/org-guide.org
index 95828e4c0..8eeae850b 100644
--- a/doc/org-guide.org
+++ b/doc/org-guide.org
@@ -141,10 +141,11 @@ See [[*Miscellaneous]] for a setup to realize this.
 
 Outlines make it possible to hide parts of the text in the buffer.
 Org uses just two commands, bound to {{{kbd(TAB)}}} and
-{{{kbd(S-TAB)}}} to change the visibility in the buffer.
+{{{kbd(S-TAB)}}} (~org-cycle~ and ~org-shifttab~) to change the
+visibility in the buffer.
 
 #+attr_texinfo: :sep ,
-- {{{kbd(TAB)}}} ::
+- {{{kbd(TAB)}}} (~org-cycle~) ::
 
   /Subtree cycling/: Rotate current subtree among the states
 
@@ -154,14 +155,14 @@ Org uses just two commands, bound to {{{kbd(TAB)}}} and
   When called with a prefix argument ({{{kbd(C-u TAB)}}}), or with the
   Shift key, global cycling is invoked.
 
-- {{{kbd(S-TAB)}}}, {{{kbd(C-u TAB)}}} ::
+- {{{kbd(S-TAB)}}} (~org-global-cycle~), {{{kbd(C-u TAB)}}} ::
 
   /Global cycling/: Rotate the entire buffer among the states
 
   : ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
   : '--'
 
-- {{{kbd(C-u C-u C-u TAB)}}} ::
+- {{{kbd(C-u C-u C-u TAB)}}} (~org-show-all~) ::
 
   Show all, including drawers.
 
@@ -180,15 +181,18 @@ basis by adding a =STARTUP= keyword to =overview=, =content=,
 
 The following commands jump to other headlines in the buffer.
 
-- {{{kbd(C-c C-n)}}} :: Next heading.
+- {{{kbd(C-c C-n)}}} (~org-next-visible-heading~) :: Next heading.
+- {{{kbd(C-c C-p)}}} (~org-previous-visible-heading~) :: Previous
+  heading.
 
-- {{{kbd(C-c C-p)}}} :: Previous heading.
+- {{{kbd(C-c C-f)}}} (~org-backward-heading-same-level~) :: Next
+  heading same level.
 
-- {{{kbd(C-c C-f)}}} :: Next heading same level.
+- {{{kbd(C-c C-b)}}} (~outline-backward-same-level~) :: Previous
+  heading same level.
 
-- {{{kbd(C-c C-b)}}} :: Previous heading same level.
-
-- {{{kbd(C-c C-u)}}} :: Backward to higher level heading.
+- {{{kbd(C-c C-u)}}} (~outline-up-heading~) :: Backward to higher
+  level heading.
 
 ** Structure Editing
 :PROPERTIES:
@@ -196,37 +200,37 @@ The following commands jump to other headlines in the buffer.
 :END:
 
 #+attr_texinfo: :sep ,
-- {{{kbd(M-RET)}}} ::
+- {{{kbd(M-RET)}}} (~org-meta-return~) ::
 
   Insert new heading with same level as current.  If point is in
   a plain list item, a new item is created (see [[Plain Lists]]).  When
   this command is used in the middle of a line, the line is split and
   the rest of the line becomes the new headline[fn:2].
 
-- {{{kbd(M-S-RET)}}} ::
+- {{{kbd(M-S-RET)}}} (~org-insert-todo-heading~) ::
 
   Insert new TODO entry with same level as current heading.
 
-- {{{kbd(TAB)}}} in new, empty entry ::
+- {{{kbd(TAB)}}} (~org-cycle~) in new, empty entry ::
 
   In a new entry with no text yet, {{{kbd(TAB)}}} cycles through
   reasonable levels.
 
-- {{{kbd(M-LEFT)}}}, {{{kbd(M-RIGHT)}}} ::
+- {{{kbd(M-LEFT)}}} (~org-metaleft~), {{{kbd(M-RIGHT)}}} (~org-metaright~) ::
 
   Promote or demote current heading by one level.
 
-- {{{kbd(M-UP)}}}, {{{kbd(M-DOWN)}}} ::
+- {{{kbd(M-UP)}}} (~org-move-subtree-up~), {{{kbd(M-DOWN)}}} (~org-move-subtree-down~) ::
 
   Move subtree up or down, i.e., swap with previous or next subtree of
   same level.
 
-- {{{kbd(C-c C-w)}}} ::
+- {{{kbd(C-c C-w)}}} (~org-refile~) ::
 
   Refile entry or region to a different location.  See [[*Refile and
   Copy]].
 
-- {{{kbd(C-x n s)}}}, {{{kbd(C-x n w)}}} ::
+- {{{kbd(C-x n s)}}} (~org-narrow-to-subtree~), {{{kbd(C-x n w)}}} (~widen~) ::
 
   Narrow buffer to current subtree and widen it again.
 
@@ -247,12 +251,12 @@ Just try it out and you will see immediately how it works.
 Org mode contains several commands creating such trees, all these
 commands can be accessed through a dispatcher:
 
-- {{{kbd(C-c /)}}} ::
+- {{{kbd(C-c /)}}} (~org-sparse-tree~) ::
 
   This prompts for an extra key to select a sparse-tree creating
   command.
 
-- {{{kbd(C-c / r)}}} ::
+- {{{kbd(C-c / r)}}} (~org-occur~) ::
 
   Occur.  Prompts for a regexp and shows a sparse tree with all
   matches.  Each match is also highlighted; the highlights disappear
@@ -303,41 +307,41 @@ The following commands act on items when point is in the first line of
 an item (the line with the bullet or number).
 
 #+attr_texinfo: :sep ,
-- 

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-05-07 Thread Bruno Barbier
Ruijie Yu  writes:

> Minor remarks below regarding the patchset.
>
> Bruno Barbier  writes:
>
>> +;; Copyright (c) 2023  Free Software Foundation, Inc.
>
> lisp/org.el has only a single space, so probably single space here as well.

Done.

>> +
>> +;; Authors: Bruno BARBIER 
>> +
>> +;; This program is free software; you can redistribute it and/or modify
>> +;; it under the terms of the GNU General Public License as published by
>> +;; the Free Software Foundation, either version 3 of the License, or
>> +;; (at your option) any later version.
>
> Do we need the text for "part of GNU Emacs"?
>

I guess it doesn't harm: I added it, thanks.


>> +
>> +(defun test-ob-haskell-ghci--with-global-session-worker (todo)
>> +  "See `test-ob-haskell-ghci--with-global-session-worker'."
>
> This docstring doesn't say much and only refers to itself.  Maybe
> explain what it does?  (Or now that I look at it, potentially you wanted
> to refer to the macro `test-ob-haskell-ghci-with-global-session'
> instead.)

I've rewritten that function later ... which made the documentation even worse 
:-)
I've fixed it, thanks.


>
>> +(defun test-ob-haskell-ghci (args content  preamble unprotected)
>> +  "Execute the code block CONTENT in a new GHCi session; return the result.
>> +Add ARGS to the code block argument line.  Insert PREAMBLE
>> +before the code block.  When UNPROTECTED is non-nil, don't control
>> +which session is used (i.e. don't call
>> +`test-ob-haskell-ghci--with-global-session-worker')."
>> +  (when (listp content)
>> +(setq content (string-join content "\n")))
>> +  (unless preamble
>> +(setq preamble ""))
>> +  (let ((todo  (lambda ()
>
> One space.

AFAICS, the last version has only one space here.


>> +
>> + Not define  errors
>> +;;

> Single space?

It was an invisible 'd' actually; I repainted in black :-)
Thanks.


Thank you for your review,

Bruno

>From 136878a096eb9f459e97da6617f94ba84085db9b Mon Sep 17 00:00:00 2001
From: Bruno BARBIER 
Date: Fri, 18 Nov 2022 20:14:20 +0100
Subject: [PATCH 01/13] ob-haskell: Add tests for GHCi

testing/lisp/test-ob-haskell-ghci.el: New file.
---
 testing/lisp/test-ob-haskell-ghci.el | 454 +++
 1 file changed, 454 insertions(+)
 create mode 100644 testing/lisp/test-ob-haskell-ghci.el

diff --git a/testing/lisp/test-ob-haskell-ghci.el b/testing/lisp/test-ob-haskell-ghci.el
new file mode 100644
index 0..4023873de
--- /dev/null
+++ b/testing/lisp/test-ob-haskell-ghci.el
@@ -0,0 +1,454 @@
+;;; test-ob-haskell-ghci.el --- tests for ob-haskell.el GHCi  -*- lexical-binding: t; -*-
+
+;; Copyright (c) 2023 Free Software Foundation, Inc.
+;; Authors: Bruno BARBIER 
+
+;; This file is part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+;;
+
+ Useful references
+;;
+;;  - https://orgmode.org/worg/org-contrib/babel/languages/lang-compat.html
+;;  - GHCi manual: https://downloads.haskell.org/ghc/latest/docs/users_guide/ghci.html
+ FIXME: Random failures
+;;
+;; To increase the chances of failure when running tests, you can use this command line:
+;;
+;;(for I in 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10; do make 'BTEST_OB_LANGUAGES=haskell' BTEST_RE='haskell' test-dirty & done) 2>&1 | grep FAILED
+;;
+
+ Status
+;;
+;; All the tests should succeed (except for random failures); those
+;; flagged with ":expected-result :failed" are known
+;; limitations/bugs.  Tested with (2023-03-18):
+;;
+;; | emacs-version |  29.0.60 |
+;; | org-version   | main@4cad6c8ea (Mar 16 2023) |
+;; | haskell-mode  | master@20d4e23 (Mar 4  2023) |
+;; | ghci  |9.0.2 |
+
+
+;;; Code:
+;;
+
+(require 'org-test "../testing/org-test")
+(org-test-for-executable "ghci")
+(unless (featurep 'haskell-mode)
+  (signal 'missing-test-dependency "haskell-mode"))
+
+
+;;; Helpers
+;;
+
+(defun test-ob-haskell-ghci--with-global-session-worker (todo)
+  "See `test-ob-haskell-ghci--with-global-session-worker'."
+  (when (get-buffer "*haskell*")
+(error "A buffer named '*haskell*' exists.  Can't safely test haskell blocks"))
+  (unwind-protect (funcall todo)
+;; Kill the "*haskell*" buffer to not pollute other tests.
+(when-let ((hb (get-buffer "*haskell*")))
+  (with-current-buffer hb
+(let 

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-05-07 Thread General discussions about Org-mode.
Minor remarks below regarding the patchset.

Bruno Barbier  writes:

> From 9ef867cd2cf89e77b5c5a5a7090fd37b1702e06a Mon Sep 17 00:00:00 2001
> From: Bruno BARBIER 
> Date: Fri, 18 Nov 2022 20:14:20 +0100
> Subject: [PATCH 01/13] ob-haskell: Add tests for GHCi
>
> testing/lisp/test-ob-haskell-ghci.el: New file.
> ---
>  testing/lisp/test-ob-haskell-ghci.el | 453 +++
>  1 file changed, 453 insertions(+)
>  create mode 100644 testing/lisp/test-ob-haskell-ghci.el
>
> diff --git a/testing/lisp/test-ob-haskell-ghci.el 
> b/testing/lisp/test-ob-haskell-ghci.el
> new file mode 100644
> index 0..aba94d73f
> --- /dev/null
> +++ b/testing/lisp/test-ob-haskell-ghci.el
> @@ -0,0 +1,453 @@
> +;;; test-ob-haskell-ghci.el --- tests for ob-haskell.el GHCi  -*- 
> lexical-binding: t; -*-
> +
> +;; Copyright (c) 2023  Free Software Foundation, Inc.

lisp/org.el has only a single space, so probably single space here as well.

> +
> +;; Authors: Bruno BARBIER 
> +
> +;; This program is free software; you can redistribute it and/or modify
> +;; it under the terms of the GNU General Public License as published by
> +;; the Free Software Foundation, either version 3 of the License, or
> +;; (at your option) any later version.

Do we need the text for "part of GNU Emacs"?

> +
> +;; This program is distributed in the hope that it will be useful,
> +;; but WITHOUT ANY WARRANTY; without even the implied warranty of
> +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +;; GNU General Public License for more details.
> +
> +;; You should have received a copy of the GNU General Public License
> +;; along with this program.  If not, see .
> +
> +;;; Commentary:
> +;;
> +
> + Useful references
> +;;
> +;;  - https://orgmode.org/worg/org-contrib/babel/languages/lang-compat.html
> +;;  - GHCi manual: 
> https://downloads.haskell.org/ghc/latest/docs/users_guide/ghci.html
> + FIXME: Random failures
> +;;
> +;; To increase the chances of failure when running tests, you can use this 
> command line:
> +;;
> +;;(for I in 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 
> 7 8 9 10; do make 'BTEST_OB_LANGUAGES=haskell' BTEST_RE='haskell' test-dirty 
> & done) 2>&1 | grep FAILED
> +;;

Wanted to say something here, but then realized that you deleted this
portion in a later commit.

> +
> + Status
> +;;
> +;; All the tests should succeed (except for random failures); those
> +;; flagged with ":expected-result :failed" are known
> +;; limitations/bugs.  Tested with (2023-03-18):
> +;;
> +;; | emacs-version |  29.0.60 |
> +;; | org-version   | main@4cad6c8ea (Mar 16 2023) |
> +;; | haskell-mode  | master@20d4e23 (Mar 4  2023) |
> +;; | ghci  |9.0.2 |
> +
> +
> +;;; Code:
> +;;
> +
> +(require 'org-test "../testing/org-test")
> +(org-test-for-executable "ghci")
> +(unless (featurep 'haskell-mode)
> +  (signal 'missing-test-dependency "haskell-mode"))
> +
> +
> +;;; Helpers
> +;;
> +
> +(defun test-ob-haskell-ghci--with-global-session-worker (todo)
> +  "See `test-ob-haskell-ghci--with-global-session-worker'."

This docstring doesn't say much and only refers to itself.  Maybe
explain what it does?  (Or now that I look at it, potentially you wanted
to refer to the macro `test-ob-haskell-ghci-with-global-session'
instead.)

> +(defun test-ob-haskell-ghci (args content  preamble unprotected)
> +  "Execute the code block CONTENT in a new GHCi session; return the result.
> +Add ARGS to the code block argument line.  Insert PREAMBLE
> +before the code block.  When UNPROTECTED is non-nil, don't control
> +which session is used (i.e. don't call
> +`test-ob-haskell-ghci--with-global-session-worker')."
> +  (when (listp content)
> +(setq content (string-join content "\n")))
> +  (unless preamble
> +(setq preamble ""))
> +  (let ((todo  (lambda ()

One space.

> + Data tables
> +;;
> +
> +(ert-deftest ob-haskell/int-table-data ()
> +  "From worg: int-table-data."
> +  (should (equal 10 (test-ob-haskell-ghci ":var t=int-table-data"
> +  "sum [sum r | r <- t]"
> +  "#+name: int-table-data
> +| 1 | 2 |
> +| 3 | 4 |"
> +
> +(ert-deftest ob-haskell/float-table-data ()
> +  "From worg: float-table-data."
> +  (should (equal 11.0 (test-ob-haskell-ghci ":var t=float-table-data"
> +"sum [sum r | r <- t]"
> +"#+name: float-table-data
> +| 1.1 | 2.2 |
> +| 3.3 | 4.4 |"
> +
> +(ert-deftest ob-haskell/string-table-data ()
> +  "From worg: string-table-data."
> +  (should (equal "abcd" (test-ob-haskell-ghci ":var t=string-table-data"
> +  "concat [concat r | r <- t]"
> +  "#+name: string-table-data
> +| a | b |

Re: [PATCH] Add tests for ob-haskell (GHCi)

2023-05-07 Thread Bruno Barbier

Hi Ihor,

Sorry for the delay.

Bruno Barbier  writes:

> Ihor Radchenko  writes:
>
>> Bruno Barbier  writes:
>>
>>> Note that I've changed the tests about errors; I'm now expecting
>>> ob-haskell to raise errors. I'm not sure what we should expect to be
>>> consistent with other org babel backends.
>>
>> Errors are usually displayed separately, using
>> `org-babel-eval-error-notify'.
>
> I'll see what can be done with GHCi and use this if possible.

Unfortunately, no progress on this.  And I don't really have time to
work on this.



>>> +;; To increase the chances of failure when running tests, you can use this 
>>> command line:
>>> +;;
..
>>> +;; | ghci  |9.0.2 |
>>
>> You can probably remove this.
>
> Definitely. I'll do. Thanks.

Done.



>>> +  (when (and session-name (string= session-name "none"))
>>> +(setq session-name nil))
>>> +  (unless session-name
>>> +;; As haskell-mode is using the buffer name "*haskell*", we stay
>>> +;; away from it.
>>> +(setq session-name (generate-new-buffer-name "*ob-haskell*")))
>>
>> This will make ob-haskell spawn a separate ghci process buffer every
>> single time a user runs non-session src block. And the buffer is not
>> closed after getting the result.

> Very good point!
>
> I will update this to use the same buffer named "*ob-haskell*" when the
> user doesn't set the session name.  I guess it's consistent with other
> org-babel backends.

I've changed the way session works. 'ob-haskell' should now destroy
temporary sessions.  Thanks again for spotting that mistake.


Let me know if you see further improvement before pushing this.

Thanks,

Bruno


>From 9ef867cd2cf89e77b5c5a5a7090fd37b1702e06a Mon Sep 17 00:00:00 2001
From: Bruno BARBIER 
Date: Fri, 18 Nov 2022 20:14:20 +0100
Subject: [PATCH 01/13] ob-haskell: Add tests for GHCi

testing/lisp/test-ob-haskell-ghci.el: New file.
---
 testing/lisp/test-ob-haskell-ghci.el | 453 +++
 1 file changed, 453 insertions(+)
 create mode 100644 testing/lisp/test-ob-haskell-ghci.el

diff --git a/testing/lisp/test-ob-haskell-ghci.el b/testing/lisp/test-ob-haskell-ghci.el
new file mode 100644
index 0..aba94d73f
--- /dev/null
+++ b/testing/lisp/test-ob-haskell-ghci.el
@@ -0,0 +1,453 @@
+;;; test-ob-haskell-ghci.el --- tests for ob-haskell.el GHCi  -*- lexical-binding: t; -*-
+
+;; Copyright (c) 2023  Free Software Foundation, Inc.
+
+;; Authors: Bruno BARBIER 
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+;;
+
+ Useful references
+;;
+;;  - https://orgmode.org/worg/org-contrib/babel/languages/lang-compat.html
+;;  - GHCi manual: https://downloads.haskell.org/ghc/latest/docs/users_guide/ghci.html
+ FIXME: Random failures
+;;
+;; To increase the chances of failure when running tests, you can use this command line:
+;;
+;;(for I in 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10; do make 'BTEST_OB_LANGUAGES=haskell' BTEST_RE='haskell' test-dirty & done) 2>&1 | grep FAILED
+;;
+
+ Status
+;;
+;; All the tests should succeed (except for random failures); those
+;; flagged with ":expected-result :failed" are known
+;; limitations/bugs.  Tested with (2023-03-18):
+;;
+;; | emacs-version |  29.0.60 |
+;; | org-version   | main@4cad6c8ea (Mar 16 2023) |
+;; | haskell-mode  | master@20d4e23 (Mar 4  2023) |
+;; | ghci  |9.0.2 |
+
+
+;;; Code:
+;;
+
+(require 'org-test "../testing/org-test")
+(org-test-for-executable "ghci")
+(unless (featurep 'haskell-mode)
+  (signal 'missing-test-dependency "haskell-mode"))
+
+
+;;; Helpers
+;;
+
+(defun test-ob-haskell-ghci--with-global-session-worker (todo)
+  "See `test-ob-haskell-ghci--with-global-session-worker'."
+  (when (get-buffer "*haskell*")
+(error "A buffer named '*haskell*' exists.  Can't safely test haskell blocks"))
+  (unwind-protect (funcall todo)
+;; Kill the "*haskell*" buffer to not pollute other tests.
+(when-let ((hb (get-buffer "*haskell*")))
+  (with-current-buffer hb
+(let ((kill-buffer-query-functions nil)
+  (kill-buffer-hook nil))
+  (kill-buffer hb))
+
+(defmacro test-ob-haskell-ghci-with-global-session ( body)
+  "Eval BODY in a new session, then destroy the session.
+The library ob-haskell doesn't implement session 

Re: Interest in an Org video meetup?

2023-05-07 Thread Adham Omran
> Nope. But regardless the time chosen, one of these three groups of
> people will have night. Two others will not.
> ...
> So it is 2 meetings every 3 months.
> Frequency may be different.

Understood

> Of course, that will require at least two hosts living in appropriate
> time zones.
>
> That would require 3 hosts or more commitment from 1-2 hosts.
>
> I guess the question is who is willing to do the hosting.

I live in +3 GMT, I can not at the moment host due to college
reasons but I'll update in later June.

- Adham Omran



Re: [PATCH] org-clock.el: Fix week start != 1

2023-05-07 Thread Ihor Radchenko
Max Nikulin  writes:

> Subject: [PATCH] org-clock.el: Fix week start != 1

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ed0cfbd7b

Thanks!

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at