GNU bug report logs - #57069
Tempel snippets

Previous Next

Package: guix-patches;

Reported by: Nicolas Graves <ngraves <at> ngraves.fr>

Date: Tue, 9 Aug 2022 10:17:02 UTC

Severity: normal

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57069 in the body.
You can then email your comments to 57069 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Tue, 09 Aug 2022 10:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Graves <ngraves <at> ngraves.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 09 Aug 2022 10:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: guix-patches <at> gnu.org
Cc: Nicolas Graves <ngraves <at> ngraves.fr>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Tempel snippets
Date: Tue, 09 Aug 2022 12:16:21 +0200
The first patch of this series introduces the equivalent of current
yasnippet templates, with the alternative package tempel.

I eventually chose to make a new folder in snippets dir, and to move
yasnippet files, hope it's OK.

It works quite well for me now, but can be improved:

- I selected completing-read for completion because I'm still learning
  emacs and didn't tackle completion-at-point for now. Would that be
  better?

- Nested snippets don't seem to work that well (e.g. expanding
  git-fetch... within the edition of an origin... expansion), I had
  quite a few bugs. Seems better to finish the current snippet before
  tackling a sub-snippet (for now at least).

- I couldn't match a small part of current yasnippet configuration,
  currently only the part in uri when url-fetch is chosen. Sent
  a "help/feature report" here https://github.com/minad/tempel/issues/65.

If this is possible, we could probably further factorize and integrate the
snippets logic, maybe to reach something like that for origin
expansion.

(origin...
 (let*
     ((method-list
       '(url-fetch
         url-fetch/tarbomb
         url-fetch/zipbomb
         cvs-fetch
         git-fetch
         hg-fetch
         svn-fetch
         bzr-fetch))
      (uri (cl-case method
             ('git-fetch '("(git-reference" n>
                           "(url " p ")" n>
                           "(commit " p "))"))
             ('svn-fetch '("(svn-reference" n>
                           "(url " p ")" n>
                           "(revision " p "))"))
             ('hg-fetch  '("(hg-reference" n>
                           "(url " p ")" n>
                           "(changeset " p "))"))
             ('cvs-fetch '("(cvs-reference" n>
                           "(root-directory " p ")" n>
                           "(module " p ")" n>
                           "(revision " p "))"))
             ('bzr-fetch '("(bzr-reference" n>
                           "(url " p ")" n>
                           "(revision " p "))"))
             (t              '("(string-append https://" p ".tar.gz)"))))
      (fname (cl-case method
               ('git-fetch '("(file-name (git-file-name name version))" n>))
               ('svn-fetch '("(file-name (string-append name \"-\" version \"-checkout\"))" n>))
               ('hg-fetch  '("(file-name (hg-file-name name version))" n>))
               ('cvs-fetch '("(file-name (string-append name \"-\" version \"-checkout\"))" n>))
               ('bzr-fetch '("(file-name (string-append name \"-\" version \"-checkout\"))" n>))
               (t              '("")))))
   "(origin" n>
   "(method \"" (p (completing-read "method:" method-list nil t)) "\")" n>
   "(uri " uri ")" n>
   fname
   "(sha256" n> "(base32 \"" p "\")))" n>))

The next patches are just new patches proposals, including :phases and
licenses. Also note that there were 3 or 4 missing build-systems in the
yasnippet template (might add them in a patch here).

-- 
Best regards,
Nicolas Graves




Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Tue, 09 Aug 2022 10:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 57069 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH 1/4] etc: Add tempel snippets.
Date: Tue,  9 Aug 2022 12:24:37 +0200
* doc/contributing.texi:
  - adding configuration description for tempel snippets.
  - adapting yasnippet configuration to directory move.
* etc/snippets/tempel/*.eld: adding alternative to current yasnippets.
* etc/snippets*-mode: moved to /etc/snippets/yas/*-mode not to conflit with
tempel snippets.
---
 doc/contributing.texi                         |  17 ++-
 etc/snippets/tempel/scheme-mode.eld           | 112 ++++++++++++++++++
 etc/snippets/tempel/text-mode.eld             | 101 ++++++++++++++++
 .../{ => yas}/scheme-mode/guix-bzr-reference  |   0
 .../{ => yas}/scheme-mode/guix-cvs-reference  |   0
 .../{ => yas}/scheme-mode/guix-git-reference  |   0
 .../{ => yas}/scheme-mode/guix-hg-reference   |   0
 .../{ => yas}/scheme-mode/guix-origin         |   0
 .../{ => yas}/scheme-mode/guix-package        |   0
 .../{ => yas}/scheme-mode/guix-svn-reference  |   0
 .../guix-commit-message-add-cl-package        |   0
 .../text-mode/guix-commit-message-add-package |   0
 .../guix-commit-message-remove-package        |   0
 .../guix-commit-message-rename-package        |   0
 .../guix-commit-message-update-package        |   0
 .../guix-commit-message-use-https-home-page   |   0
 16 files changed, 225 insertions(+), 5 deletions(-)
 create mode 100644 etc/snippets/tempel/scheme-mode.eld
 create mode 100644 etc/snippets/tempel/text-mode.eld
 rename etc/snippets/{ => yas}/scheme-mode/guix-bzr-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-cvs-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-git-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-hg-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-origin (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-package (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-svn-reference (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-add-cl-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-add-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-remove-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-rename-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-update-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-use-https-home-page (100%)

diff --git a/doc/contributing.texi b/doc/contributing.texi
index 02c7c5ae59..808d71e40a 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -320,15 +320,22 @@ s-expression, etc.
 @cindex reducing boilerplate
 We also provide templates for common git commit messages and package
 definitions in the @file{etc/snippets} directory.  These templates can
-be used with @url{https://joaotavora.github.io/yasnippet/, YASnippet} to
-expand short trigger strings to interactive text snippets.  You may want
-to add the snippets directory to the @var{yas-snippet-dirs} variable in
-Emacs.
+be used to expand short trigger strings to interactive text snippets,
+with either @url{https://joaotavora.github.io/yasnippet/, YASnippet} or
+@url{https://github.com/minad/tempel/, Tempel}.  You may want to add the
+@file{etc/snippets/yas} (respectively @file{etc/snippets/tempel/*.eld}
+or selected files) snippets directory to the @var{yas-snippet-dirs}
+(@var{tempel-path} resp.) variable in Emacs.
 
 @lisp
 ;; @r{Assuming the Guix checkout is in ~/src/guix.}
+;; @r{Yasnippet}
 (with-eval-after-load 'yasnippet
-  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
+  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets/yas"))
+;;@r{Tempel}
+(with-eval-after-load 'tempel
+         (add-to-list 'tempel-path
+         "~/src/guix/etc/snippets/tempel/*.eld"))
 @end lisp
 
 The commit message snippets depend on @url{https://magit.vc/, Magit} to
diff --git a/etc/snippets/tempel/scheme-mode.eld b/etc/snippets/tempel/scheme-mode.eld
new file mode 100644
index 0000000000..ac48a1038b
--- /dev/null
+++ b/etc/snippets/tempel/scheme-mode.eld
@@ -0,0 +1,112 @@
+-*- mode: lisp-data -*-
+
+scheme-mode
+
+(package...
+ "(define-public " (s name) n>
+ "(package" n>
+ "(name \"" (s name) "\")" n>
+ "(version \"" p "\")" n>
+ "(source origin..." p ")" n>
+ "(build-system \""
+ (p (completing-read "build-system:"
+                     '("android-ndk-build-system"
+                       "ant-build-system"
+                       "asdf-build-system"
+                       "cargo-build-system"
+                       "chicken-build-system"
+                       "clojure-build-system"
+                       "cmake-build-system"
+                       "copy-build-system"
+                       "dub-build-system"
+                       "dune-build-system"
+                       "emacs-build-system"
+                       "font-build-system"
+                       "glib-or-gtk-build-system"
+                       "gnu-build-system"
+                       "go-build-system"
+                       "guile-build-system"
+                       "haskell-build-system"
+                       "julia-build-system"
+                       "linux-module-build-system"
+                       "maven-build-system"
+                       "meson-build-system"
+                       "minetest-build-system"
+                       "minify-build-system"
+                       "node-build-system"
+                       "ocaml-build-system"
+                       "perl-build-system"
+                       "python-build-system"
+                       "qt-build-system"
+                       "r-build-system"
+                       "rakudo-build-system"
+                       "rebar-build-system"
+                       "renpy-build-system"
+                       "ruby-build-system"
+                       "scons-build-system"
+                       "texlive-build-system"
+                       "trivial-build-system"
+                       "waf-build-system")
+                     nil t)) "\")" n>
+ "(home-page \"" p "\")" n>
+ "(synopsis \"" p "\")" n>
+ "(description \"" p "\")" n>
+ "(license " p ")))" n)
+
+(origin...
+ "(origin" n>
+ "(method \""
+ (p (completing-read "method:"
+                     '("url-fetch"
+                       "url-fetch/tarbomb"
+                       "url-fetch/zipbomb"
+                       "cvs-fetch"
+                       "git-fetch"
+                       "hg-fetch"
+                       "svn-fetch"
+                       "bzr-fetch")
+                     nil t) method) "\")" n>
+ "(uri " (cl-case (intern method)
+           ('git-fetch "git-reference...")
+           ('svn-fetch "svn-reference...")
+           ('hg-fetch  "hg-reference...")
+           ('cvs-fetch "cvs-reference...")
+           ('bzr-fetch "bzr-reference...")
+           (t          "(string-append \"https://"))
+ p
+ (if (equal (substring method 0 9)  "url-fetch") "\")")
+ ")" n>
+ (cl-case (intern method)
+   ('git-fetch "(file-name (git-file-name name version))\n")
+   ('hg-fetch "(file-name (hg-file-name name version))\n")
+   ('svn-fetch "(file-name (string-append name \"-\" version \"-checkout\"))\n")
+   ('cvs-fetch "(file-name (string-append name \"-\" version \"-checkout\"))\n")
+   ('bzr-fetch "(file-name (string-append name \"-\" version \"-checkout\"))\n")
+   (t          "")) >
+ "(sha256" n> "(base32 \"" p "\")))")
+
+(git-reference...
+ "(git-reference" n>
+ "(url \"" p "\")" n>
+ "(commit \"" p "\"))")
+
+(svn-reference...
+ "(svn-reference" n>
+ "(url \"" p "\")" n>
+ "(revision \"" p "\"))")
+
+(cvs-reference...
+ "(cvs-reference" n>
+ "(root-directory \"" p "\")" n>
+ "(module \"" p "\")" n>
+ "(revision \"" p "\"))")
+
+(hg-reference...
+ "(hg-reference" n>
+ "(url \"" p "\")" n>
+ "(changeset \"" p "\"))")
+
+(bzr-reference...
+ "(bzr-reference" n>
+ "(url \"" p "\")" n>
+ "(revision \"" p "\"))")
diff --git a/etc/snippets/tempel/text-mode.eld b/etc/snippets/tempel/text-mode.eld
new file mode 100644
index 0000000000..a51a6719d7
--- /dev/null
+++ b/etc/snippets/tempel/text-mode.eld
@@ -0,0 +1,101 @@
+-*- mode: lisp-data -*-
+
+text-mode :when (git-commit-mode)
+
+(add
+ "gnu: Add "
+ (p
+  (with-temp-buffer
+    (magit-git-wash #'magit-diff-wash-diffs
+      "diff" "--staged")
+    (goto-char (point-min))
+    (when (re-search-forward "\\+(define-public \\(\\S-+\\)" nil 'noerror)
+      (match-string-no-properties 1)))
+  var ) "." n n
+ "* " (car (magit-staged-files)) " (" (s var ) "): New variable.")
+
+(remove
+ "gnu: Remove "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror)
+        (match-string-no-properties 1)))
+    var) "." n n
+ "* " (car (magit-staged-files)) " (" (s var) "): Delete variable.")
+
+(rename
+ "gnu: "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (beginning-of-buffer)
+      (when (search-forward "-(define-public " nil 'noerror)
+        (thing-at-point 'sexp 'no-properties)))
+    prev-var)
+ ": Rename package to "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (beginning-of-buffer)
+      (when (search-forward "+(define-public " nil 'noerror)
+        (thing-at-point 'sexp 'no-properties)))
+    new-var) "." n n
+ "* " (car (magit-staged-files)) " (" (s prev-var) "): Define in terms of" n
+ "'deprecated-package'." n
+ "(" (s new-var) "): New variable, formerly known as \"" (s prev-var) "\".")
+
+(update
+ "gnu: "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
+        (match-string-no-properties 1)))
+    var)
+ ": Update to "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (search-forward "name" nil 'noerror)
+      (search-forward "+" nil 'noerror)   ; first change
+      (when (and (search-forward "version " nil 'noerror)
+                 (looking-at-p "\""))
+        (let ((end (save-excursion (search-forward "\")" nil 'noerror))))
+          (when end
+            (forward-char)
+            (buffer-substring-no-properties (point) (- end 2))))))
+    version) "." n n
+ "* " (car (magit-staged-files)) " (" (s var) "): Update to " (s version) "."
+ (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
+
+(addcl
+ "gnu: Add cl-"
+ (p (replace-regexp-in-string
+     "^cl-" "" (with-temp-buffer
+                 (magit-git-wash #'magit-diff-wash-diffs
+                   "diff" "--staged")
+                 (beginning-of-buffer)
+                 (when (search-forward "+(define-public " nil 'noerror)
+                   (replace-regexp-in-string
+                    "^sbcl-" ""
+                    (thing-at-point 'sexp 'no-properties)))))
+    var) "." n n
+ "* " (car (magit-staged-files))
+ " (cl-" (s var)  ", ecl-" (s var) ", sbcl-" (s var) "): New variables.")
+
+(https
+ "gnu: "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
+        (match-string-no-properties 1)))
+    var)
+ ": Use HTTPS home page." n n
+ "* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use HTTPS." n
+ (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
diff --git a/etc/snippets/scheme-mode/guix-bzr-reference b/etc/snippets/yas/scheme-mode/guix-bzr-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-bzr-reference
rename to etc/snippets/yas/scheme-mode/guix-bzr-reference
diff --git a/etc/snippets/scheme-mode/guix-cvs-reference b/etc/snippets/yas/scheme-mode/guix-cvs-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-cvs-reference
rename to etc/snippets/yas/scheme-mode/guix-cvs-reference
diff --git a/etc/snippets/scheme-mode/guix-git-reference b/etc/snippets/yas/scheme-mode/guix-git-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-git-reference
rename to etc/snippets/yas/scheme-mode/guix-git-reference
diff --git a/etc/snippets/scheme-mode/guix-hg-reference b/etc/snippets/yas/scheme-mode/guix-hg-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-hg-reference
rename to etc/snippets/yas/scheme-mode/guix-hg-reference
diff --git a/etc/snippets/scheme-mode/guix-origin b/etc/snippets/yas/scheme-mode/guix-origin
similarity index 100%
rename from etc/snippets/scheme-mode/guix-origin
rename to etc/snippets/yas/scheme-mode/guix-origin
diff --git a/etc/snippets/scheme-mode/guix-package b/etc/snippets/yas/scheme-mode/guix-package
similarity index 100%
rename from etc/snippets/scheme-mode/guix-package
rename to etc/snippets/yas/scheme-mode/guix-package
diff --git a/etc/snippets/scheme-mode/guix-svn-reference b/etc/snippets/yas/scheme-mode/guix-svn-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-svn-reference
rename to etc/snippets/yas/scheme-mode/guix-svn-reference
diff --git a/etc/snippets/text-mode/guix-commit-message-add-cl-package b/etc/snippets/yas/text-mode/guix-commit-message-add-cl-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-add-cl-package
rename to etc/snippets/yas/text-mode/guix-commit-message-add-cl-package
diff --git a/etc/snippets/text-mode/guix-commit-message-add-package b/etc/snippets/yas/text-mode/guix-commit-message-add-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-add-package
rename to etc/snippets/yas/text-mode/guix-commit-message-add-package
diff --git a/etc/snippets/text-mode/guix-commit-message-remove-package b/etc/snippets/yas/text-mode/guix-commit-message-remove-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-remove-package
rename to etc/snippets/yas/text-mode/guix-commit-message-remove-package
diff --git a/etc/snippets/text-mode/guix-commit-message-rename-package b/etc/snippets/yas/text-mode/guix-commit-message-rename-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-rename-package
rename to etc/snippets/yas/text-mode/guix-commit-message-rename-package
diff --git a/etc/snippets/text-mode/guix-commit-message-update-package b/etc/snippets/yas/text-mode/guix-commit-message-update-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-update-package
rename to etc/snippets/yas/text-mode/guix-commit-message-update-package
diff --git a/etc/snippets/text-mode/guix-commit-message-use-https-home-page b/etc/snippets/yas/text-mode/guix-commit-message-use-https-home-page
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-use-https-home-page
rename to etc/snippets/yas/text-mode/guix-commit-message-use-https-home-page
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Tue, 09 Aug 2022 10:26:02 GMT) Full text and rfc822 format available.

Message #11 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 57069 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH 2/4] etc: Add tempel snippet for :phases.
Date: Tue,  9 Aug 2022 12:24:38 +0200
---
 etc/snippets/tempel/scheme-mode.eld | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/etc/snippets/tempel/scheme-mode.eld b/etc/snippets/tempel/scheme-mode.eld
index ac48a1038b..eb209d599a 100644
--- a/etc/snippets/tempel/scheme-mode.eld
+++ b/etc/snippets/tempel/scheme-mode.eld
@@ -110,3 +110,13 @@ scheme-mode
  "(bzr-reference" n>
  "(url \"" p "\")" n>
  "(revision \"" p "\"))")
+
+(:phases
+ ":phases (modify-phases %standard-phases" n>
+ "(" (p (completing-read "modify:"
+                         '("add-before"
+                           "replace"
+                           "add-after"
+                           "delete ")
+                         nil t))
+ " '" q "))" )
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Tue, 09 Aug 2022 10:26:02 GMT) Full text and rfc822 format available.

Message #14 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 57069 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH 3/4] etc: Add tempel snippet for license:.
Date: Tue,  9 Aug 2022 12:24:39 +0200
---
 etc/snippets/tempel/scheme-mode.eld | 117 ++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)

diff --git a/etc/snippets/tempel/scheme-mode.eld b/etc/snippets/tempel/scheme-mode.eld
index eb209d599a..d9904ea7da 100644
--- a/etc/snippets/tempel/scheme-mode.eld
+++ b/etc/snippets/tempel/scheme-mode.eld
@@ -120,3 +120,120 @@ scheme-mode
                            "delete ")
                          nil t))
  " '" q "))" )
+
+(license:
+ "license:"
+ (p (completing-read "license:"
+                     '("agpl1"
+                       "agpl3"
+                       "agpl3+"
+                       "apsl2"
+                       "asl1.1"
+                       "asl2.0"
+                       "boost1.0"
+                       "bsd-0"
+                       "bsd-1"
+                       "bsd-2"
+                       "bsd-3"
+                       "bsd-4"
+                       "non-copyleft"
+                       "cc0"
+                       "cc-by-sa4.0"
+                       "cc-by-sa3.0"
+                       "cc-by-sa2.0"
+                       "cc-by4.0"
+                       "cc-by3.0"
+                       "cc-by2.0"
+                       "cddl1.0"
+                       "cddl1.1"
+                       "cecill"
+                       "cecill-b"
+                       "cecill-c"
+                       "artistic2.0"
+                       "clarified-artistic"
+                       "copyleft-next"
+                       "cpl1.0"
+                       "cua-opl1.0"
+                       "edl1.0"
+                       "epl1.0"
+                       "epl2.0"
+                       "eupl1.2"
+                       "expat"
+                       "expat-0"
+                       "freetype"
+                       "giftware"
+                       "gpl1"
+                       "gpl1+"
+                       "gpl2"
+                       "gpl2+"
+                       "gpl3"
+                       "gpl3+"
+                       "gfl1.0"
+                       "fdl1.1+"
+                       "fdl1.2+"
+                       "fdl1.3+"
+                       "freebsd-doc"
+                       "opl1.0+"
+                       "osl2.1"
+                       "isc"
+                       "ijg"
+                       "ibmpl1.0"
+                       "imlib2"
+                       "ipa"
+                       "knuth"
+                       "lal1.3"
+                       "lgpl2.0"
+                       "lgpl2.0+"
+                       "lgpl2.1"
+                       "lgpl2.1+"
+                       "lgpl3"
+                       "lgpl3+"
+                       "llgpl"
+                       "lppl"
+                       "lppl1.0+"
+                       "lppl1.1+"
+                       "lppl1.2"
+                       "lppl1.2+"
+                       "lppl1.3"
+                       "lppl1.3+"
+                       "lppl1.3a"
+                       "lppl1.3a+"
+                       "lppl1.3b"
+                       "lppl1.3b+"
+                       "lppl1.3c"
+                       "lppl1.3c+"
+                       "miros"
+                       "mpl1.0"
+                       "mpl1.1"
+                       "mpl2.0"
+                       "ms-pl"
+                       "ncsa"
+                       "nmap"
+                       "ogl-psi1.0"
+                       "openssl"
+                       "openldap2.8"
+                       "perl-license"
+                       "psfl"
+                       "public-domain"
+                       "qpl"
+                       "qwt1.0"
+                       "repoze"
+                       "ruby"
+                       "sgifreeb2.0"
+                       "silofl1.1"
+                       "sleepycat"
+                       "tcl/tk"
+                       "vim"
+                       "unicode"
+                       "unlicense"
+                       "w3c"
+                       "wtfpl2"
+                       "wxwindows3.1+"
+                       "x11"
+                       "x11-style"
+                       "zpl2.1"
+                       "zlib"
+                       "hpnd"
+                       "fsf-free"
+                       "fsdg-compatible")
+                     nil t)))
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Tue, 09 Aug 2022 10:26:03 GMT) Full text and rfc822 format available.

Message #17 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 57069 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH 4/4] etc: Update guix-package yasnippet build-system list.
Date: Tue,  9 Aug 2022 12:24:40 +0200
---
 etc/snippets/yas/scheme-mode/guix-package | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/etc/snippets/yas/scheme-mode/guix-package b/etc/snippets/yas/scheme-mode/guix-package
index 9ff6f997d1..724a392f81 100644
--- a/etc/snippets/yas/scheme-mode/guix-package
+++ b/etc/snippets/yas/scheme-mode/guix-package
@@ -11,6 +11,7 @@
                                           "ant-build-system"
                                           "asdf-build-system"
                                           "cargo-build-system"
+                                          "chicken-build-system"
                                           "clojure-build-system"
                                           "cmake-build-system"
                                           "copy-build-system"
@@ -27,6 +28,7 @@
                                           "linux-module-build-system"
                                           "maven-build-system"
                                           "meson-build-system"
+                                          "minetest-build-system"
                                           "minify-build-system"
                                           "node-build-system"
                                           "ocaml-build-system"
@@ -35,6 +37,8 @@
                                           "qt-build-system"
                                           "r-build-system"
                                           "rakudo-build-system"
+                                          "rebar-build-system"
+                                          "renpy-build-system"
                                           "ruby-build-system"
                                           "scons-build-system"
                                           "texlive-build-system"
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Tue, 09 Aug 2022 16:53:01 GMT) Full text and rfc822 format available.

Message #20 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Nicolas Graves <ngraves <at> ngraves.fr>, 57069 <at> debbugs.gnu.org
Subject: Re: Tempel snippets
Date: Tue, 09 Aug 2022 18:52:27 +0200
Am Dienstag, dem 09.08.2022 um 12:16 +0200 schrieb Nicolas Graves:
> 
> The first patch of this series introduces the equivalent of current
> yasnippet templates, with the alternative package tempel.
> 
> I eventually chose to make a new folder in snippets dir, and to move
> yasnippet files, hope it's OK.
> 
> It works quite well for me now, but can be improved:
> 
> - I selected completing-read for completion because I'm still
> learning
>   emacs and didn't tackle completion-at-point for now. Would that be
>   better?
Don't.  Use the (s ) field of tempel.  If you have corfu with capf, you
should be able to expand them.  For build-system you might want to add
"-build-system" at the end, so that the user only has to type "gnu",
"maven", etc.  Less fancy than the yas one, but probably just as good.

> - Nested snippets don't seem to work that well (e.g. expanding
>   git-fetch... within the edition of an origin... expansion), I had
>   quite a few bugs. Seems better to finish the current snippet before
>   tackling a sub-snippet (for now at least).
Probably a tempel limitation.  I think it works to M-RET and then
expand at point (using corfu or a tempel binding).  Just printing out
the unexpanded string should be enough for that.


Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Thu, 11 Aug 2022 06:09:01 GMT) Full text and rfc822 format available.

Message #23 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 57069 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v2] etc: Add tempel snippets.
Date: Thu, 11 Aug 2022 08:07:45 +0200
* doc/contributing.texi:
  - adding configuration description for tempel snippets.
  - adapting yasnippet configuration to directory move.
* etc/snippets/tempel/*.eld: adding alternative to current yasnippets.
* etc/snippets*-mode: moved to /etc/snippets/yas/*-mode not to conflit with
tempel snippets.
---
 doc/contributing.texi                         |  17 ++-
 etc/snippets/tempel/scheme-mode.eld           | 113 ++++++++++++++++++
 etc/snippets/tempel/text-mode.eld             | 101 ++++++++++++++++
 .../{ => yas}/scheme-mode/guix-bzr-reference  |   0
 .../{ => yas}/scheme-mode/guix-cvs-reference  |   0
 .../{ => yas}/scheme-mode/guix-git-reference  |   0
 .../{ => yas}/scheme-mode/guix-hg-reference   |   0
 .../{ => yas}/scheme-mode/guix-origin         |   0
 .../{ => yas}/scheme-mode/guix-package        |   0
 .../{ => yas}/scheme-mode/guix-svn-reference  |   0
 .../guix-commit-message-add-cl-package        |   0
 .../text-mode/guix-commit-message-add-package |   0
 .../guix-commit-message-remove-package        |   0
 .../guix-commit-message-rename-package        |   0
 .../guix-commit-message-update-package        |   0
 .../guix-commit-message-use-https-home-page   |   0
 16 files changed, 226 insertions(+), 5 deletions(-)
 create mode 100644 etc/snippets/tempel/scheme-mode.eld
 create mode 100644 etc/snippets/tempel/text-mode.eld
 rename etc/snippets/{ => yas}/scheme-mode/guix-bzr-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-cvs-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-git-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-hg-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-origin (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-package (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-svn-reference (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-add-cl-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-add-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-remove-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-rename-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-update-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-use-https-home-page (100%)

diff --git a/doc/contributing.texi b/doc/contributing.texi
index 02c7c5ae59..808d71e40a 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -320,15 +320,22 @@ s-expression, etc.
 @cindex reducing boilerplate
 We also provide templates for common git commit messages and package
 definitions in the @file{etc/snippets} directory.  These templates can
-be used with @url{https://joaotavora.github.io/yasnippet/, YASnippet} to
-expand short trigger strings to interactive text snippets.  You may want
-to add the snippets directory to the @var{yas-snippet-dirs} variable in
-Emacs.
+be used to expand short trigger strings to interactive text snippets,
+with either @url{https://joaotavora.github.io/yasnippet/, YASnippet} or
+@url{https://github.com/minad/tempel/, Tempel}.  You may want to add the
+@file{etc/snippets/yas} (respectively @file{etc/snippets/tempel/*.eld}
+or selected files) snippets directory to the @var{yas-snippet-dirs}
+(@var{tempel-path} resp.) variable in Emacs.
 
 @lisp
 ;; @r{Assuming the Guix checkout is in ~/src/guix.}
+;; @r{Yasnippet}
 (with-eval-after-load 'yasnippet
-  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
+  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets/yas"))
+;;@r{Tempel}
+(with-eval-after-load 'tempel
+         (add-to-list 'tempel-path
+         "~/src/guix/etc/snippets/tempel/*.eld"))
 @end lisp
 
 The commit message snippets depend on @url{https://magit.vc/, Magit} to
diff --git a/etc/snippets/tempel/scheme-mode.eld b/etc/snippets/tempel/scheme-mode.eld
new file mode 100644
index 0000000000..5fcd7030b8
--- /dev/null
+++ b/etc/snippets/tempel/scheme-mode.eld
@@ -0,0 +1,113 @@
+-*- mode: lisp-data -*-
+
+scheme-mode
+
+(package...
+ "(define-public " (s name) n>
+ "(package" n>
+ "(name \"" (s name) "\")" n>
+ "(version \"" p "\")" n>
+ "(source origin..." p ")" n>
+ "(build-system \""
+ (p (completing-read "build-system:"
+                     '("android-ndk"
+                       "ant"
+                       "asdf"
+                       "cargo"
+                       "chicken"
+                       "clojure"
+                       "cmake"
+                       "copy"
+                       "dub"
+                       "dune"
+                       "emacs"
+                       "font"
+                       "glib-or-gtk"
+                       "gnu"
+                       "go"
+                       "guile"
+                       "haskell"
+                       "julia"
+                       "linux-module"
+                       "maven"
+                       "meson"
+                       "minetest"
+                       "minify"
+                       "node"
+                       "ocaml"
+                       "perl"
+                       "python"
+                       "qt"
+                       "r"
+                       "rakudo"
+                       "rebar"
+                       "renpy"
+                       "ruby"
+                       "scons"
+                       "texlive"
+                       "trivial"
+                       "waf")
+                     nil t) "-build-system")
+ "\")" n>
+ "(home-page \"" p "\")" n>
+ "(synopsis \"" p "\")" n>
+ "(description \"" p "\")" n>
+ "(license " p ")))" n)
+
+(origin...
+ "(origin" n>
+ "(method \""
+ (p (completing-read "method:"
+                     '("url-fetch"
+                       "url-fetch/tarbomb"
+                       "url-fetch/zipbomb"
+                       "cvs-fetch"
+                       "git-fetch"
+                       "hg-fetch"
+                       "svn-fetch"
+                       "bzr-fetch")
+                     nil t) method) "\")" n>
+ "(uri " (cl-case (intern method)
+           ('git-fetch "git-reference...")
+           ('svn-fetch "svn-reference...")
+           ('hg-fetch  "hg-reference...")
+           ('cvs-fetch "cvs-reference...")
+           ('bzr-fetch "bzr-reference...")
+           (t          "(string-append \"https://"))
+ p
+ (if (equal (substring method 0 9)  "url-fetch") "\")")
+ ")" n>
+ (cl-case (intern method)
+   ('git-fetch "(file-name (git-file-name name version))\n")
+   ('hg-fetch "(file-name (hg-file-name name version))\n")
+   ('svn-fetch "(file-name (string-append name \"-\" version \"-checkout\"))\n")
+   ('cvs-fetch "(file-name (string-append name \"-\" version \"-checkout\"))\n")
+   ('bzr-fetch "(file-name (string-append name \"-\" version \"-checkout\"))\n")
+   (t          "")) >
+ "(sha256" n> "(base32 \"" p "\")))")
+
+(git-reference...
+ "(git-reference" n>
+ "(url \"" p "\")" n>
+ "(commit \"" p "\"))")
+
+(svn-reference...
+ "(svn-reference" n>
+ "(url \"" p "\")" n>
+ "(revision \"" p "\"))")
+
+(cvs-reference...
+ "(cvs-reference" n>
+ "(root-directory \"" p "\")" n>
+ "(module \"" p "\")" n>
+ "(revision \"" p "\"))")
+
+(hg-reference...
+ "(hg-reference" n>
+ "(url \"" p "\")" n>
+ "(changeset \"" p "\"))")
+
+(bzr-reference...
+ "(bzr-reference" n>
+ "(url \"" p "\")" n>
+ "(revision \"" p "\"))")
diff --git a/etc/snippets/tempel/text-mode.eld b/etc/snippets/tempel/text-mode.eld
new file mode 100644
index 0000000000..a51a6719d7
--- /dev/null
+++ b/etc/snippets/tempel/text-mode.eld
@@ -0,0 +1,101 @@
+-*- mode: lisp-data -*-
+
+text-mode :when (git-commit-mode)
+
+(add
+ "gnu: Add "
+ (p
+  (with-temp-buffer
+    (magit-git-wash #'magit-diff-wash-diffs
+      "diff" "--staged")
+    (goto-char (point-min))
+    (when (re-search-forward "\\+(define-public \\(\\S-+\\)" nil 'noerror)
+      (match-string-no-properties 1)))
+  var ) "." n n
+ "* " (car (magit-staged-files)) " (" (s var ) "): New variable.")
+
+(remove
+ "gnu: Remove "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror)
+        (match-string-no-properties 1)))
+    var) "." n n
+ "* " (car (magit-staged-files)) " (" (s var) "): Delete variable.")
+
+(rename
+ "gnu: "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (beginning-of-buffer)
+      (when (search-forward "-(define-public " nil 'noerror)
+        (thing-at-point 'sexp 'no-properties)))
+    prev-var)
+ ": Rename package to "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (beginning-of-buffer)
+      (when (search-forward "+(define-public " nil 'noerror)
+        (thing-at-point 'sexp 'no-properties)))
+    new-var) "." n n
+ "* " (car (magit-staged-files)) " (" (s prev-var) "): Define in terms of" n
+ "'deprecated-package'." n
+ "(" (s new-var) "): New variable, formerly known as \"" (s prev-var) "\".")
+
+(update
+ "gnu: "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
+        (match-string-no-properties 1)))
+    var)
+ ": Update to "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (search-forward "name" nil 'noerror)
+      (search-forward "+" nil 'noerror)   ; first change
+      (when (and (search-forward "version " nil 'noerror)
+                 (looking-at-p "\""))
+        (let ((end (save-excursion (search-forward "\")" nil 'noerror))))
+          (when end
+            (forward-char)
+            (buffer-substring-no-properties (point) (- end 2))))))
+    version) "." n n
+ "* " (car (magit-staged-files)) " (" (s var) "): Update to " (s version) "."
+ (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
+
+(addcl
+ "gnu: Add cl-"
+ (p (replace-regexp-in-string
+     "^cl-" "" (with-temp-buffer
+                 (magit-git-wash #'magit-diff-wash-diffs
+                   "diff" "--staged")
+                 (beginning-of-buffer)
+                 (when (search-forward "+(define-public " nil 'noerror)
+                   (replace-regexp-in-string
+                    "^sbcl-" ""
+                    (thing-at-point 'sexp 'no-properties)))))
+    var) "." n n
+ "* " (car (magit-staged-files))
+ " (cl-" (s var)  ", ecl-" (s var) ", sbcl-" (s var) "): New variables.")
+
+(https
+ "gnu: "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
+        (match-string-no-properties 1)))
+    var)
+ ": Use HTTPS home page." n n
+ "* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use HTTPS." n
+ (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
diff --git a/etc/snippets/scheme-mode/guix-bzr-reference b/etc/snippets/yas/scheme-mode/guix-bzr-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-bzr-reference
rename to etc/snippets/yas/scheme-mode/guix-bzr-reference
diff --git a/etc/snippets/scheme-mode/guix-cvs-reference b/etc/snippets/yas/scheme-mode/guix-cvs-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-cvs-reference
rename to etc/snippets/yas/scheme-mode/guix-cvs-reference
diff --git a/etc/snippets/scheme-mode/guix-git-reference b/etc/snippets/yas/scheme-mode/guix-git-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-git-reference
rename to etc/snippets/yas/scheme-mode/guix-git-reference
diff --git a/etc/snippets/scheme-mode/guix-hg-reference b/etc/snippets/yas/scheme-mode/guix-hg-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-hg-reference
rename to etc/snippets/yas/scheme-mode/guix-hg-reference
diff --git a/etc/snippets/scheme-mode/guix-origin b/etc/snippets/yas/scheme-mode/guix-origin
similarity index 100%
rename from etc/snippets/scheme-mode/guix-origin
rename to etc/snippets/yas/scheme-mode/guix-origin
diff --git a/etc/snippets/scheme-mode/guix-package b/etc/snippets/yas/scheme-mode/guix-package
similarity index 100%
rename from etc/snippets/scheme-mode/guix-package
rename to etc/snippets/yas/scheme-mode/guix-package
diff --git a/etc/snippets/scheme-mode/guix-svn-reference b/etc/snippets/yas/scheme-mode/guix-svn-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-svn-reference
rename to etc/snippets/yas/scheme-mode/guix-svn-reference
diff --git a/etc/snippets/text-mode/guix-commit-message-add-cl-package b/etc/snippets/yas/text-mode/guix-commit-message-add-cl-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-add-cl-package
rename to etc/snippets/yas/text-mode/guix-commit-message-add-cl-package
diff --git a/etc/snippets/text-mode/guix-commit-message-add-package b/etc/snippets/yas/text-mode/guix-commit-message-add-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-add-package
rename to etc/snippets/yas/text-mode/guix-commit-message-add-package
diff --git a/etc/snippets/text-mode/guix-commit-message-remove-package b/etc/snippets/yas/text-mode/guix-commit-message-remove-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-remove-package
rename to etc/snippets/yas/text-mode/guix-commit-message-remove-package
diff --git a/etc/snippets/text-mode/guix-commit-message-rename-package b/etc/snippets/yas/text-mode/guix-commit-message-rename-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-rename-package
rename to etc/snippets/yas/text-mode/guix-commit-message-rename-package
diff --git a/etc/snippets/text-mode/guix-commit-message-update-package b/etc/snippets/yas/text-mode/guix-commit-message-update-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-update-package
rename to etc/snippets/yas/text-mode/guix-commit-message-update-package
diff --git a/etc/snippets/text-mode/guix-commit-message-use-https-home-page b/etc/snippets/yas/text-mode/guix-commit-message-use-https-home-page
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-use-https-home-page
rename to etc/snippets/yas/text-mode/guix-commit-message-use-https-home-page
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Thu, 11 Aug 2022 06:18:02 GMT) Full text and rfc822 format available.

Message #26 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, 57069 <at> debbugs.gnu.org
Cc: Andrew Tropin <andrew <at> trop.in>
Subject: Re: Tempel snippets
Date: Thu, 11 Aug 2022 08:17:25 +0200
> - I couldn't match a small part of current yasnippet configuration,
>   currently only the part in uri when url-fetch is chosen. Sent
>   a "help/feature report" here https://github.com/minad/tempel/issues/65.
>
> If this is possible, we could probably further factorize and integrate the
> snippets logic, maybe to reach something like that for origin
> expansion.

Daniel Mendler confirmed that recursive templates were not supported,
hence I cannot further improve snippets.
I've sent an updated patch with "-build-system" added only once at the
end.

Waiting for them to be adopted ;)

PS : it would be great to add a "snippets" output to the guix package,
so that one can use (file-append guix:snippets "/tempel/") to
include them in a guix home configuration.

-- 
Best regards,
Nicolas Graves




Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Thu, 11 Aug 2022 15:54:02 GMT) Full text and rfc822 format available.

Message #29 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Nicolas Graves <ngraves <at> ngraves.fr>, 57069 <at> debbugs.gnu.org
Cc: Andrew Tropin <andrew <at> trop.in>
Subject: Re: Tempel snippets
Date: Thu, 11 Aug 2022 17:53:37 +0200
Am Donnerstag, dem 11.08.2022 um 08:17 +0200 schrieb Nicolas Graves:
> 
> > - I couldn't match a small part of current yasnippet configuration,
> >   currently only the part in uri when url-fetch is chosen. Sent
> >   a "help/feature report" here
> > https://github.com/minad/tempel/issues/65.
> > 
> > If this is possible, we could probably further factorize and
> > integrate the
> > snippets logic, maybe to reach something like that for origin
> > expansion.
> 
> Daniel Mendler confirmed that recursive templates were not supported,
> hence I cannot further improve snippets.  I've sent an updated patch
> with "-build-system" added only once at the end.
> 
> Waiting for them to be adopted ;)
I'll reply to the actual patches with the review.

> PS : it would be great to add a "snippets" output to the guix
> package, so that one can use (file-append guix:snippets "/tempel/")
> to include them in a guix home configuration.
Note that you can (file-append (package-source guix) "etc/snippets")

Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Thu, 11 Aug 2022 16:22:02 GMT) Full text and rfc822 format available.

Message #32 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Nicolas Graves <ngraves <at> ngraves.fr>, 57069 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] etc: Add tempel snippets.
Date: Thu, 11 Aug 2022 18:21:07 +0200
Am Donnerstag, dem 11.08.2022 um 08:07 +0200 schrieb Nicolas Graves:
> * doc/contributing.texi:
>   - adding configuration description for tempel snippets.
>   - adapting yasnippet configuration to directory move.
Write full sentences, don't use pseudo-lists.
> * etc/snippets/tempel/*.eld: adding alternative to current
> yasnippets.
* etc/snippets/tempel/scheme-mode.eld: New file.
* etc/snippets/tempel/text-mode.eld: New file.

I'm not too sure about the suffix here.  I'd personally prefer a
suffix-less file with a mode-line.
> * etc/snippets*-mode: moved to /etc/snippets/yas/*-mode not to
Again, spell out both directories, as in:
* etc/snippets/scheme-mode: Moved from here...
* etc/snippets/yas/scheme-mode: ... to here.
> conflit with
Should be conflict, but I don't think this needs to be stated when
using the ChangeLog style as above.
> tempel snippets.
> ---
>  doc/contributing.texi                         |  17 ++-
>  etc/snippets/tempel/scheme-mode.eld           | 113
> ++++++++++++++++++
>  etc/snippets/tempel/text-mode.eld             | 101 ++++++++++++++++
>  .../{ => yas}/scheme-mode/guix-bzr-reference  |   0
>  .../{ => yas}/scheme-mode/guix-cvs-reference  |   0
>  .../{ => yas}/scheme-mode/guix-git-reference  |   0
>  .../{ => yas}/scheme-mode/guix-hg-reference   |   0
>  .../{ => yas}/scheme-mode/guix-origin         |   0
>  .../{ => yas}/scheme-mode/guix-package        |   0
>  .../{ => yas}/scheme-mode/guix-svn-reference  |   0
>  .../guix-commit-message-add-cl-package        |   0
>  .../text-mode/guix-commit-message-add-package |   0
>  .../guix-commit-message-remove-package        |   0
>  .../guix-commit-message-rename-package        |   0
>  .../guix-commit-message-update-package        |   0
>  .../guix-commit-message-use-https-home-page   |   0
>  16 files changed, 226 insertions(+), 5 deletions(-)
>  create mode 100644 etc/snippets/tempel/scheme-mode.eld
>  create mode 100644 etc/snippets/tempel/text-mode.eld
>  rename etc/snippets/{ => yas}/scheme-mode/guix-bzr-reference (100%)
>  rename etc/snippets/{ => yas}/scheme-mode/guix-cvs-reference (100%)
>  rename etc/snippets/{ => yas}/scheme-mode/guix-git-reference (100%)
>  rename etc/snippets/{ => yas}/scheme-mode/guix-hg-reference (100%)
>  rename etc/snippets/{ => yas}/scheme-mode/guix-origin (100%)
>  rename etc/snippets/{ => yas}/scheme-mode/guix-package (100%)
>  rename etc/snippets/{ => yas}/scheme-mode/guix-svn-reference (100%)
>  rename etc/snippets/{ => yas}/text-mode/guix-commit-message-add-cl-
> package (100%)
>  rename etc/snippets/{ => yas}/text-mode/guix-commit-message-add-
> package (100%)
>  rename etc/snippets/{ => yas}/text-mode/guix-commit-message-remove-
> package (100%)
>  rename etc/snippets/{ => yas}/text-mode/guix-commit-message-rename-
> package (100%)
>  rename etc/snippets/{ => yas}/text-mode/guix-commit-message-update-
> package (100%)
>  rename etc/snippets/{ => yas}/text-mode/guix-commit-message-use-
> https-home-page (100%)
> 
> diff --git a/doc/contributing.texi b/doc/contributing.texi
> index 02c7c5ae59..808d71e40a 100644
> --- a/doc/contributing.texi
> +++ b/doc/contributing.texi
> @@ -320,15 +320,22 @@ s-expression, etc.
>  @cindex reducing boilerplate
>  We also provide templates for common git commit messages and package
>  definitions in the @file{etc/snippets} directory.  These templates
> can
> -be used with @url{https://joaotavora.github.io/yasnippet/,
> YASnippet} to
> -expand short trigger strings to interactive text snippets.  You may
> want
> -to add the snippets directory to the @var{yas-snippet-dirs} variable
> in
> -Emacs.
> +be used to expand short trigger strings to interactive text
> snippets,
> +with either @url{https://joaotavora.github.io/yasnippet/, YASnippet}
> or
> +@url{https://github.com/minad/tempel/, Tempel}.  You may want to add
> the
> +@file{etc/snippets/yas} (respectively
> @file{etc/snippets/tempel/*.eld}
> +or selected files) snippets directory to the @var{yas-snippet-dirs}
> +(@var{tempel-path} resp.) variable in Emacs.
You probably want to reorganize this a little.

"We also provide templates for common git commit messages and package
definitions in the @file{etc/snippets} directory.  If you use 
YASnippet, you may want to <yasnippet configuration>.  If you use
Tempel, you may want to <tempel configuration>."

>  
>  @lisp
>  ;; @r{Assuming the Guix checkout is in ~/src/guix.}
> +;; @r{Yasnippet}
>  (with-eval-after-load 'yasnippet
> -  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
> +  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets/yas"))
> +;;@r{Tempel}
> +(with-eval-after-load 'tempel
> +         (add-to-list 'tempel-path
> +         "~/src/guix/etc/snippets/tempel/*.eld"))
>  @end lisp
>  
>  The commit message snippets depend on @url{https://magit.vc/, Magit}
> to
> diff --git a/etc/snippets/tempel/scheme-mode.eld
> b/etc/snippets/tempel/scheme-mode.eld
> new file mode 100644
> index 0000000000..5fcd7030b8
> --- /dev/null
> +++ b/etc/snippets/tempel/scheme-mode.eld
> @@ -0,0 +1,113 @@
> +-*- mode: lisp-data -*-
> +
> +scheme-mode
> +
> +(package...
> + "(define-public " (s name) n>
> + "(package" n>
Style-wise, I think n> "(package" is better than the other way round.
You can also n  > and n    > on subsequent lines for clarity.

> + "(name \"" (s name) "\")" n>
> + "(version \"" p "\")" n>
> + "(source origin..." p ")" n>
I don't think you want that p here.
> + "(build-system \""
> + (p (completing-read "build-system:"
> +                     '("android-ndk"
> +                       "ant"
> +                       "asdf"
> +                       "cargo"
> +                       "chicken"
> +                       "clojure"
> +                       "cmake"
> +                       "copy"
> +                       "dub"
> +                       "dune"
> +                       "emacs"
> +                       "font"
> +                       "glib-or-gtk"
> +                       "gnu"
> +                       "go"
> +                       "guile"
> +                       "haskell"
> +                       "julia"
> +                       "linux-module"
> +                       "maven"
> +                       "meson"
> +                       "minetest"
> +                       "minify"
> +                       "node"
> +                       "ocaml"
> +                       "perl"
> +                       "python"
> +                       "qt"
> +                       "r"
> +                       "rakudo"
> +                       "rebar"
> +                       "renpy"
> +                       "ruby"
> +                       "scons"
> +                       "texlive"
> +                       "trivial"
> +                       "waf")
> +                     nil t) "-build-system")
I'd suggest skipping the completing-read and just (p "gnu").  Most
build systems should be easy enough to type without autocompletion.
> + "\")" n>
> + "(home-page \"" p "\")" n>
> + "(synopsis \"" p "\")" n>
> + "(description \"" p "\")" n>
> + "(license " p ")))" n)
> +
> +(origin...
> + "(origin" n>
> + "(method \""
> + (p (completing-read "method:"
> +                     '("url-fetch"
> +                       "url-fetch/tarbomb"
> +                       "url-fetch/zipbomb"
> +                       "cvs-fetch"
> +                       "git-fetch"
> +                       "hg-fetch"
> +                       "svn-fetch"
> +                       "bzr-fetch")
> +                     nil t) method) "\")" n>
Here, I think (p "url-fetch"), but (s "method") might also work.
> + "(uri " (cl-case (intern method)
> +           ('git-fetch "git-reference...")
> +           ('svn-fetch "svn-reference...")
> +           ('hg-fetch  "hg-reference...")
> +           ('cvs-fetch "cvs-reference...")
> +           ('bzr-fetch "bzr-reference...")
> +           (t          "(string-append \"https://"))
Will this cl-case be dynamically recomputed?  I wonder if we can get
the result of the previous p/s here...
> + p
> + (if (equal (substring method 0 9)  "url-fetch") "\")")
> + ")" n>
> + (cl-case (intern method)
> +   ('git-fetch "(file-name (git-file-name name version))\n")
> +   ('hg-fetch "(file-name (hg-file-name name version))\n")
> +   ('svn-fetch "(file-name (string-append name \"-\" version \"-
> checkout\"))\n")
> +   ('cvs-fetch "(file-name (string-append name \"-\" version \"-
> checkout\"))\n")
> +   ('bzr-fetch "(file-name (string-append name \"-\" version \"-
> checkout\"))\n")
> +   (t          "")) >
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.
> + "(sha256" n> "(base32 \"" p "\")))")
> +
> +(git-reference...
> + "(git-reference" n>
> + "(url \"" p "\")" n>
> + "(commit \"" p "\"))")
> +
> +(svn-reference...
> + "(svn-reference" n>
> + "(url \"" p "\")" n>
> + "(revision \"" p "\"))")
> +
> +(cvs-reference...
> + "(cvs-reference" n>
> + "(root-directory \"" p "\")" n>
> + "(module \"" p "\")" n>
> + "(revision \"" p "\"))")
> +
> +(hg-reference...
> + "(hg-reference" n>
> + "(url \"" p "\")" n>
> + "(changeset \"" p "\"))")
> +
> +(bzr-reference...
> + "(bzr-reference" n>
> + "(url \"" p "\")" n>
> + "(revision \"" p "\"))")
> diff --git a/etc/snippets/tempel/text-mode.eld
> b/etc/snippets/tempel/text-mode.eld
> new file mode 100644
> index 0000000000..a51a6719d7
> --- /dev/null
> +++ b/etc/snippets/tempel/text-mode.eld
> @@ -0,0 +1,101 @@
> +-*- mode: lisp-data -*-
> +
> +text-mode :when (git-commit-mode)
> +
> +(add
> + "gnu: Add "
> + (p
> +  (with-temp-buffer
> +    (magit-git-wash #'magit-diff-wash-diffs
> +      "diff" "--staged")
> +    (goto-char (point-min))
> +    (when (re-search-forward "\\+(define-public \\(\\S-+\\)" nil
> 'noerror)
> +      (match-string-no-properties 1)))
> +  var ) "." n n
> + "* " (car (magit-staged-files)) " (" (s var ) "): New variable.")
Pro tip: add a space after add (i.e. add\ ) or use add... as the name.
This way, you guard against premature expansion in corfu and other
packages likely to be used in combination with tempel.

> +(remove
> + "gnu: Remove "
> + (p (with-temp-buffer
> +      (magit-git-wash #'magit-diff-wash-diffs
> +        "diff" "--staged")
> +      (goto-char (point-min))
> +      (when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil
> 'noerror)
> +        (match-string-no-properties 1)))
> +    var) "." n n
> + "* " (car (magit-staged-files)) " (" (s var) "): Delete variable.")
> +
> +(rename
> + "gnu: "
> + (p (with-temp-buffer
> +      (magit-git-wash #'magit-diff-wash-diffs
> +        "diff" "--staged")
> +      (beginning-of-buffer)
> +      (when (search-forward "-(define-public " nil 'noerror)
> +        (thing-at-point 'sexp 'no-properties)))
> +    prev-var)
> + ": Rename package to "
> + (p (with-temp-buffer
> +      (magit-git-wash #'magit-diff-wash-diffs
> +        "diff" "--staged")
> +      (beginning-of-buffer)
> +      (when (search-forward "+(define-public " nil 'noerror)
> +        (thing-at-point 'sexp 'no-properties)))
> +    new-var) "." n n
> + "* " (car (magit-staged-files)) " (" (s prev-var) "): Define in
> terms of" n
> + "'deprecated-package'." n
> + "(" (s new-var) "): New variable, formerly known as \"" (s prev-
> var) "\".")
> +
> +(update
> + "gnu: "
> + (p (with-temp-buffer
> +      (magit-git-wash #'magit-diff-wash-diffs
> +        "diff" "--staged")
> +      (goto-char (point-min))
> +      (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil
> 'noerror)
> +        (match-string-no-properties 1)))
> +    var)
> + ": Update to "
> + (p (with-temp-buffer
> +      (magit-git-wash #'magit-diff-wash-diffs
> +        "diff" "--staged")
> +      (goto-char (point-min))
> +      (search-forward "name" nil 'noerror)
> +      (search-forward "+" nil 'noerror)   ; first change
> +      (when (and (search-forward "version " nil 'noerror)
> +                 (looking-at-p "\""))
> +        (let ((end (save-excursion (search-forward "\")" nil
> 'noerror))))
> +          (when end
> +            (forward-char)
> +            (buffer-substring-no-properties (point) (- end 2))))))
> +    version) "." n n
> + "* " (car (magit-staged-files)) " (" (s var) "): Update to " (s
> version) "."
> + (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-
> files))) n)
> +
> +(addcl
> + "gnu: Add cl-"
> + (p (replace-regexp-in-string
> +     "^cl-" "" (with-temp-buffer
> +                 (magit-git-wash #'magit-diff-wash-diffs
> +                   "diff" "--staged")
> +                 (beginning-of-buffer)
> +                 (when (search-forward "+(define-public " nil
> 'noerror)
> +                   (replace-regexp-in-string
> +                    "^sbcl-" ""
> +                    (thing-at-point 'sexp 'no-properties)))))
> +    var) "." n n
> + "* " (car (magit-staged-files))
> + " (cl-" (s var)  ", ecl-" (s var) ", sbcl-" (s var) "): New
> variables.")
> +
> +(https
> + "gnu: "
> + (p (with-temp-buffer
> +      (magit-git-wash #'magit-diff-wash-diffs
> +        "diff" "--staged")
> +      (goto-char (point-min))
> +      (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil
> 'noerror)
> +        (match-string-no-properties 1)))
> +    var)
> + ": Use HTTPS home page." n n
> + "* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use
> HTTPS." n
> + (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-
> files))) n)

Cheers





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Fri, 12 Aug 2022 06:22:02 GMT) Full text and rfc822 format available.

Message #35 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, 57069 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] etc: Add tempel snippets.
Date: Fri, 12 Aug 2022 08:20:53 +0200
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




Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Fri, 12 Aug 2022 09:00:02 GMT) Full text and rfc822 format available.

Message #38 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 57069 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v3 1/4] etc: Add tempel snippets.
Date: Fri, 12 Aug 2022 10:58:48 +0200
* doc/contributing.texi:
  Adding configuration description for TempEL snippets and adapting yasnippet
  configuration to the directory move.
* etc/snippets/tempel/scheme-mode: New file.
* etc/snippets/tempel/text-mode: New file.
* etc/snippets/scheme-mode: Moved from here...
* etc/snippets/yas/scheme-mode: ... to here.
* etc/snippets/text-mode: Moved from here...
* etc/snippets/yas/text-mode: ... to here.
---
 doc/contributing.texi                         |  16 ++-
 etc/snippets/tempel/scheme-mode               | 114 ++++++++++++++++++
 etc/snippets/tempel/text-mode                 | 101 ++++++++++++++++
 .../{ => yas}/scheme-mode/guix-bzr-reference  |   0
 .../{ => yas}/scheme-mode/guix-cvs-reference  |   0
 .../{ => yas}/scheme-mode/guix-git-reference  |   0
 .../{ => yas}/scheme-mode/guix-hg-reference   |   0
 .../{ => yas}/scheme-mode/guix-origin         |   0
 .../{ => yas}/scheme-mode/guix-package        |   0
 .../{ => yas}/scheme-mode/guix-svn-reference  |   0
 .../guix-commit-message-add-cl-package        |   0
 .../text-mode/guix-commit-message-add-package |   0
 .../guix-commit-message-remove-package        |   0
 .../guix-commit-message-rename-package        |   0
 .../guix-commit-message-update-package        |   0
 .../guix-commit-message-use-https-home-page   |   0
 16 files changed, 227 insertions(+), 4 deletions(-)
 create mode 100644 etc/snippets/tempel/scheme-mode
 create mode 100644 etc/snippets/tempel/text-mode
 rename etc/snippets/{ => yas}/scheme-mode/guix-bzr-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-cvs-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-git-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-hg-reference (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-origin (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-package (100%)
 rename etc/snippets/{ => yas}/scheme-mode/guix-svn-reference (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-add-cl-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-add-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-remove-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-rename-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-update-package (100%)
 rename etc/snippets/{ => yas}/text-mode/guix-commit-message-use-https-home-page (100%)

diff --git a/doc/contributing.texi b/doc/contributing.texi
index 02c7c5ae59..655ce182de 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -320,15 +320,23 @@ s-expression, etc.
 @cindex reducing boilerplate
 We also provide templates for common git commit messages and package
 definitions in the @file{etc/snippets} directory.  These templates can
-be used with @url{https://joaotavora.github.io/yasnippet/, YASnippet} to
-expand short trigger strings to interactive text snippets.  You may want
-to add the snippets directory to the @var{yas-snippet-dirs} variable in
+be used to expand short trigger strings to interactive text snippets. If
+you use @url{https://joaotavora.github.io/yasnippet/, YASnippet}, you
+may want to add the @file{etc/snippets/yas} snippets directory to the
+@var{yas-snippet-dirs} variable.  If you use
+@url{https://github.com/minad/tempel/, Tempel}, you may want to add the
+@file{etc/snippets/tempel/*} path to the @var{tempel-path} variable in
 Emacs.
 
 @lisp
 ;; @r{Assuming the Guix checkout is in ~/src/guix.}
+;; @r{Yasnippet}
 (with-eval-after-load 'yasnippet
-  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets"))
+  (add-to-list 'yas-snippet-dirs "~/src/guix/etc/snippets/yas"))
+;;@r{Tempel}
+(with-eval-after-load 'tempel
+         (add-to-list 'tempel-path
+         "~/src/guix/etc/snippets/tempel/*"))
 @end lisp
 
 The commit message snippets depend on @url{https://magit.vc/, Magit} to
diff --git a/etc/snippets/tempel/scheme-mode b/etc/snippets/tempel/scheme-mode
new file mode 100644
index 0000000000..386c9e653f
--- /dev/null
+++ b/etc/snippets/tempel/scheme-mode
@@ -0,0 +1,114 @@
+-*- mode: lisp-data -*-
+
+scheme-mode
+
+(package...
+ "(define-public " (s name)
+ n> "(package"
+ n> "(name \"" (s name) "\")"
+ n> "(version \"" p "\")"
+ n> "(source origin...)"
+ n> "(build-system \""
+ (p (completing-read "build-system:"
+                     '("android-ndk"
+                       "ant"
+                       "asdf"
+                       "cargo"
+                       "chicken"
+                       "clojure"
+                       "cmake"
+                       "copy"
+                       "dub"
+                       "dune"
+                       "emacs"
+                       "font"
+                       "glib-or-gtk"
+                       "gnu"
+                       "go"
+                       "guile"
+                       "haskell"
+                       "julia"
+                       "linux-module"
+                       "maven"
+                       "meson"
+                       "minetest"
+                       "minify"
+                       "node"
+                       "ocaml"
+                       "perl"
+                       "python"
+                       "qt"
+                       "r"
+                       "rakudo"
+                       "rebar"
+                       "renpy"
+                       "ruby"
+                       "scons"
+                       "texlive"
+                       "trivial"
+                       "waf")
+                     nil t) "-build-system")
+ "\")"
+ n> "(home-page \"" p "\")"
+ n> "(synopsis \"" p "\")"
+ n> "(description \"" p "\")"
+ n> "(license " p ")))" n)
+
+(origin...
+ "(origin"
+ n> "(method \""
+ (p (completing-read "method:"
+                     '("url-fetch"
+                       "url-fetch/tarbomb"
+                       "url-fetch/zipbomb"
+                       "cvs-fetch"
+                       "git-fetch"
+                       "hg-fetch"
+                       "svn-fetch"
+                       "bzr-fetch")
+                     nil t) method) "\")"
+ n> "(uri " (cl-case (intern method)
+              ('git-fetch "git-reference...")
+              ('svn-fetch "svn-reference...")
+              ('hg-fetch  "hg-reference...")
+              ('cvs-fetch "cvs-reference...")
+              ('bzr-fetch "bzr-reference...")
+              (t          "(string-append \"https://"))
+ p
+ (if (equal (substring method 0 9)  "url-fetch") "\")")
+ ")"
+ n> (cl-case (intern method)
+      ('git-fetch "(file-name (git-file-name name version))\n")
+      ('hg-fetch "(file-name (hg-file-name name version))\n")
+      ('svn-fetch "(file-name (string-append name \"-\" version \"-checkout\"))\n")
+      ('cvs-fetch "(file-name (string-append name \"-\" version \"-checkout\"))\n")
+      ('bzr-fetch "(file-name (string-append name \"-\" version \"-checkout\"))\n")
+      (t          ""))
+ > "(sha256"
+      n> "(base32 \"" p "\")))")
+
+(git-reference...
+ "(git-reference"
+ n> "(url \"" p "\")"
+ n> "(commit \"" p "\"))")
+
+(svn-reference...
+ "(svn-reference"
+ n> "(url \"" p "\")"
+ n> "(revision \"" p "\"))")
+
+(cvs-reference...
+ "(cvs-reference"
+ n> "(root-directory \"" p "\")"
+ n> "(module \"" p "\")"
+ n> "(revision \"" p "\"))")
+
+(hg-reference...
+ "(hg-reference"
+ n> "(url \"" p "\")"
+ n> "(changeset \"" p "\"))")
+
+(bzr-reference...
+ "(bzr-reference"
+ n> "(url \"" p "\")"
+ n> "(revision \"" p "\"))")
diff --git a/etc/snippets/tempel/text-mode b/etc/snippets/tempel/text-mode
new file mode 100644
index 0000000000..a1400aac69
--- /dev/null
+++ b/etc/snippets/tempel/text-mode
@@ -0,0 +1,101 @@
+-*- mode: lisp-data -*-
+
+text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
+
+(add\ 
+ "gnu: Add "
+ (p
+  (with-temp-buffer
+    (magit-git-wash #'magit-diff-wash-diffs
+      "diff" "--staged")
+    (goto-char (point-min))
+    (when (re-search-forward "\\+(define-public \\(\\S-+\\)" nil 'noerror)
+      (match-string-no-properties 1)))
+  var ) "." n n
+ "* " (car (magit-staged-files)) " (" (s var ) "): New variable.")
+
+(remove\ 
+ "gnu: Remove "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror)
+        (match-string-no-properties 1)))
+    var) "." n n
+ "* " (car (magit-staged-files)) " (" (s var) "): Delete variable.")
+
+(rename\ 
+ "gnu: "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (beginning-of-buffer)
+      (when (search-forward "-(define-public " nil 'noerror)
+        (thing-at-point 'sexp 'no-properties)))
+    prev-var)
+ ": Rename package to "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (beginning-of-buffer)
+      (when (search-forward "+(define-public " nil 'noerror)
+        (thing-at-point 'sexp 'no-properties)))
+    new-var) "." n n
+ "* " (car (magit-staged-files)) " (" (s prev-var) "): Define in terms of" n
+ "'deprecated-package'." n
+ "(" (s new-var) "): New variable, formerly known as \"" (s prev-var) "\".")
+
+(update\ 
+ "gnu: "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
+        (match-string-no-properties 1)))
+    var)
+ ": Update to "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (search-forward "name" nil 'noerror)
+      (search-forward "+" nil 'noerror)   ; first change
+      (when (and (search-forward "version " nil 'noerror)
+                 (looking-at-p "\""))
+        (let ((end (save-excursion (search-forward "\")" nil 'noerror))))
+          (when end
+            (forward-char)
+            (buffer-substring-no-properties (point) (- end 2))))))
+    version) "." n n
+ "* " (car (magit-staged-files)) " (" (s var) "): Update to " (s version) "."
+ (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
+
+(addcl\ 
+ "gnu: Add cl-"
+ (p (replace-regexp-in-string
+     "^cl-" "" (with-temp-buffer
+                 (magit-git-wash #'magit-diff-wash-diffs
+                   "diff" "--staged")
+                 (beginning-of-buffer)
+                 (when (search-forward "+(define-public " nil 'noerror)
+                   (replace-regexp-in-string
+                    "^sbcl-" ""
+                    (thing-at-point 'sexp 'no-properties)))))
+    var) "." n n
+ "* " (car (magit-staged-files))
+ " (cl-" (s var)  ", ecl-" (s var) ", sbcl-" (s var) "): New variables.")
+
+(https\ 
+ "gnu: "
+ (p (with-temp-buffer
+      (magit-git-wash #'magit-diff-wash-diffs
+        "diff" "--staged")
+      (goto-char (point-min))
+      (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
+        (match-string-no-properties 1)))
+    var)
+ ": Use HTTPS home page." n n
+ "* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use HTTPS." n
+ (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
diff --git a/etc/snippets/scheme-mode/guix-bzr-reference b/etc/snippets/yas/scheme-mode/guix-bzr-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-bzr-reference
rename to etc/snippets/yas/scheme-mode/guix-bzr-reference
diff --git a/etc/snippets/scheme-mode/guix-cvs-reference b/etc/snippets/yas/scheme-mode/guix-cvs-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-cvs-reference
rename to etc/snippets/yas/scheme-mode/guix-cvs-reference
diff --git a/etc/snippets/scheme-mode/guix-git-reference b/etc/snippets/yas/scheme-mode/guix-git-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-git-reference
rename to etc/snippets/yas/scheme-mode/guix-git-reference
diff --git a/etc/snippets/scheme-mode/guix-hg-reference b/etc/snippets/yas/scheme-mode/guix-hg-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-hg-reference
rename to etc/snippets/yas/scheme-mode/guix-hg-reference
diff --git a/etc/snippets/scheme-mode/guix-origin b/etc/snippets/yas/scheme-mode/guix-origin
similarity index 100%
rename from etc/snippets/scheme-mode/guix-origin
rename to etc/snippets/yas/scheme-mode/guix-origin
diff --git a/etc/snippets/scheme-mode/guix-package b/etc/snippets/yas/scheme-mode/guix-package
similarity index 100%
rename from etc/snippets/scheme-mode/guix-package
rename to etc/snippets/yas/scheme-mode/guix-package
diff --git a/etc/snippets/scheme-mode/guix-svn-reference b/etc/snippets/yas/scheme-mode/guix-svn-reference
similarity index 100%
rename from etc/snippets/scheme-mode/guix-svn-reference
rename to etc/snippets/yas/scheme-mode/guix-svn-reference
diff --git a/etc/snippets/text-mode/guix-commit-message-add-cl-package b/etc/snippets/yas/text-mode/guix-commit-message-add-cl-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-add-cl-package
rename to etc/snippets/yas/text-mode/guix-commit-message-add-cl-package
diff --git a/etc/snippets/text-mode/guix-commit-message-add-package b/etc/snippets/yas/text-mode/guix-commit-message-add-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-add-package
rename to etc/snippets/yas/text-mode/guix-commit-message-add-package
diff --git a/etc/snippets/text-mode/guix-commit-message-remove-package b/etc/snippets/yas/text-mode/guix-commit-message-remove-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-remove-package
rename to etc/snippets/yas/text-mode/guix-commit-message-remove-package
diff --git a/etc/snippets/text-mode/guix-commit-message-rename-package b/etc/snippets/yas/text-mode/guix-commit-message-rename-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-rename-package
rename to etc/snippets/yas/text-mode/guix-commit-message-rename-package
diff --git a/etc/snippets/text-mode/guix-commit-message-update-package b/etc/snippets/yas/text-mode/guix-commit-message-update-package
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-update-package
rename to etc/snippets/yas/text-mode/guix-commit-message-update-package
diff --git a/etc/snippets/text-mode/guix-commit-message-use-https-home-page b/etc/snippets/yas/text-mode/guix-commit-message-use-https-home-page
similarity index 100%
rename from etc/snippets/text-mode/guix-commit-message-use-https-home-page
rename to etc/snippets/yas/text-mode/guix-commit-message-use-https-home-page
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Fri, 12 Aug 2022 09:00:02 GMT) Full text and rfc822 format available.

Message #41 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 57069 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v3 2/4] etc: Add tempel snippet for :phases.
Date: Fri, 12 Aug 2022 10:58:49 +0200
---
 etc/snippets/tempel/scheme-mode | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/etc/snippets/tempel/scheme-mode b/etc/snippets/tempel/scheme-mode
index 386c9e653f..34625420be 100644
--- a/etc/snippets/tempel/scheme-mode
+++ b/etc/snippets/tempel/scheme-mode
@@ -112,3 +112,13 @@ scheme-mode
  "(bzr-reference"
  n> "(url \"" p "\")"
  n> "(revision \"" p "\"))")
+
+(:phases
+ ":phases (modify-phases %standard-phases" n>
+ "(" (p (completing-read "modify:"
+                         '("add-before"
+                           "replace"
+                           "add-after"
+                           "delete ")
+                         nil t))
+ " '" q "))" )
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Fri, 12 Aug 2022 09:00:03 GMT) Full text and rfc822 format available.

Message #44 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 57069 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v3 3/4] etc: Add tempel snippet for license:.
Date: Fri, 12 Aug 2022 10:58:50 +0200
---
 etc/snippets/tempel/scheme-mode | 117 ++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)

diff --git a/etc/snippets/tempel/scheme-mode b/etc/snippets/tempel/scheme-mode
index 34625420be..1a354923fa 100644
--- a/etc/snippets/tempel/scheme-mode
+++ b/etc/snippets/tempel/scheme-mode
@@ -122,3 +122,120 @@ scheme-mode
                            "delete ")
                          nil t))
  " '" q "))" )
+
+(license:
+ "license:"
+ (p (completing-read "license:"
+                     '("agpl1"
+                       "agpl3"
+                       "agpl3+"
+                       "apsl2"
+                       "asl1.1"
+                       "asl2.0"
+                       "boost1.0"
+                       "bsd-0"
+                       "bsd-1"
+                       "bsd-2"
+                       "bsd-3"
+                       "bsd-4"
+                       "non-copyleft"
+                       "cc0"
+                       "cc-by-sa4.0"
+                       "cc-by-sa3.0"
+                       "cc-by-sa2.0"
+                       "cc-by4.0"
+                       "cc-by3.0"
+                       "cc-by2.0"
+                       "cddl1.0"
+                       "cddl1.1"
+                       "cecill"
+                       "cecill-b"
+                       "cecill-c"
+                       "artistic2.0"
+                       "clarified-artistic"
+                       "copyleft-next"
+                       "cpl1.0"
+                       "cua-opl1.0"
+                       "edl1.0"
+                       "epl1.0"
+                       "epl2.0"
+                       "eupl1.2"
+                       "expat"
+                       "expat-0"
+                       "freetype"
+                       "giftware"
+                       "gpl1"
+                       "gpl1+"
+                       "gpl2"
+                       "gpl2+"
+                       "gpl3"
+                       "gpl3+"
+                       "gfl1.0"
+                       "fdl1.1+"
+                       "fdl1.2+"
+                       "fdl1.3+"
+                       "freebsd-doc"
+                       "opl1.0+"
+                       "osl2.1"
+                       "isc"
+                       "ijg"
+                       "ibmpl1.0"
+                       "imlib2"
+                       "ipa"
+                       "knuth"
+                       "lal1.3"
+                       "lgpl2.0"
+                       "lgpl2.0+"
+                       "lgpl2.1"
+                       "lgpl2.1+"
+                       "lgpl3"
+                       "lgpl3+"
+                       "llgpl"
+                       "lppl"
+                       "lppl1.0+"
+                       "lppl1.1+"
+                       "lppl1.2"
+                       "lppl1.2+"
+                       "lppl1.3"
+                       "lppl1.3+"
+                       "lppl1.3a"
+                       "lppl1.3a+"
+                       "lppl1.3b"
+                       "lppl1.3b+"
+                       "lppl1.3c"
+                       "lppl1.3c+"
+                       "miros"
+                       "mpl1.0"
+                       "mpl1.1"
+                       "mpl2.0"
+                       "ms-pl"
+                       "ncsa"
+                       "nmap"
+                       "ogl-psi1.0"
+                       "openssl"
+                       "openldap2.8"
+                       "perl-license"
+                       "psfl"
+                       "public-domain"
+                       "qpl"
+                       "qwt1.0"
+                       "repoze"
+                       "ruby"
+                       "sgifreeb2.0"
+                       "silofl1.1"
+                       "sleepycat"
+                       "tcl/tk"
+                       "vim"
+                       "unicode"
+                       "unlicense"
+                       "w3c"
+                       "wtfpl2"
+                       "wxwindows3.1+"
+                       "x11"
+                       "x11-style"
+                       "zpl2.1"
+                       "zlib"
+                       "hpnd"
+                       "fsf-free"
+                       "fsdg-compatible")
+                     nil t)))
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Fri, 12 Aug 2022 09:00:03 GMT) Full text and rfc822 format available.

Message #47 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 57069 <at> debbugs.gnu.org
Cc: ngraves <at> ngraves.fr
Subject: [PATCH v3 4/4] etc: Update guix-package yasnippet build-system list.
Date: Fri, 12 Aug 2022 10:58:51 +0200
---
 etc/snippets/yas/scheme-mode/guix-package | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/etc/snippets/yas/scheme-mode/guix-package b/etc/snippets/yas/scheme-mode/guix-package
index 9ff6f997d1..724a392f81 100644
--- a/etc/snippets/yas/scheme-mode/guix-package
+++ b/etc/snippets/yas/scheme-mode/guix-package
@@ -11,6 +11,7 @@
                                           "ant-build-system"
                                           "asdf-build-system"
                                           "cargo-build-system"
+                                          "chicken-build-system"
                                           "clojure-build-system"
                                           "cmake-build-system"
                                           "copy-build-system"
@@ -27,6 +28,7 @@
                                           "linux-module-build-system"
                                           "maven-build-system"
                                           "meson-build-system"
+                                          "minetest-build-system"
                                           "minify-build-system"
                                           "node-build-system"
                                           "ocaml-build-system"
@@ -35,6 +37,8 @@
                                           "qt-build-system"
                                           "r-build-system"
                                           "rakudo-build-system"
+                                          "rebar-build-system"
+                                          "renpy-build-system"
                                           "ruby-build-system"
                                           "scons-build-system"
                                           "texlive-build-system"
-- 
2.37.1





Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Tue, 16 Aug 2022 04:25:01 GMT) Full text and rfc822 format available.

Message #50 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, Nicolas Graves
 <ngraves <at> ngraves.fr>, 57069 <at> debbugs.gnu.org
Subject: Re: Tempel snippets
Date: Tue, 16 Aug 2022 07:23:47 +0300
[Message part 1 (text/plain, inline)]
On 2022-08-11 17:53, Liliana Marie Prikler wrote:

> Am Donnerstag, dem 11.08.2022 um 08:17 +0200 schrieb Nicolas Graves:
>> 
>> > - I couldn't match a small part of current yasnippet configuration,
>> >   currently only the part in uri when url-fetch is chosen. Sent
>> >   a "help/feature report" here
>> > https://github.com/minad/tempel/issues/65.
>> > 
>> > If this is possible, we could probably further factorize and
>> > integrate the
>> > snippets logic, maybe to reach something like that for origin
>> > expansion.
>> 
>> Daniel Mendler confirmed that recursive templates were not supported,
>> hence I cannot further improve snippets.  I've sent an updated patch
>> with "-build-system" added only once at the end.
>> 
>> Waiting for them to be adopted ;)
> I'll reply to the actual patches with the review.
>
>> PS : it would be great to add a "snippets" output to the guix
>> package, so that one can use (file-append guix:snippets "/tempel/")
>> to include them in a guix home configuration.
> Note that you can (file-append (package-source guix) "etc/snippets")

Probably not yet, there is no build phase, which copies etc/snippets to
out so far.

>
> Cheers

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Tue, 16 Aug 2022 16:10:02 GMT) Full text and rfc822 format available.

Message #53 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Andrew Tropin <andrew <at> trop.in>, Nicolas Graves <ngraves <at> ngraves.fr>, 
 57069 <at> debbugs.gnu.org
Subject: Re: Tempel snippets
Date: Tue, 16 Aug 2022 18:09:05 +0200
Am Dienstag, dem 16.08.2022 um 07:23 +0300 schrieb Andrew Tropin:
> On 2022-08-11 17:53, Liliana Marie Prikler wrote:
> 
> > Am Donnerstag, dem 11.08.2022 um 08:17 +0200 schrieb Nicolas
> > Graves:
> > > 
> > > > - I couldn't match a small part of current yasnippet
> > > > configuration,
> > > >   currently only the part in uri when url-fetch is chosen. Sent
> > > >   a "help/feature report" here
> > > > https://github.com/minad/tempel/issues/65.
> > > > 
> > > > If this is possible, we could probably further factorize and
> > > > integrate the
> > > > snippets logic, maybe to reach something like that for origin
> > > > expansion.
> > > 
> > > Daniel Mendler confirmed that recursive templates were not
> > > supported,
> > > hence I cannot further improve snippets.  I've sent an updated
> > > patch
> > > with "-build-system" added only once at the end.
> > > 
> > > Waiting for them to be adopted ;)
> > I'll reply to the actual patches with the review.
> > 
> > > PS : it would be great to add a "snippets" output to the guix
> > > package, so that one can use (file-append guix:snippets
> > > "/tempel/")
> > > to include them in a guix home configuration.
> > Note that you can (file-append (package-source guix)
> > "etc/snippets")
> 
> Probably not yet, there is no build phase, which copies etc/snippets
> to out so far.
You don't need a build phase to copy from an origin, do you?




Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Wed, 17 Aug 2022 04:27:01 GMT) Full text and rfc822 format available.

Message #56 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Andrew Tropin <andrew <at> trop.in>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, Nicolas Graves
 <ngraves <at> ngraves.fr>, 57069 <at> debbugs.gnu.org
Subject: Re: Tempel snippets
Date: Wed, 17 Aug 2022 07:26:36 +0300
[Message part 1 (text/plain, inline)]
On 2022-08-16 18:09, Liliana Marie Prikler wrote:

> Am Dienstag, dem 16.08.2022 um 07:23 +0300 schrieb Andrew Tropin:
>> On 2022-08-11 17:53, Liliana Marie Prikler wrote:
>> 
>> > Am Donnerstag, dem 11.08.2022 um 08:17 +0200 schrieb Nicolas
>> > Graves:
>> > > 
>> > > > - I couldn't match a small part of current yasnippet
>> > > > configuration,
>> > > >   currently only the part in uri when url-fetch is chosen. Sent
>> > > >   a "help/feature report" here
>> > > > https://github.com/minad/tempel/issues/65.
>> > > > 
>> > > > If this is possible, we could probably further factorize and
>> > > > integrate the
>> > > > snippets logic, maybe to reach something like that for origin
>> > > > expansion.
>> > > 
>> > > Daniel Mendler confirmed that recursive templates were not
>> > > supported,
>> > > hence I cannot further improve snippets.  I've sent an updated
>> > > patch
>> > > with "-build-system" added only once at the end.
>> > > 
>> > > Waiting for them to be adopted ;)
>> > I'll reply to the actual patches with the review.
>> > 
>> > > PS : it would be great to add a "snippets" output to the guix
>> > > package, so that one can use (file-append guix:snippets
>> > > "/tempel/")
>> > > to include them in a guix home configuration.
>> > Note that you can (file-append (package-source guix)
>> > "etc/snippets")
>> 
>> Probably not yet, there is no build phase, which copies etc/snippets
>> to out so far.
> You don't need a build phase to copy from an origin, do you?

Oh, I missed (package-source ...) call.  You are right, this should do
the trick!

-- 
Best regards,
Andrew Tropin
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#57069; Package guix-patches. (Tue, 30 Aug 2022 09:52:02 GMT) Full text and rfc822 format available.

Message #59 received at 57069 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Nicolas Graves <ngraves <at> ngraves.fr>, 57069 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] etc: Add tempel snippets.
Date: Tue, 30 Aug 2022 11:51:33 +0200
Am Freitag, dem 12.08.2022 um 08:20 +0200 schrieb Nicolas Graves:
> > > +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.
A strange error indeed.  I encounter a similar one if I use emacs as
EDITOR in git.

> > 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").
The reason I prefer (p "gnu") is because completing-read completely
breaks tempel.  Yes, I'm aware that this won't yield complete feature
parity between tempel and yasnippet, but you have to consider that
these *are* distinct systems after all.

FWIW you could try using NOINSERT t for the p, but I'd hazard a guess
that that still won't give you the prompt at the right time with the
correct safeties.

> > 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?
I got (p "url-fetch" method), which uses "url-fetch" as default value
and binds method.

> > 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.
Bummer, but I got something working out of it anyway.

> > 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
> approach as the yasnippet template, since these field are almost
> always left untouched. I don't see the benefit of this other
> approach.
The benefit would have been that auto-completion is relatively cheap,
so folks could just write git, see git-file-name, TAB, M-RET, done.

> 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! 
I see you already solved it, so I'm now processing v3.  As laid out
above, I replaced all occurrences of completing-read with simple ps, as
those are easier to work with in tempel.  I did keep your cl-case to
conditionally insert git-file-name, etc. but I fixed it up a little so
that it's dynamically recomputed.  I also fixed up the documentation
and dropped the license: completion as it was a completing-read once
more.  You could replace those with a bunch of self-expanding snippets,
but I think geiser and/or dabbrev ought to have us covered here.

Cheers




Reply sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
You have taken responsibility. (Tue, 30 Aug 2022 09:54:02 GMT) Full text and rfc822 format available.

Notification sent to Nicolas Graves <ngraves <at> ngraves.fr>:
bug acknowledged by developer. (Tue, 30 Aug 2022 09:54:02 GMT) Full text and rfc822 format available.

Message #64 received at 57069-done <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Nicolas Graves <ngraves <at> ngraves.fr>, 57069-done <at> debbugs.gnu.org
Subject: Re: [PATCH v2] etc: Add tempel snippets.
Date: Tue, 30 Aug 2022 11:53:18 +0200
Am Dienstag, dem 30.08.2022 um 11:51 +0200 schrieb Liliana Marie
Prikler:
> I see you already solved it, so I'm now processing v3...
Marking as done, since I did push the modified v3

Cheers




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 27 Sep 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.