From: Andrew Tropin <andrew@trop.in>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: "\(" <paren@disroot.org>, David Wilson <david@daviwil.com>,
60753@debbugs.gnu.org
Subject: [bug#60753] [PATCH] gnu: home: Add home-emacs-service-type.
Date: Wed, 01 Feb 2023 18:06:51 +0400 [thread overview]
Message-ID: <87sffpqy2s.fsf@trop.in> (raw)
In-Reply-To: <87y1piu0u6.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2247 bytes --]
On 2023-01-31 17:26, Ludovic Courtès wrote:
> Hi Andrew,
>
> Andrew Tropin <andrew@trop.in> 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.
Yep, I already experimented with it, but it's not exactly what I'm
looking for, Jelle gave a few ideas and code snippets which looks closer
to what I searching. Pretty printer and read function are useful, but
not directly related to my question about reader.
>
> Now let’s see perhaps what we need to get ‘home-emacs-service-type’
> merged, and what we can keep as future work. Thoughts?
We have not perfect, but working quite good implementation of lisp
serializer in rde, which we use in rde's home-emacs-service-type:
https://git.sr.ht/~abcdw/rde/tree/d0ea604282c9aeb0b121f51979373b4aa40f9bcb/item/tests/rde/serializers/lisp-test.scm
https://git.sr.ht/~abcdw/rde/tree/d0ea604282c9aeb0b121f51979373b4aa40f9bcb/item/src/rde/home/services/emacs.scm#L93
But I'm not completely satisfyied with it and don't want to upstream it
in current state, I plan to experiment with Jelle's code and get a
feeling of how his approach works, also want to dive into reader
extensions topic. If I get satisfying solution I will share it. It can
take quite a while, so don't expect it to happen anytime soon; it can,
but unlikely :) If anyone want to work in parallel and propose
alternative implementation, I would be glad to give a feedback on it.
--
Best regards,
Andrew Tropin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2023-02-01 14:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 14:01 [bug#60753] [PATCH] gnu: home: Add home-emacs-service-type David Wilson
2023-01-12 17:24 ` ( via Guix-patches via
2023-01-12 17:27 ` David Wilson
2023-01-14 18:00 ` Ludovic Courtès
2023-01-15 8:02 ` Andrew Tropin
2023-01-17 9:02 ` Ludovic Courtès
2023-01-17 14:46 ` Andrew Tropin
2023-01-23 10:18 ` Ludovic Courtès
2023-01-26 5:06 ` Andrew Tropin
2023-01-31 16:26 ` Ludovic Courtès
2023-02-01 14:06 ` Andrew Tropin [this message]
2023-02-10 7:50 ` David Wilson
2023-02-20 11:10 ` Ludovic Courtès
2023-02-01 12:59 ` Jelle Licht
2023-02-01 13:46 ` Andrew Tropin
2023-01-26 18:50 ` Reily Siegel
2023-01-16 9:25 ` David Wilson
2023-01-15 0:21 ` [bug#60753] file like parameters not working benoit
2023-01-15 2:07 ` [bug#60753] issue with file-like init file benoit
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sffpqy2s.fsf@trop.in \
--to=andrew@trop.in \
--cc=60753@debbugs.gnu.org \
--cc=david@daviwil.com \
--cc=ludo@gnu.org \
--cc=paren@disroot.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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.