From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YPwwNprx9WJpkwAAbAwnHQ (envelope-from ) for ; Fri, 12 Aug 2022 08:22:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id eJkxNZrx9WJ8XwAAG6o9tA (envelope-from ) for ; Fri, 12 Aug 2022 08:22:18 +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 7C6913BC05 for ; Fri, 12 Aug 2022 08:22:18 +0200 (CEST) Received: from localhost ([::1]:51410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMO3l-0005O2-CE for larch@yhetil.org; Fri, 12 Aug 2022 02:22:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMO3W-0005Jh-Ql for guix-patches@gnu.org; Fri, 12 Aug 2022 02:22:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMO3W-0002ZK-Gy for guix-patches@gnu.org; Fri, 12 Aug 2022 02:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oMO3W-0007y8-Cc for guix-patches@gnu.org; Fri, 12 Aug 2022 02:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57069] [PATCH v2] etc: Add tempel snippets. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 12 Aug 2022 06:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57069 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Liliana Marie Prikler , 57069@debbugs.gnu.org Received: via spool by 57069-submit@debbugs.gnu.org id=B57069.166028526230517 (code B ref 57069); Fri, 12 Aug 2022 06:22:02 +0000 Received: (at 57069) by debbugs.gnu.org; 12 Aug 2022 06:21:02 +0000 Received: from localhost ([127.0.0.1]:55455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMO2Y-0007vw-4X for submit@debbugs.gnu.org; Fri, 12 Aug 2022 02:21:02 -0400 Received: from 5.mo550.mail-out.ovh.net ([178.33.45.107]:58527) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMO2V-0007vJ-24 for 57069@debbugs.gnu.org; Fri, 12 Aug 2022 02:21:00 -0400 Received: from player157.ha.ovh.net (unknown [10.110.115.5]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 07B3822A80 for <57069@debbugs.gnu.org>; Fri, 12 Aug 2022 06:20:56 +0000 (UTC) Received: from ngraves.fr (met42-h01-213-44-161-47.dsl.sta.abo.bbox.fr [213.44.161.47]) (Authenticated sender: ngraves@ngraves.fr) by player157.ha.ovh.net (Postfix) with ESMTPSA id 3A5FC2D7FDC57; Fri, 12 Aug 2022 06:20:54 +0000 (UTC) X-OVh-ClientIp: 213.44.161.47 In-Reply-To: References: <20220811060745.6892-1-ngraves@ngraves.fr> Date: Fri, 12 Aug 2022 08:20:53 +0200 Message-ID: <87czd69e4a.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 17385864887639728707 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeghedguddtkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffujghffffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepieetfeevudehjefhveeukeefheffgfejheeikefgveekteeiheejgfeliefghfeunecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkpheptddrtddrtddrtddpvddufedrgeegrdduiedurdegjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrudehjedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeehjedtieelseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehhedt 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" Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660285338; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=76wtUxqpQhBtz/ZfZnkFqkfC8FOdVrC0iJR+5FMvEMM=; b=WJUoyD+Na7NouOtPO7AWIPmPWGG3wdf4Bk9I+G8oblIONr4OiUkOHZXbuFa3nG0/jitc2T Zlz7D2cjVmoqJMyaTR3cM4YoAV9W5uPRmLhZs246HqSbYSjlIpfYjoqPksEULmj6SKnqEv OKyVdMWdE6ku0YidF1nXtYpJLjmtXDhdr6hy13vgFcUw/j4LmEh500aZ9Vvs2Ch/eHaMEH QedSca7w/lh6UAL6xlQvj0EGhD5lGc73oqjbGX/NnE41heG2lxn6wluvwcktXjEZheC+cY u6hPMQbKHSYkdSmsy5k42m3d+hvJQSQdLOWJXqYD3gaQRIylVFT5Mm2VSNvyZQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660285338; a=rsa-sha256; cv=none; b=TYllmUsiU2K+RtjFfdGwWJnx65vPi8WsYo0Z3Jr7OplGO71rl0QVRrPEkF88t96YDscLwE 4xikOu2+7CK3nmjpwB+7vVFGvy2fAIG9vK5RuDXXzUPILL9q+6UPtmWyBC2DtpJ48tVMut girRzbHvskGy1fRv89bxY1D/Hd7ElZz+fZ3X/14JEmBATkIZE2A7uRpBrKN1bo9z5/b1bo klZ5WLdexJ3Ts+wNZ0cGTd0hxWz5OnqAodKYvhVSbh0LB6mToc2VpLCPLFHJ4NBvFRC+0M Mkybqf6nVXdNoHv8XP9wtKjMxWUVE2t4sGTQTGdzaBNHyz6/Ns2TcK5VB6vdSA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -3.37 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: 7C6913BC05 X-Spam-Score: -3.37 X-Migadu-Scanner: scn1.migadu.com X-TUID: TMEgSnbmr4dN On 2022-08-11 18:21, Liliana Marie Prikler wrote: > I'm not too sure about the suffix here. I'd personally prefer a > suffix-less file with a mode-line. OK, I thought it was necessary because of a previous failed attempt, but it seems to work. The tempel path cannot be a directory though, it is necessary to put a wildcard (at least using this version of TempEL). >> +text-mode :when (git-commit-mode) Here I have a bug when magit has never been opened before opening a text-mode file, saying that git-commit-mode is not defined. Not sure what the best way to resolve this is. Will investigate that. > I'd suggest skipping the completing-read and just (p "gnu"). Most > build systems should be easy enough to type without autocompletion. But then you have to know the name and loose the listing if you're a beginner and not sure. I'm fine with both options. I will follow your suggestion if you confirm that you took this type of user into account and still prefer just (p "gnu"). > Here, I think (p "url-fetch"), but (s "method") might also work. I'm not sure I understand what you meant here. Can you write the final method you would get this way? > Will this cl-case be dynamically recomputed? I wonder if we can get > the result of the previous p/s here... Yes it is recomputed. p/s stores the variable and for evaluations "Named fields are lexically bound." It works when tested, we can get the result of the previous p. As Daniel Mendler stressed here (https://github.com/minad/tempel/issues/65), there is no possibility to do a recursive template i.e. with a FORM evaluating to elements of a snippet. So the best thing we might do with conditionals is to return a string. > Rather than that I think adding a template (git-file-name...) which > expands to (file-name (git-file-name (p "name") (p "version")) and > variants for the others is a better idea. In most guix packages, it is left as simply name and version strings, since they are defined for the package itself. I took the same approah as the yasnippet template, since these field are almost always left untouched. I don't see the benefit of this other approach. Your other comments have been taken into account, I'm sending an updated series as soon as I'm done with the git-commit-mode issue. Feel free to send an idea for this issue if you have one! -- Best regards, Nicolas Graves