From fcb59fe24afc064b87b3abaf91140d015b4eb889 Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Wed, 9 Nov 2022 15:10:02 -0500 Subject: snippets: yas: Add snippets for vc.el MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * etc/snippets/yas/log-edit-mode/guix-vc-commit-message-add-package: * etc/snippets/yas/log-edit-mode/guix-vc-commit-message-remove-package: * etc/snippets/yas/log-edit-mode/guix-vc-commit-message-rename-package: * etc/snippets/yas/log-edit-mode/guix-vc-commit-message-update-package: * etc/snippets/yas/log-edit-mode/guix-vc-commit-message-use-https-home-page: New file Signed-off-by: Ludovic Courtès --- .../yas/log-edit-mode/guix-vc-commit-message-add-package | 9 +++++++++ .../log-edit-mode/guix-vc-commit-message-remove-package | 9 +++++++++ .../log-edit-mode/guix-vc-commit-message-rename-package | 14 ++++++++++++++ .../log-edit-mode/guix-vc-commit-message-update-package | 12 ++++++++++++ .../guix-vc-commit-message-use-https-home-page | 9 +++++++++ 5 files changed, 53 insertions(+) create mode 100644 etc/snippets/yas/log-edit-mode/guix-vc-commit-message-add-package create mode 100644 etc/snippets/yas/log-edit-mode/guix-vc-commit-message-remove-package create mode 100644 etc/snippets/yas/log-edit-mode/guix-vc-commit-message-rename-package create mode 100644 etc/snippets/yas/log-edit-mode/guix-vc-commit-message-update-package create mode 100644 etc/snippets/yas/log-edit-mode/guix-vc-commit-message-use-https-home-page (limited to 'etc') diff --git a/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-add-package b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-add-package new file mode 100644 index 0000000000..cc2dddb1e0 --- /dev/null +++ b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-add-package @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: guix-vc-commit-message-add-package +# key: add +# -- +gnu: Add ${1:`(when (string-match "\\+(define-public \\(\\S-+\\)" vc-patch-string) + (match-string-no-properties 1 vc-patch-string))`}. + +* `(car (log-edit-files))` ($1): New variable. +`(mapconcat (lambda (file) (concat "* " file)) (cdr (log-edit-files)) "\n")` diff --git a/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-remove-package b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-remove-package new file mode 100644 index 0000000000..9ab4ce6156 --- /dev/null +++ b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-remove-package @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: guix-vc-commit-message-remove-package +# key: remove +# -- +gnu: Remove ${1:`(when (string-match "\\-(define-public \\(\\S-+\\)" vc-patch-string) + (match-string-no-properties 1 vc-patch-string))`}. + +* `(car (log-edit-files))` ($1): Delete variable. +`(mapconcat (lambda (file) (concat "* " file)) (cdr (log-edit-files)) "\n")` diff --git a/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-rename-package b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-rename-package new file mode 100644 index 0000000000..89c85f8016 --- /dev/null +++ b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-rename-package @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: guix-vc-commit-message-rename-package +# key: rename +# -- +gnu: ${1:`(when (string-match "\\-(define-public \\(\\S-+\\)" vc-patch-string) + (match-string-no-properties 1 vc-patch-string)) + `}: Rename package to ${2:` + (when (string-match "\\+(define-public \\(\\S-+\\)" vc-patch-string) + (match-string-no-properties 1 vc-patch-string))`}. + +* `(car (log-edit-files))` ($1): Define in terms of +'deprecated-package'. +($2): New variable, formerly known as "$1". +`(mapconcat (lambda (file) (concat "* " file)) (cdr (log-edit-files)) "\n")` diff --git a/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-update-package b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-update-package new file mode 100644 index 0000000000..b5e41709f5 --- /dev/null +++ b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-update-package @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: guix-vc-commit-message-update-package +# key: update +# -- + +gnu: ${1:`(when (string-match "^[ ]*(define-public \\(\\S-+\\)" vc-patch-string) + (match-string-no-properties 1 vc-patch-string))`}: Update to ${2:` + (when (string-match "^\\+[ ]*(version \"\\(.*\\)\"" vc-patch-string) + (match-string-no-properties 1 vc-patch-string))`}. + +* `(car (log-edit-files))` ($1): Update to $2.$0 +`(mapconcat (lambda (file) (concat "* " file)) (cdr (log-edit-files)) "\n")` diff --git a/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-use-https-home-page b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-use-https-home-page new file mode 100644 index 0000000000..e0f170b015 --- /dev/null +++ b/etc/snippets/yas/log-edit-mode/guix-vc-commit-message-use-https-home-page @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: guix-vc-commit-message-use-https-home-page +# key: https +# -- +gnu: ${1:`(when (string-match "^[ ]*(define-public \\(\\S-+\\)" vc-patch-string) + (match-string-no-properties 1 vc-patch-string))`}: Use HTTPS home page URI. + +* `(car (log-edit-files))` ($1)[home-page]: Use HTTPS URI. +`(mapconcat (lambda (file) (concat "* " file)) (cdr (log-edit-files)) "\n")` -- cgit 1.4.1