unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#59157] [PATCH] snippets: yas: Add snippets for vc.el
@ 2022-11-09 20:10 Morgan.J.Smith
  2022-11-28 21:55 ` bug#59157: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Morgan.J.Smith @ 2022-11-09 20:10 UTC (permalink / raw)
  To: 59157; +Cc: Morgan Smith

From: Morgan Smith <Morgan.J.Smith@outlook.com>

* 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
---

This recreates the magit snippets but with the builtin Emacs vc stuff.  It
shouldn't conflict with the magit snippets since it will only active in
log-edit-mode (which magit doesn't use).

I didn't really test the rename snippet because testing is hard and I have no
clue what the add-cl-package snippet does so I didn't try to recreate that one.


 .../guix-vc-commit-message-add-package             |  9 +++++++++
 .../guix-vc-commit-message-remove-package          |  9 +++++++++
 .../guix-vc-commit-message-rename-package          | 14 ++++++++++++++
 .../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

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")`
-- 
2.38.0





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

* bug#59157: [PATCH] snippets: yas: Add snippets for vc.el
  2022-11-09 20:10 [bug#59157] [PATCH] snippets: yas: Add snippets for vc.el Morgan.J.Smith
@ 2022-11-28 21:55 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2022-11-28 21:55 UTC (permalink / raw)
  To: Morgan.J.Smith; +Cc: 59157-done

Hi,

Morgan.J.Smith@outlook.com skribis:

> From: Morgan Smith <Morgan.J.Smith@outlook.com>
>
> * 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
> ---
>
> This recreates the magit snippets but with the builtin Emacs vc stuff.  It
> shouldn't conflict with the magit snippets since it will only active in
> log-edit-mode (which magit doesn't use).
>
> I didn't really test the rename snippet because testing is hard and I have no
> clue what the add-cl-package snippet does so I didn't try to recreate that one.

Alright.  I didn’t test it but it looks reasonable and safe, so I went
ahead and applied it.

Thanks!

Ludo’.




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

end of thread, other threads:[~2022-11-28 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 20:10 [bug#59157] [PATCH] snippets: yas: Add snippets for vc.el Morgan.J.Smith
2022-11-28 21:55 ` bug#59157: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).