From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 01 09:07:07 2023 Received: (at 60753) by debbugs.gnu.org; 1 Feb 2023 14:07:07 +0000 Received: from localhost ([127.0.0.1]:56894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNDlT-0007Db-83 for submit@debbugs.gnu.org; Wed, 01 Feb 2023 09:07:07 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:45583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNDlP-0007D2-MT for 60753@debbugs.gnu.org; Wed, 01 Feb 2023 09:07:06 -0500 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 5DC9B240008; Wed, 1 Feb 2023 14:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1675260417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2jQMfXOTsknEGbTe5sOuSWtHeb6VJwJyN508xPhdHeE=; b=hqJ/iloboz+Z44OnIxkJUD7DX9rTjgNYn6e6ZIRwCHAxFzRQFm9yJoiyvX1YOMKtq7hBQ9 K/XJcQAZijTgAOs0q0fA0WAjY2soOAiMRreb3mRq6EHZrLunF/isPCLuC23GR5pJS7UI60 ZunlUWPfcoaerU22ELVWDOyg9JyoDQkVz46Yva+1LIVro6uiP0euERxkqkbU5VXMZzlqCF 2IkV5JW3p8ABBY2KnKUyE25QGL2XDzPJrVa8SYYr4s+KOg9u5AeOYpaiWtfayPK55SyUhu ir+7H1KxN5gheOnqeqpBJPoiIxf1FLC8Imn8rIkm4HHKsNEnoxrD6VyvnIq9KQ== From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#60753] [PATCH] gnu: home: Add home-emacs-service-type. In-Reply-To: <87y1piu0u6.fsf@gnu.org> References: <87edrzzw9w.fsf@daviwil.com> <87v8lby7jq.fsf@daviwil.com> <87k01p8086.fsf_-_@gnu.org> <87cz7g2pkz.fsf@trop.in> <87mt6hjzyx.fsf@gnu.org> <87wn5l8bhz.fsf@trop.in> <87ilgx4kqg.fsf@gnu.org> <87v8ktvq99.fsf@trop.in> <87y1piu0u6.fsf@gnu.org> Date: Wed, 01 Feb 2023 18:06:51 +0400 Message-ID: <87sffpqy2s.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 60753 Cc: "\(" , David Wilson , 60753@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2023-01-31 17:26, Ludovic Court=C3=A8s wrote: > Hi Andrew, > > Andrew Tropin 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 =3D 10 > scheme@(guile-user)> (call-with-input-string "(list foo ;oh!\nbar)" read-= with-comments) > $6 =3D (list foo #< str: ";oh!\n" margin?: #t> bar) > --8<---------------cut here---------------end--------------->8--- > > There=E2=80=99s a 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=E2=80=99s see perhaps what we need to get =E2=80=98home-emacs-ser= vice-type=E2=80=99 > 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. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmPacfsACgkQIgjSCVjB 3rDluhAAkfK/QMnJXcUra3mqobY+rtkI86mjyT6fgaY8kFDu0NFWcXLghwohRax1 4s8/sFf8LDJGwmgZgl9Cr7+WmL4ocnmoPCccWaBzUVfXJr7vce3XTgEVAP4exICS BbVEVhkrJfZk2AKHDaGqGfVHMVsS5jIYEzLD4Ye5UfFMkrFJf1kqFeS1V/YWchO1 ppV9rM5V+IS9ViludZ1UY26c9RQprqkGHUGcZpxH+NNRQefNrfhEL89ZQrtBu5GQ vXjugmojrEtDs8R78RTJdufzPORGr8fUcUEhcDbsRW1DVZ7lgP5VA56MIavIeTuO iR8wARu8oZ//MwRCeWmp2mBA4efCveU78DiMk0lfo3jDwxO3L4PClAs5itEJacTf Vz3Sr1++/5lUw5P1oVYGiBIEZqyjLKG8Vz+kRlV1/PEwaF2uhRDSRcHtDioM/3a+ Xa9S8KrfmIZvmyp/JgxXJGZUVZ5QgPXrAoHarnORijxgFcOIbbOtyBdNTwvgb4Y4 /4Jz3TymwMYY761Dx2xnbZGCxLJJvvnAAdQZIKe1j9Ix6K1MFwfXvkM8/KoqQ0LO jiGzDIp1RIRaHiobboIa22bvHVl+Wa9Jr8TdrMVYnntDErlBv9fxyYoXVsM+SWm/ 86BRhx4HDRyIYIu+XQI7OK5HqDE7R93/Vk+PEAz1v7/bjEXANeo= =hT1d -----END PGP SIGNATURE----- --=-=-=--