From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cBfmLU5y2mNneAEAbAwnHQ (envelope-from ) for ; Wed, 01 Feb 2023 15:08:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YBC3LU5y2mM2AgAAauVa8A (envelope-from ) for ; Wed, 01 Feb 2023 15:08:14 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5AD523404 for ; Wed, 1 Feb 2023 15:08:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNDmN-0001i8-On; Wed, 01 Feb 2023 09:08:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNDmM-0001hV-Cl for guix-patches@gnu.org; Wed, 01 Feb 2023 09:08:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNDmM-0005pG-4c for guix-patches@gnu.org; Wed, 01 Feb 2023 09:08:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNDmL-0007FL-Vw for guix-patches@gnu.org; Wed, 01 Feb 2023 09:08:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60753] [PATCH] gnu: home: Add home-emacs-service-type. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Feb 2023 14:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60753 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: "\(" , David Wilson , 60753@debbugs.gnu.org Received: via spool by 60753-submit@debbugs.gnu.org id=B60753.167526042727755 (code B ref 60753); Wed, 01 Feb 2023 14:08:01 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675260494; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=2jQMfXOTsknEGbTe5sOuSWtHeb6VJwJyN508xPhdHeE=; b=bb/JJZGBL/71qZ/ncOmRwgW2W2K2KUjSs6VU16Lcrw3JKY4LirqvTaxW1A1zvgyBjo5MlF W8qlFya9HXyELBbJyjUtEl7V1aD6ia3mb8ajvaRRyW7fUQMCmaaodV/zom/4ItU6zF+BTv dgoZHx8Mwt++RCepQM5xqHkbTq4mhQ1RzshdJEUQHFqQTozu1hubk1tqYq+hIGH7TLz07S z5d0lyAhTJvuN8Pb6p88HVKhAAN8gUNFt69R74lOrNWOfKrjL3d8uVWMfZkGT9dau06deD HNCKW2IPlK9GCj1XI9Vjg8hPasuNcXw0xWNoRceSS9QdqqwHJWNr0wE2IpwgPg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b="hqJ/ilob"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675260494; a=rsa-sha256; cv=none; b=O/uBkauie8p9w2JEaPJySlvvFx3q30tnT19fXKIzgzCOLzoeV1tqXYHBd6j2GJzR+Nwj+4 bx1QOyrBrKrGs8P2YuYvsNxqOqNfUvpkwcVREdxTQqsVPJ/KsdstwtI6JtMd4WO6TAGfs3 yJQjSwArEN2l1SkIuN6LmfChK3mTdSj4rfZXbvlZxHy9obSu0SL9gIsCR7vRuhf8UC/u8q 2yl1HMbLhBnHqXh1QcFFc2So5SN57YhQT7urgiabSodhuEIY0QMlpRKfGGg/ViRak3mHWg ZKzEgYsPgZixykdky7V1lnDIRrpX2y02RoP/ypDPke7t4T2/Uv3hk0QCNCYkGg== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b="hqJ/ilob"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Scanner: scn0.migadu.com X-Spam-Score: -2.78 X-Migadu-Queue-Id: 5AD523404 X-Migadu-Spam-Score: -2.78 X-TUID: aqLTN5xyE9uS --=-=-= 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----- --=-=-=--