From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 57069@debbugs.gnu.org
Cc: Nicolas Graves <ngraves@ngraves.fr>,
Liliana Marie Prikler <liliana.prikler@gmail.com>
Subject: [bug#57069] Tempel snippets
Date: Tue, 09 Aug 2022 12:16:21 +0200 [thread overview]
Message-ID: <87a68dpvre.fsf@ngraves.fr> (raw)
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
next reply other threads:[~2022-08-09 10:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-09 10:16 Nicolas Graves via Guix-patches via [this message]
2022-08-09 10:24 ` [bug#57069] [PATCH 1/4] etc: Add tempel snippets Nicolas Graves via Guix-patches via
2022-08-09 10:24 ` [bug#57069] [PATCH 2/4] etc: Add tempel snippet for :phases Nicolas Graves via Guix-patches via
2022-08-09 10:24 ` [bug#57069] [PATCH 3/4] etc: Add tempel snippet for license: Nicolas Graves via Guix-patches via
2022-08-09 10:24 ` [bug#57069] [PATCH 4/4] etc: Update guix-package yasnippet build-system list Nicolas Graves via Guix-patches via
2022-08-09 16:52 ` [bug#57069] Tempel snippets Liliana Marie Prikler
2022-08-11 6:17 ` Nicolas Graves via Guix-patches via
2022-08-11 15:53 ` Liliana Marie Prikler
2022-08-16 4:23 ` Andrew Tropin
2022-08-16 16:09 ` Liliana Marie Prikler
2022-08-17 4:26 ` Andrew Tropin
2022-08-11 6:07 ` [bug#57069] [PATCH v2] etc: Add tempel snippets Nicolas Graves via Guix-patches via
2022-08-11 16:21 ` Liliana Marie Prikler
2022-08-12 6:20 ` Nicolas Graves via Guix-patches via
2022-08-30 9:51 ` Liliana Marie Prikler
2022-08-30 9:53 ` bug#57069: " Liliana Marie Prikler
2022-08-12 8:58 ` [bug#57069] [PATCH v3 1/4] " Nicolas Graves via Guix-patches via
2022-08-12 8:58 ` [bug#57069] [PATCH v3 2/4] etc: Add tempel snippet for :phases Nicolas Graves via Guix-patches via
2022-08-12 8:58 ` [bug#57069] [PATCH v3 3/4] etc: Add tempel snippet for license: Nicolas Graves via Guix-patches via
2022-08-12 8:58 ` [bug#57069] [PATCH v3 4/4] etc: Update guix-package yasnippet build-system list Nicolas Graves via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a68dpvre.fsf@ngraves.fr \
--to=guix-patches@gnu.org \
--cc=57069@debbugs.gnu.org \
--cc=liliana.prikler@gmail.com \
--cc=ngraves@ngraves.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.