From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 4EgSHyZ/ImaHNQEAe85BDQ:P1 (envelope-from ) for ; Fri, 19 Apr 2024 16:26:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 4EgSHyZ/ImaHNQEAe85BDQ (envelope-from ) for ; Fri, 19 Apr 2024 16:26:46 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=ZYRw6tp7; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713536806; a=rsa-sha256; cv=none; b=D5WscfWN105guEVIBIOX7wW3SwwZ/HbzfRjFAAi4UqIYoeMbJNKQx80SFYdDgEDTEEufit bKd7/5tEgUz8Jx9S5aeGJg1UlfihgojSXEw9/iWfPOaZKEnh1Ao4HrdI5dgAQ4q3T+y6Qz TGS4sEKa9N7yYwFoXzhfs3HvYpAZUsJizgrOgCifTSju+8i9sshfy7ciun1sk8YzuzMnUF mak+g0sFDDdk3/se4gMuLFFqvZ8RLAAl2vww7lX/rmLQVg39oKRxStPAD7jbErNVdib5J5 1/gUAogDqlh8I6i5Ieg2fVwb+/Siwyd3K1hPJVkOgBXH/vCoA/OyGfBoSLl61g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=ZYRw6tp7; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713536806; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=nsQdpXt7nBfVoveL2F/Ir6EsFuYaLQ/+xogmMBw7LCQ=; b=PqEsFZNzItLXWVbfhh9flhDC66+QUOAPF/TgG3HjOxm/GTicF4F44cqCrFvNU/rjAzIvXf MchU/OIU69UPgnHAUSlFMo5jFOrtHPMgTQ8Gn1E2N91VFQanuBfiqnIn025BnDaHUc1KeZ SlhekBS3nbm/tuje3BOeHTJkBjrei9j5eHUtNMgUYASTcEHEr0bG7HxCKy477jZJr32LH0 +EmXOxpuAAgYrY1rE+UjND6x/6+Mn3MK7aQF17kOhikEo9IQ2KZ59HA46ju2ctZ+y8hQTb 5hg3sISlTFhif3/JWRCnau0Hj4tRVo4g/afgOA3RBsHeHyc6WoLObSneby9iVw== 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 5289F77B9E for ; Fri, 19 Apr 2024 16:26:46 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxpBN-0004YP-QU; Fri, 19 Apr 2024 10:25:41 -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 1rxpBJ-0004VA-7m; Fri, 19 Apr 2024 10:25:37 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rxpBG-00085O-0P; Fri, 19 Apr 2024 10:25:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=nsQdpXt7nBfVoveL2F/Ir6EsFuYaLQ/+xogmMBw7LCQ=; b=ZYRw6tp7nfEuRdqAzM0A ec1tMj3OYYs86dsipeyiYcLtkMHsdRZ4Io8Z7vJYREAGqbfLzJu85lhx2VL4Ybu+kT11LkCW0rQNZ tZlALQjYBErnXdaYUQXV66tQhzNmMPKFWV4slj9nFkHMGL0J9GLhNo+WzRZ9z9Pf90RRawxhEoKYM pEvi0YnKT5il1kRpYGXenCczdKrZZVa4T/7mRPdldyGJ6/i6K86eqn1JHDfa/ealrg/PjatlnzZYk 83ctW/plyaAG/T5XgJCPVZ/G9pR/VE8dJXZBaGf8RCjc/PTjkKsjidLFRDJfbv8jB0kZyxhPcvvH9 Fw7jNBfGhiFkEg==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Nicolas Graves Cc: "Nicolas Graves via Development of GNU Guix and the GNU System distribution." , emacs-devel@gnu.org, Andrew Tropin , Stefan Monnier Subject: Re: [Nicolas Graves] [PATCH v6 01/10] rde: emacs: Start emacs in --daemon mode, with shepherd and pid-file In-Reply-To: <87cyqtnr5h.fsf@ngraves.fr> (Nicolas Graves's message of "Sat, 13 Apr 2024 18:50:18 +0200") References: <20240410234923.29319-2-ngraves@ngraves.fr> <875xwotg35.fsf@trop.in> <87zfu0m9ps.fsf@ngraves.fr> <87jzl22u5w.fsf@gnu.org> <87cyqtnr5h.fsf@ngraves.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Primidi 1 =?utf-8?Q?Flor=C3=A9al?= an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de la Rose X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 19 Apr 2024 16:25:28 +0200 Message-ID: <87v84de8fb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -11.15 X-Migadu-Queue-Id: 5289F77B9E X-Migadu-Spam-Score: -11.15 X-Migadu-Scanner: mx10.migadu.com X-TUID: d0alYiaipNY2 Hi, Nicolas Graves skribis: > (define (emacs-shepherd-service config name) > (shepherd-service > (documentation > (format #f "Emacs server. Use ~a to connect to it." > (if (eq? 'server name) > "@code{emacsclient}" > (format #f "@code{emacsclient -s ~a}" name)))) > (provision `(,(symbol-append 'emacs- name))) > (requirement '(emacs)) > (modules '((shepherd support))) ;for '%user-runtime-dir' > (start #~(make-systemd-constructor > (list #$(file-append > (home-emacs-configuration-emacs config) > "/bin/emacs") #$(format #f "--fg-daemon=3D~a" name)) > (list (endpoint > (make-socket-address > AF_UNIX > (string-append %user-runtime-dir > "/emacs/" #$(symbol->string name))) > #:name '#$(format #f "emacs-~a" name) > #:socket-directory-permissions #o700)) > #:log-file (string-append > (getenv "XDG_STATE_HOME") "/log" > "/emacs-" #$(symbol->string name) ".log"))) > (stop #~(make-systemd-destructor)))) Note that in this case the server is started lazily, the first time someone connects to the socket. You can pass #:lazy-start? #false if you instead want to start it upfront. > But I'm not sure it's better regarding user experience. On RDE we > implemented a notifier that parses the result of > herd eval root "(and=3D> (lookup-service 'emacs-server) service-status)" > thus giving a nice "Emacs is currently starting" notification. With socket activation, the service is immediately in =E2=80=9Crunning=E2= =80=9D state: starting it requires nothing more than accepting connections on the socket. (Maybe that=E2=80=99s one of the rare situations where sd-notify would help= ?) > This evaluation doesn't seem to work using make-systemd-constructor, > although it has its advantages (indeed launches a frame when available). > It would be nice if service-status could "sync" with > make-systemd-constructor in this case. > > I would be happy to send such a patch for Guix (is there already some > patch series on which to graft this?), WDYT @Ludo? Sure, feel free to send a patch for this; there are unfortunately several attempts at an Emacs service in the issue tracker, but none of them made it to the tree so far, in part because some were very ambitious. Thanks, Ludo=E2=80=99.