all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#57069] Tempel snippets
@ 2022-08-09 10:16 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
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2022-08-09 10:16 UTC (permalink / raw)
  To: 57069; +Cc: Nicolas Graves, Liliana Marie Prikler


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




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-08-30  9:54 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.