Subject: bug#54705: [PATCH] reader: Add Gemtext reader.

From: Arun Isaac <[email-masked]>
Date: Wed, 13 Apr 2022 01:10:51 +0530

Hi Ludo,

> I’ve just realized that, currently, Skribilo supports Guile 2.x in
> addition to 3.0, but neither 2.2 nor 2.0 has (srfi srfi-171).
>
> Maybe the simplest option is to check for (srfi srfi-171) in
> configure.ac and disable compilation of this module if it’s unavailable,
> similar to the ‘BUILD_RSS2_READER’ conditional.
>
> WDYT?

Sure, done! A new patch follows in my next mail.

But, I have always wondered, why do we not leave all the SRFIs as
external packages outside guile? That way, older versions of guile and
other scheme implementations might use them as well. It's a pity that I
have had to make many of guile packages strictly guile 3+ just because I
use SRFI-171.

>> +(skribilo-module-syntax)
>
> I think you can omit this line and use regular #:keywords.

I'd love to do that, but if I do, doc-markup fails to read the
gemtext.scm source file properly. The backtrace follows. doc-markup will
have to be fixed. May I push this patch and work on that separately
later?

--8<---------------cut here---------------start------------->8---
Backtrace:
In ice-9/eval.scm:
   177:49 19 (lp _)
   177:32 18 (lp (#<procedure 7f782904c9c0 at ice-9/eval.scm:182:7 (env)> #<procedure 7f782904c9a0 at ice-9/eval.scm:182:7 (env)> #<procedure 7f782904c980 at ice-9/eval.scm:182:7 (env)> #<procedure 7f782904c960 at ice-9/eval.scm:182:7 (env)> #<p…> …))
In ice-9/ports.scm:
   433:17 17 (call-with-input-file _ _ #:binary _ #:encoding _ #:guess-encoding _)
    472:4 16 (_ _)
In ice-9/boot-9.scm:
   2836:4 15 (save-module-excursion _)
In skribilo/evaluator.scm:
     61:2 14 (_)
In unknown file:
          13 (eval (chapter #:title "Syntax" #:ident "syntax" (p (quasiquote ("This chapter describes the syntax or Skribilo documents---or\nrather, the available syntaxes Skribilo documents can use.  Skribilo\nactually supports several …" …))) # …) …)
In ice-9/eval.scm:
   214:21 12 (_ _)
   217:50 11 (lp _)
   217:50 10 (lp _)
   217:50  9 (lp (#<procedure 7f7828970540 at ice-9/eval.scm:212:12 (env)> #<procedure 7f7828970500 at ice-9/eval.scm:212:12 (env)> #<procedure 7f78289704c0 at ice-9/eval.scm:212:12 (env)> #<procedure 7f7828970480 at ice-9/eval.scm:212:12 (env)> # …))
   217:50  8 (lp (#<procedure 7f7828970500 at ice-9/eval.scm:212:12 (env)> #<procedure 7f78289704c0 at ice-9/eval.scm:212:12 (env)> #<procedure 7f7828970480 at ice-9/eval.scm:212:12 (env)> #<procedure 7f7828970440 at ice-9/eval.scm:212:12 (env)> #))
   217:33  7 (lp (#<procedure 7f78289704c0 at ice-9/eval.scm:212:12 (env)> #<procedure 7f7828970480 at ice-9/eval.scm:212:12 (env)> #<procedure 7f7828970440 at ice-9/eval.scm:212:12 (env)> #<procedure 7f7828970400 at ice-9/eval.scm:212:12 (env)>))
   214:21  6 (_ #f)
   217:50  5 (lp (#<procedure 7f78289a3880 at ice-9/eval.scm:282:4 (env)> #<procedure 7f78289a3800 at ice-9/eval.scm:649:6 (env)> #<procedure 7f78289a3780 at ice-9/eval.scm:649:6 (env)>))
   217:50  4 (lp (#<procedure 7f78289a3800 at ice-9/eval.scm:649:6 (env)> #<procedure 7f78289a3780 at ice-9/eval.scm:649:6 (env)>))
   217:33  3 (lp (#<procedure 7f78289a3780 at ice-9/eval.scm:649:6 (env)>))
In skribilo/documentation/api.scm:
   782:10  2 (%doc-markup-internal #<<location> 140154063808512 "./syntax.skb":224:6> make-gemtext-reader _ #:ident _ #:writer-id _ #:common-args _ #:ignore-args _ #:force-args _ #:idx _ #:idx-note _ #:idx-suffix _ #:source _ #:def _ #:see-also _ . #)
In skribilo/lib.scm:
    225:6  1 (skribe-error _ _ _)
In ice-9/boot-9.scm:
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
doc-markup: make-gemtext-reader: missing descriptions (:key join-lines? section-numbers?)
--8<---------------cut here---------------end--------------->8---

Thanks,
Arun