From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kOQnMYFa6mT+NwEAauVa8A:P1 (envelope-from ) for ; Sat, 26 Aug 2023 22:03:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kOQnMYFa6mT+NwEAauVa8A (envelope-from ) for ; Sat, 26 Aug 2023 22:03:13 +0200 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 4F3FC5BB98 for ; Sat, 26 Aug 2023 22:03:13 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=jg1zbPMp; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693080193; a=rsa-sha256; cv=none; b=aWx94Lu4DbyZfRTG5WpV0GsW5NE5+V/Dko5wmFexMj8XElYT/BLiyjNkUz8g+50045RMXi 8UWN/c5aMHL9w+fyW2fNCNl7w4lwoXzSN39y2uDmrZOC/T1vq260cyMnVnVeWwGCh6Q2PU yTov0Qh58wuiM6GmTqeU7qK4mh5smtC4DdW+zyAfBKf17f7orOIZux2t3J65Kw2QzGxv1v 875V5JE0W3csyzNPoN2G3GLbEBNxqnB4COVCqvzuoA0L+1WJqMyLAuOymMjzbZVnw0NjhZ 9fn1Z0Nws1+JHRVefJYV+b4G+JcohpM/ipAcQSt66oXEgCfDc0gIgYZu1AdD7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=jg1zbPMp; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693080193; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=Vo+9dB/zoPxbf+fx+J7lyK+EnhZjIXzga2vDzMkVjUA=; b=JscFF0DLfJDSdeL+Fpn+NQKPP8Fjx9z5rp0L2uaIH920T5jPqXlquTFCLUoCHfpv7648j3 oTS/zfII8+vNUSt71KAdZBrLlMUWZrqaXLY0YM/tzqQACfddcmsj5M9AC9P41LfHRaupjc y+ENeIcO2o1+mOCYxxY+eutr0xFwBXQFzdj2oHYKh+QmLh0azbc7KqssOgdZi1KryLx/KB 4/4cwu383+q1FUBlTMie1zfbP6VlfsTWuUlLLX2UZUh66XGSIxJBEECjo9nJyN9xyghZsj B4vdWysZI3jkDWGEK//FKDs/++D/vNjZjmbmmu5A1yJLox8ubJyjw8X8G+GAfA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZzUp-0003n2-FU; Sat, 26 Aug 2023 16:02:59 -0400 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 1qZzUn-0003mu-Dd for guix-patches@gnu.org; Sat, 26 Aug 2023 16:02:57 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZzUm-0005Ef-K1 for guix-patches@gnu.org; Sat, 26 Aug 2023 16:02:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZzUr-0000yL-Tk for guix-patches@gnu.org; Sat, 26 Aug 2023 16:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64620] [PATCH] gnu: home: Add home-emacs-service-type. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 Aug 2023 20:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64620 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Kierin Bell , 64620@debbugs.gnu.org Received: via spool by 64620-submit@debbugs.gnu.org id=B64620.16930801283670 (code B ref 64620); Sat, 26 Aug 2023 20:03:01 +0000 Received: (at 64620) by debbugs.gnu.org; 26 Aug 2023 20:02:08 +0000 Received: from localhost ([127.0.0.1]:43492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZzTx-0000x3-R9 for submit@debbugs.gnu.org; Sat, 26 Aug 2023 16:02:08 -0400 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]:48208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZzTs-0000wV-Vl for 64620@debbugs.gnu.org; Sat, 26 Aug 2023 16:02:04 -0400 Received: by mail-ed1-x541.google.com with SMTP id 4fb4d7f45d1cf-52683b68c2fso2782549a12.0 for <64620@debbugs.gnu.org>; Sat, 26 Aug 2023 13:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693080109; x=1693684909; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Vo+9dB/zoPxbf+fx+J7lyK+EnhZjIXzga2vDzMkVjUA=; b=jg1zbPMpY7P2eisik/ydLu5PrgJSWJ24R3Po0OMi0XxjJVj3fndXw2+1XurRthxSQV vL1WOKJJ6RBpNzD2/aLzJKmkprRlMnK11fWJfK00xAl3kWCrHQimkrsPp7NC8IAb+3aM n2OY7gSmedbwJpmRcIPQV9/lYUaksebBPy3UEzYkVsWW1I9RQoVjJrAuWFOjEr+sEzn0 OkUjhuwcXEBBUGDFme4YDhEj8erksxKsf51kMgwSrx71j5uODeUhCfWjOkMnuZYDZWrZ FrLUjybUgDI2pIq+ioiq1JJTn6ePbHwRW6/5qSy+xYUiW8DNnZuAvg3NVX8LzF4CKFQg n/GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693080109; x=1693684909; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Vo+9dB/zoPxbf+fx+J7lyK+EnhZjIXzga2vDzMkVjUA=; b=DPFpQEYKxDB4G2QjKq+t2RYn6Cua+hXbTD9yfX9iQlp9USt0d+ddrtCMai87/28jkQ ysJVh9NVoo9MQrMAZWjYQMsJSySj2lgSuHzftuo/2VGVn5fBOXY+PxKNGt6n7snG7UWk 0m+YLPI04LeqdnlMJosbwD9tuuDcWb9mTVa5e3gNDWPh839JCBBmICE44DEeejcSN8U2 mC/HVLX23VW05UsduRuuzk7439EOH9ILfCveXASLOLqa3vpvJ436wo/DEcDdEuoMIYlE bdrgnTzsHcQFKxEz9J0NCppJGstPWGNmF40OtGVBiLfVlSom+Erpi0GcbzApQyjR8NXc nqAg== X-Gm-Message-State: AOJu0Yzl2A9CioPbHZi88OcWbB6RngrR1xGouJQJiiXjMfkefehWaoBZ VnwlE4vPbBz66jxgjDR4UJursa1cuIGm9A== X-Google-Smtp-Source: AGHT+IGjSbVDX4HW8L1t8KNEVpmMHenTveRNJbE5y7pbG1kyeFJv9FEBG4lf0YhEFIZO9jn7s9tMyw== X-Received: by 2002:aa7:d5c5:0:b0:523:1410:b611 with SMTP id d5-20020aa7d5c5000000b005231410b611mr16261415eds.25.1693080108748; Sat, 26 Aug 2023 13:01:48 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id da25-20020a056402177900b0052a626daf4csm142581edb.47.2023.08.26.13.01.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Aug 2023 13:01:47 -0700 (PDT) Message-ID: From: Liliana Marie Prikler Date: Sat, 26 Aug 2023 22:01:46 +0200 In-Reply-To: <0173e076aafb6ec389a7ebca5d56b7f4e8a02b6e.1689347338.git.fernseed@fernseed.me> References: <0173e076aafb6ec389a7ebca5d56b7f4e8a02b6e.1689347338.git.fernseed@fernseed.me> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 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 X-Migadu-Scanner: mx0.migadu.com X-Spam-Score: -5.12 X-Migadu-Queue-Id: 4F3FC5BB98 X-Migadu-Spam-Score: -5.12 X-TUID: mw18TvLd4RCA Am Freitag, dem 14.07.2023 um 11:12 -0400 schrieb Kierin Bell >=20 > * gnu/home/services/emacs.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add new file. > * tests/home/services/emacs.scm: New tests file. > * Makefile.am (SCM_TESTS): Add new tests file. AFAIK we use "Register" instead of "Add". > * doc/guix.texi (Emacs Home Services): New node. I'd cut this series into two (or more, see below) patches right around here, putting everything below this line into the first patch(es) and everything above into the second/nth. > * guix/read-print.scm (read-with-comments, read-with- > comments/sequence): > Add new ELISP? and UNELISP-EXTENSIONS? keyword arguments to support > reading Elisp. > (%newline-forms): Add `home-emacs-configuration'. > (%elisp-special-forms, %elisp-natural-whitespace-string-forms) > (%elisp-special-symbol-chars, %elisp-confusable-number-symbols) > (%elisp-basic-chars, %elisp-simple-escape-chars): New variables. > (special-form-lead, printed-string, symbol->display-string): Add new > ELISP? keyword argument. > (atom->elisp-string): New helper function. > (pretty-print-with-comments): New ELISP? and SPECIAL-FORMS keyword > arguments to support serialization to Elisp.=C2=A0=C2=A0 > General improvements: > enable pretty-printing of alists and improper lists; only print lists > of > constants with one element per line when length exceeds LONG-LIST; do > not print newline before special read syntax forms (e.g., `'', `#~', > etc.) unless they would exceed MAX-WIDTH; include backslashes when > calculating whether a string would exceed MAX-WIDTH; do not print > extraneous newline when special form has an empty body; print > newlines > after list arguments of special forms; print first argument after > function on newline with same indentation as function when it would > exceed MAX-WIDTH. > * tests/read-print.scm: Add new tests and update old tests which fail > due to improvements. These general improvements should perhaps also been given their own patch(es). Also, since read-print is used in guix style, I'd be interested in seeing how the output improves from your changes. Do you have easy comparisons? > --- >=20 > This patch builds on patches from ( and David Wilson for a > `home-emacs-service-type' (https://issues.guix.gnu.org/58693, > https://issues.guix.gnu.org/60753, > https://issues.guix.gnu.org/62549). >=20 > Many of the features of the prior patches have been included, but the > major focus here is to configure Emacs in Scheme rather than > symlinking > to existing configuration files. >=20 > Here are some of the broad strokes: >=20 > * The following record types have been introduced to encapsulate > =C2=A0 configuration for Emacs: `emacs-configuration' (for general > =C2=A0 configuration), `emacs-package' (for package-specific > configuration), > =C2=A0 `emacs-keymap' (for configuration of local keymaps), and > =C2=A0 `emacs-server' (for configuration of Emacs servers). >=20 > * Most configuration fields are either flat lists or alists that are > =C2=A0 considerably abstracted from their final serialized Elisp > =C2=A0 representation, but escape hatches are provided for both pulling i= n > =C2=A0 existing configuration files and specifying s-expressions directly= . >=20 > * All serialized Elisp is pretty-printed much how we would expect to > see > =C2=A0 it in Emacs (for example, with proper indentation according to the > =C2=A0 `lisp-indent-function' symbol property, etc.).=C2=A0 This has been > =C2=A0 accomplished by adding a new keyword argument to > =C2=A0 `pretty-print-with-comments' from `(guix read-print)', among other > =C2=A0 improvements. >=20 > * Emacs package configuration can either be serialized as `use- > package' > =C2=A0 forms or as equivalent, more minimalist s-expressions.=C2=A0 Users= can > =C2=A0 define their own package serializers, too. >=20 > * For specifying s-expressions, an "Elisp expression" syntax has been > =C2=A0 implemented that is essentially a lighter-weight version G- > expressions. > =C2=A0 (I try to explain why this is helpful in the documentation.) >=20 > * A reader extension has been implemented that allows for "Elisp > =C2=A0 expressions" to be specified directly with Elisp read syntax, and > =C2=A0 Scheme values (including file-like objects or G-expressions) can i= n > =C2=A0 turn be "unquoted" within that Elisp code.=C2=A0 Also, comments an= d > =C2=A0 whitespace can be included within the Elisp code via the `#;' > =C2=A0 (comment), `#>' (newline), and `;^L' (page break) forms. >=20 > * Each Emacs server has its own user init and early init files, which > =C2=A0 can optionally inherit configuration from the init files used by > =C2=A0 non-server Emacsen.=C2=A0 Each server can also inherit the "main" > =C2=A0 `user-emacs-directory', or it can use its own subdirectory. >=20 > * The `home-emacs-service-type' can be extended, with subordinate > =C2=A0 configuration records being merged intelligently when possible. >=20 > * A utility function has been provided for generating the > aforementioned > =C2=A0 Scheme records from an existing Emacs init file: > =C2=A0 `elisp-file->home-emacs-configuration'. >=20 > Here's an example configuration for the `home-emacs-service-type' > demonstrating some of these features: >=20 > --8<---------------cut here---------------start------------->8--- > (use-modules (gnu home) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (gnu services) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (guix gexp) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (gnu home services) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (gnu home services emacs) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (gnu packages emacs-xyz) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (gnu packages file) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = (gnu packages compression)) >=20 > (define %my-function-name 'my--compose-mail) >=20 > (define %gnus-init-file > =C2=A0 (elisp-file "gnus.el" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 (list > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (elisp (setq gnus-select-method '(nnnil ""))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (elisp (setq gnus-secondary-select-methods > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A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2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :stream tls= )))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ;; Elisp reader extension > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 #%(define-key global-map [remap compose-mail] > #;comment > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '#$%my-function-name nil)))) I assume that each elisp or #% only handles a single expression, am I correct? Or do we also have (elisp a b) and #%@(a b)? Cheers