Subject: Re: [bug#60753] [PATCH] gnu: home: Add home-emacs-service-type.

From: Ludovic Courtès <[email-masked]>
Date: Tue, 31 Jan 2023 17:26:41 +0100

Hi Andrew,

Andrew Tropin <[email-masked]> skribis:

>>> I think it will be cool to hook up a custom reader, ideally comment
>>> preserving, for emacs lisp inside scheme files.
>>
>> (guix read-print) is what you want.  :-)
>>
>
> Can you give a hint on how to use it for preserving comments, please?

It can be used like this:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(guix read-print)
scheme@(guile-user)> (pretty-print-with-comments (current-output-port) `(list foo ,(comment ";ooh!\n" #t) bar))
(list foo ;ooh!
      bar)$5 = 10
scheme@(guile-user)> (call-with-input-string "(list foo ;oh!\nbar)" read-with-comments)
$6 = (list foo #<<comment> str: ";oh!\n" margin?: #t> bar)
--8<---------------cut here---------------end--------------->8---

There’s a <comment> record type.

Now let’s see perhaps what we need to get ‘home-emacs-service-type’
merged, and what we can keep as future work.  Thoughts?

Ludo’.