From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2JBLLRC5pmWscAEAqHPOHw:P1 (envelope-from ) for ; Tue, 16 Jan 2024 18:12:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 2JBLLRC5pmWscAEAqHPOHw (envelope-from ) for ; Tue, 16 Jan 2024 18:12:48 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="G/gj3EEr"; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=QtOM7yM8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705425168; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=Rc8Q72NAC0F3tzOzOwvt4aZEb58kHG1uI9g1kmRAngA=; b=uk6HWfV+ZmYLCm8ths7+z0Pf2jTzLxgcjnmKuaJ+y2zVddQl8qjh1DYrAPMUyDYRLOCzEo dPRao8mgGpV8lXwHH+Jd/sOOHlIzwhzcrGq2SffW+3zpEFEXIk3euf0ewcuugryzu0BGDo Xm9V4QpfXXg4Ahj+T3IjP0ToxvpTUswq0oY/3FhokEZis9EPdW6zJiGqaF84mOGMPqGSdO 1wX7cm1+yFw+JwgvIrD+wC8sPsMdA7SKcpo4VjVskrJOgkYrDMvOFdBuan+i7h/2jw3kIo q/w19+X0zqPhpMyC6FwISfEUdPvHJM8LiQb8dP3yLftbPT147qGseWbtDksRTw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705425168; a=rsa-sha256; cv=none; b=GIBgyGwc4TnabMfUPbxYB0ahGu1dxVIrLtlgnYW5ZEHSIoDE3HaKQeknP7/oVkZwQBv5+Z S842Ae8muNrOnKkq0Lcg+Zk9tNNdHZYKn9NIG/FcIGVZHSLbxb3RZmWf6KbxFP7WLg8aif 5BAGSW5YWHhm+FFtnMx6hgBXE85NkEIwys86J9yWM/ITljJRi1Uf8pAQueK0s5uSJ4JO5G 0L9j36euWIhWlKqnoQNtvbSshZicjM//JXCc1KSvPLSuD5P3RlnVDsEmIiXEWuMIMy3nCW j4fOS2JZcBQnM9sJ8Fwbib/DoX4zsWvkeHrVXhRP8qQ1nfowy+fucecBwtfUsQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b="G/gj3EEr"; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=QtOM7yM8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none); 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" 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 40790E7B5 for ; Tue, 16 Jan 2024 18:12:48 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPmyv-0003Kd-65; Tue, 16 Jan 2024 12:12:09 -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 1rPmyo-0003Ix-NC for guix-patches@gnu.org; Tue, 16 Jan 2024 12:12:02 -0500 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 1rPmyo-0002VR-EN for guix-patches@gnu.org; Tue, 16 Jan 2024 12:12:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rPmyo-0006w1-T3 for guix-patches@gnu.org; Tue, 16 Jan 2024 12:12:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68354] [PATCH v2 2/2] etc: snippets: Add skeletons for scheme-mode. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 Jan 2024 17:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68354 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68354@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz> Received: via spool by 68354-submit@debbugs.gnu.org id=B68354.170542508126515 (code B ref 68354); Tue, 16 Jan 2024 17:12:02 +0000 Received: (at 68354) by debbugs.gnu.org; 16 Jan 2024 17:11:21 +0000 Received: from localhost ([127.0.0.1]:49632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPmy8-0006ta-MK for submit@debbugs.gnu.org; Tue, 16 Jan 2024 12:11:21 -0500 Received: from wolfsden.cz ([37.205.8.62]:34414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1rPmy5-0006tK-Dv for 68354@debbugs.gnu.org; Tue, 16 Jan 2024 12:11:18 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 5043B2529F1; Tue, 16 Jan 2024 17:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1705425076; bh=TLcYHIorjI6O95x4WW4ACmbUKgIRaWTVI1bprryE//U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=G/gj3EErEoy72trPXTpXX3k80g8MKLwTojvp7cTi2U2UZChxixPREUXR95VCaOzY/ QfCE8tAMcz8W6DEitFwgrR8Alh83UJm28+aRFcTUVDPEQxq7CLZbtt9qHDw6xeA+uq p1YtJrFXeLUgBOrcdJZFVBpGHa1vQmn6AC4v+eGoulgWH+Ccj4B1maoAWSw7iF1yQf fiNHH17dDjtggAnhxEDEwCZiX+Q1cvV01zZnldkWwUXQt0ZGTqh3uwKU3n73Yf/NxE gI/SghYgo+27y4FX/vD23CRJ5bnBEjphHLsFZ/NmiTMrVTnWUqmEUQ4kKRZUsOlEpx LLsGpXBgsk0cHQVYlptIi3dfQm6L5/Y+aWjw+gwfiuFEQOiBpWPQ0nbUYQIeyWhoTb aCuBTdnjXlaqVqlyOND9qumwRFTCk3kgfE4eIeVGF5LI57L1RpAV+gPifD3xQY2bN9 MO/CgR8NJZV6t3DewrjRb+r6vsEUbxPPRrAmipqDGoILVr4Jz5bOrtCQxjNV1xyOhz h9HJlEEiKzBfjje4EurRYQlVZkS3by/gHARHWgDVPJFSlg6x2bYHml/XPEBYUwLWNb RLLsdS+1YrudZPA7xVqslrCUZWpImZXG0wWtQnVsByy3KzT9GmC9NtZ0Er3UCWvxyy Eo4mN6qMn61h76j9P7UCmThg= Received: from localhost (unknown [81.17.16.72]) by wolfsden.cz (Postfix) with ESMTPSA id BB78A256F17; Tue, 16 Jan 2024 17:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1705425075; bh=TLcYHIorjI6O95x4WW4ACmbUKgIRaWTVI1bprryE//U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QtOM7yM8kTqKrlUGmALSYckgcrIyxdfOo68drKRttxf6ex4L/y1qnEyAOLnpsW229 lgU984YchzQvAMTc8//EqT3xjXnGspP+eFJaMF+WDuzWZ+QssoAOV1PX/YD5+sn9Tl dDScBK6vt0iYwrIAB/nxgp1qIEse4Q0FC9KTkTxRL+WTQ/GxpCAlZ8OCdKSs0JzTQk cx3muecyvOqUcXuC5HuVru1lVYZTgaMHHP5YFyaKfa3xBXjhHI9iLYZchloSVSKaz/ VRBhzDVo/eYvhBdBuj/YEF/bKijmCQqH0nJDX404IIP8C2xh0eajh6kgLBn7DVuZ5D oJvhHG9UAKpEHcKsTP8LGSR/JchGDI0Ym5dLjamEwIITq+mJr2UXCt5toisHrdjVj3 u1xNgGQ8vQh53K4u74xqBcv2lQh8fzVIgAIk8z/k1s7IftzWMq/fm+NhSJI9whRV4j C4bqGDU6SBN9JziTRq2X70VIwVeBXB9DkZNwt4cnIrKHveuqJT08hXQxb+e+dqS1yf OI/U4aFShxz2QrfN1VC+wl0T2Qc0GuT2Hg3h8xr0M5raQ4BMfDuywpiMMn5gfOd7NG 1a7/vnBYPo61oTQ5y6uEXuIxaYTqGPgn8Bnu5YohN1V5ELBI0j73raxttguQVDaQAp mSUXfYESWn/BV/zJEoCv5P/s= From: Tomas Volf <~@wolfsden.cz> Date: Tue, 16 Jan 2024 18:10:13 +0100 Message-ID: <7aed6e3ca232c3a6542abfe21fc35147d30e448e.1705425013.git.~@wolfsden.cz> X-Mailer: git-send-email 2.41.0 In-Reply-To: <12887de50dc01339faf03aa66d298f1e16ec7b18.1705425013.git.~@wolfsden.cz> References: <12887de50dc01339faf03aa66d298f1e16ec7b18.1705425013.git.~@wolfsden.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: mx10.migadu.com X-Migadu-Spam-Score: 3.81 X-Spam-Score: 3.81 X-Migadu-Queue-Id: 40790E7B5 X-TUID: bntWELUbu63t Some people use just plain old skeleton system, which comes with Emacs. This commit adds skeletons for generating package definition and some other common parts. * etc/snippets/skeleton/scheme.el: New file. * doc/contributing.texi (The Perfect Setup): Document it. Change-Id: Ided31c06266b0d3c70ae1e050ae8694fd5e47751 --- v2: * Fix whitespace in the guix-insert-origin. doc/contributing.texi | 22 ++++++ etc/snippets/skeleton/scheme.el | 117 ++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 etc/snippets/skeleton/scheme.el diff --git a/doc/contributing.texi b/doc/contributing.texi index 1311098dfc..b5ee046c0a 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -380,6 +380,28 @@ The Perfect Setup The commit message skeletons depend on @url{https://magit.vc/, Magit}. +Additional skeletons for editing the package definitions are provided in +@file{etc/snippets/skeleton/scheme.el}. + +@cindex @code{M-x guix-insert-package} +@cindex @code{M-x guix-insert-origin} +@cindex @code{M-x guix-insert-git-reference} +@cindex @code{M-x guix-insert-hg-reference} +@cindex @code{M-x guix-insert-svn-reference} +@cindex @code{M-x guix-insert-bzr-reference} +@cindex @code{M-x guix-insert-cvs-reference} +@cindex @code{M-x guix-insert-:phases} +Once you load the file, the following functions are provided: +@code{guix-insert-package}, @code{guix-insert-origin}, +@code{guix-insert-git-reference}, @code{guix-insert-hg-reference}, +@code{guix-insert-svn-reference}, @code{guix-insert-bzr-reference}, +@code{guix-insert-cvs-reference} and @code{guix-insert-:phases}. They +do what you would expect based on the name, inserting the implied +snippet while asking for data to fill in. @code{guix-insert-:phases} +inserts commonly used snippet to edit phases for the package. + +The scheme skeletons might depend on paredit for correct indentation. + @cindex insert or update copyright @cindex @code{M-x guix-copyright} @cindex @code{M-x copyright-update} diff --git a/etc/snippets/skeleton/scheme.el b/etc/snippets/skeleton/scheme.el new file mode 100644 index 0000000000..4e6ddad0dc --- /dev/null +++ b/etc/snippets/skeleton/scheme.el @@ -0,0 +1,117 @@ +;;; scheme.el --- skeletons for scheme-mode -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Tomas Volf + +;; Author: Tomas Volf <~@wolfsden.cz> +;; Keywords: convenience + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Code: + +(define-skeleton guix-insert-package + "Insert a Guix package definition." + "Name: " + "(define-public " str + \n"(package" + \n "(name \"" str "\")" + \n "(version \"" (skeleton-read "Version: ") "\")" + \n "(source " _ ")" + \n "(build-system " (skeleton-read "Build system: " "gnu") "-build-system)" + \n "(home-page \"" (skeleton-read "Homepage: ") "\")" + \n "(synopsis " (format "%S" (skeleton-read "Synopsis: ")) ")" + \n "(description " (format "%S" (skeleton-read "Description: ")) ")" + \n "(license license:" (skeleton-read "License: " "unknown") ")))" + \n) + +(define-skeleton guix-insert-origin + "Insert a Guix origin definition." + nil + '(setq v1 (skeleton-read "Method: " "url")) + '(setq v1 (if (string-search "-fetch" v1) + v1 + (concat v1 "-fetch"))) + "(origin" + \n"(method " v1 ")" + \n"(uri " (let ((skeleton-end-newline nil)) + (pcase v1 + ((or "git-fetch" "git-fetch/lfs") + (guix-insert-git-reference)) + ("hg-fetch" + (guix-insert-hg-reference)) + ("svn-fetch" + (guix-insert-svn-reference)) + ("bzr-fetch" + (guix-insert-bzr-reference)) + ("cvs-fetch" + (guix-insert-cvs-reference)) + ("url-fetch" + (insert (format "%S" (skeleton-read "URI: "))))) + nil) + ")" + \n (pcase v1 + ((or "git-fetch" "git-fetch/lfs") + "(file-name (git-file-name name version))") + ("hg-fetch" + "(file-name (hg-file-name name version))") + ((or "svn-fetch" "bzr-fetch" "cvs-fetch") + "(file-name (string-append name \"-\" version \"-checkout\"))")) + & \n"(sha256" + \n "(base32" + ;; Hash of an empty directory + \n (format "%S" "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5") ")))") + +(define-skeleton guix-insert-git-reference + "Insert a Guix git-reference definition." + nil + "(git-reference" + \n"(url \"" (skeleton-read "URL: ") "\")" + \n"(commit \"" (skeleton-read "Commit / Tag: ") "\"))") + +(define-skeleton guix-insert-hg-reference + "Insert a Guix hg-reference definition." + nil + "(hg-reference" + \n"(url \"" (skeleton-read "URL: ") "\")" + \n"(changeset \"" (skeleton-read "Changeset: ") "\"))") + +(define-skeleton guix-insert-svn-reference + "Insert a Guix svn-reference definition." + nil + "(svn-reference" + \n"(url \"" (skeleton-read "URL: ") "\")" + \n"(revision \"" (skeleton-read "Revision: ") "\"))") + +(define-skeleton guix-insert-bzr-reference + "Insert a Guix bzr-reference definition." + nil + "(bzr-reference" + \n"(url \"" (skeleton-read "URL: ") "\")" + \n"(revision \"" (skeleton-read "Revision: ") "\"))") + +(define-skeleton guix-insert-cvs-reference + "Insert a Guix cvs-reference definition." + nil + "(cvs-reference" + \n"(root-directory \"" (skeleton-read "Root directory: ") "\")" + \n"(module \"" (skeleton-read "Module: ") "\")" + \n"(revision \"" (skeleton-read "Revision: ") "\"))") + +(define-skeleton guix-insert-:phases + "Insert a Guix #:phases snippet." + nil + "#:phases " \n + "(modify-phases %standard-phases" \n + _ ")") +;;; scheme.el ends here -- 2.41.0