all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>, 57069@debbugs.gnu.org
Subject: [bug#57069] [PATCH v2] etc: Add tempel snippets.
Date: Fri, 12 Aug 2022 08:20:53 +0200	[thread overview]
Message-ID: <87czd69e4a.fsf@ngraves.fr> (raw)
In-Reply-To: <e833b9a131dd638b872978a9f69f78a42998b350.camel@gmail.com>


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




  reply	other threads:[~2022-08-12  6:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09 10:16 [bug#57069] Tempel snippets Nicolas Graves via Guix-patches via
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 [this message]
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=87czd69e4a.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.