summaryrefslogtreecommitdiff
path: root/etc/snippets
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-01-30 11:33:18 +0200
committerEfraim Flashner <efraim@flashner.co.il>2023-01-30 12:39:40 +0200
commit4cf1acc7f3033b50b0bf19e02c9f522d522d338c (patch)
tree9fd64956ee60304c15387eb394cd649e49f01467 /etc/snippets
parentedb8c09addd186d9538d43b12af74d6c7aeea082 (diff)
parent595b53b74e3ef57a1c0c96108ba86d38a170a241 (diff)
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts: doc/guix.texi gnu/local.mk gnu/packages/admin.scm gnu/packages/base.scm gnu/packages/chromium.scm gnu/packages/compression.scm gnu/packages/databases.scm gnu/packages/diffoscope.scm gnu/packages/freedesktop.scm gnu/packages/gnome.scm gnu/packages/gnupg.scm gnu/packages/guile.scm gnu/packages/inkscape.scm gnu/packages/llvm.scm gnu/packages/openldap.scm gnu/packages/pciutils.scm gnu/packages/ruby.scm gnu/packages/samba.scm gnu/packages/sqlite.scm gnu/packages/statistics.scm gnu/packages/syndication.scm gnu/packages/tex.scm gnu/packages/tls.scm gnu/packages/version-control.scm gnu/packages/xml.scm guix/build-system/copy.scm guix/scripts/home.scm
Diffstat (limited to 'etc/snippets')
-rw-r--r--etc/snippets/tempel/text-mode258
-rw-r--r--etc/snippets/yas/log-edit-mode/guix-vc-commit-message-add-package9
-rw-r--r--etc/snippets/yas/log-edit-mode/guix-vc-commit-message-remove-package9
-rw-r--r--etc/snippets/yas/log-edit-mode/guix-vc-commit-message-rename-package14
-rw-r--r--etc/snippets/yas/log-edit-mode/guix-vc-commit-message-update-package12
-rw-r--r--etc/snippets/yas/log-edit-mode/guix-vc-commit-message-use-https-home-page9
6 files changed, 202 insertions, 109 deletions
diff --git a/etc/snippets/tempel/text-mode b/etc/snippets/tempel/text-mode
index 8096d92e47..1cda91cba0 100644
--- a/etc/snippets/tempel/text-mode
+++ b/etc/snippets/tempel/text-mode
@@ -1,118 +1,158 @@
-*- mode: lisp-data -*-
-text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
+text-mode :when (and (fboundp 'git-commit-mode) git-commit-mode)
-(add\
- "gnu: Add "
- (p
- (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "\\+(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var ) "." n n
- "* " (car (magit-staged-files)) " (" (s var ) "): New variable.")
+(add\ "gnu: Add "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "\\+(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ "." n n
+ "* " (p (or (car (magit-staged-files)) ""))
+ " (" (s var ) "): New variable.")
-(remove\
- "gnu: Remove "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var) "." n n
- "* " (car (magit-staged-files)) " (" (s var) "): Delete variable.")
+(remove\ "gnu: Remove "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "\\-(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ "." n n
+ "* " (p (or (car (magit-staged-files)) ""))
+ " (" (s var) "): Delete variable.")
-(rename\
- "gnu: "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (beginning-of-buffer)
- (when (search-forward "-(define-public " nil 'noerror)
- (thing-at-point 'sexp 'no-properties)))
- prev-var)
- ": Rename package to "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (beginning-of-buffer)
- (when (search-forward "+(define-public " nil 'noerror)
- (thing-at-point 'sexp 'no-properties)))
- new-var) "." n n
- "* " (car (magit-staged-files)) " (" (s prev-var) "): Define in terms of" n
- "'deprecated-package'." n
- "(" (s new-var) "): New variable, formerly known as \"" (s prev-var) "\".")
+(rename\ "gnu: "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (beginning-of-buffer)
+ (when (search-forward "-(define-public " nil 'noerror)
+ (thing-at-point 'sexp 'no-properties)))
+ prev-var)
+ ": Rename package to "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (beginning-of-buffer)
+ (when (search-forward "+(define-public " nil 'noerror)
+ (thing-at-point 'sexp 'no-properties)))
+ new-var)
+ "." n n
+ "* " (p (or (car (magit-staged-files)) "")) " (" (s prev-var) "): "
+ "Define in terms of" n
+ "'deprecated-package'." n
+ "(" (s new-var) "): New variable, formerly known as \""
+ (s prev-var) "\".")
-(update\
- "gnu: "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var)
- ": Update to "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (search-forward "name" nil 'noerror)
- (search-forward "+" nil 'noerror) ; first change
- (when (and (search-forward "version " nil 'noerror)
- (looking-at-p "\""))
- (let ((end (save-excursion (search-forward "\")" nil 'noerror))))
- (when end
- (forward-char)
- (buffer-substring-no-properties (point) (- end 2))))))
- version) "." n n
- "* " (car (magit-staged-files)) " (" (s var) "): Update to " (s version) "."
- (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
+(update\ "gnu: "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ ": Update to "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (search-forward "name" nil 'noerror)
+ (search-forward "+" nil 'noerror) ; first change
+ (when (and (search-forward "version " nil 'noerror)
+ (looking-at-p "\""))
+ (let ((end (save-excursion (search-forward "\")"
+ nil 'noerror))))
+ (when end
+ (forward-char)
+ (buffer-substring-no-properties (point) (- end 2))))))
+ version)
+ "." n n
+ "* " (p (or (car (magit-staged-files)) "")) " (" (s var) "): "
+ "Update to " (s version) "." n
+ (mapconcat (lambda (file) (concat "* " file))
+ (cdr (magit-staged-files))
+ "\n"))
-(addcl\
- "gnu: Add cl-"
- (p (replace-regexp-in-string
- "^cl-" "" (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (beginning-of-buffer)
- (when (search-forward "+(define-public " nil 'noerror)
- (replace-regexp-in-string
- "^sbcl-" ""
- (thing-at-point 'sexp 'no-properties)))))
- var) "." n n
- "* " (car (magit-staged-files))
- " (cl-" (s var) ", ecl-" (s var) ", sbcl-" (s var) "): New variables.")
+(addcl\ "gnu: Add cl-"
+ (p (replace-regexp-in-string
+ "^cl-" "" (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (beginning-of-buffer)
+ (when (search-forward "+(define-public " nil 'noerror)
+ (replace-regexp-in-string
+ "^sbcl-" ""
+ (thing-at-point 'sexp 'no-properties)))))
+ var)
+ "." n n
+ "* " (p (or (car (magit-staged-files)) ""))
+ " (cl-" (s var)
+ ", ecl-" (s var)
+ ", sbcl-" (s var) "): New variables.")
-(https\
- "gnu: "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var)
- ": Use HTTPS home page." n n
- "* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use HTTPS." n
- (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files))) n)
+(https\ "gnu: "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ ": Use HTTPS home page." n n
+ "* " (p (or (car (magit-staged-files)) ""))
+ " (" (s var) ")[home-page]: Use HTTPS."
+ n
+ (mapconcat (lambda (file) (concat "* " file))
+ (cdr (magit-staged-files))
+ "\n"))
-(move\
- "gnu: "
- (p (with-temp-buffer
- (magit-git-wash #'magit-diff-wash-diffs
- "diff" "--staged")
- (goto-char (point-min))
- (when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror)
- (match-string-no-properties 1)))
- var)
- ": Move to "
- (concat "("
- (string-replace "\.scm" ""
- (string-replace "/" " " (car (magit-staged-files))))
- ").") n
- n "* " (car (magit-staged-files)) " (" (s var) "): Move from here…"
- n "* " (cadr (magit-staged-files)) " (" (s var) "): …to here.")
+(move\ "gnu: "
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (re-search-forward "\\-(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (match-string-no-properties 1)))
+ var)
+ ": Move to ("
+ (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (and
+ (re-search-forward "\\+(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (re-search-backward "modified[ ]*\\(\\S-+\\)"
+ nil 'noerror))
+ (string-replace
+ "\.scm" ""
+ (string-replace "/" " "
+ (match-string-no-properties 1)))))
+ new-module)
+ ")." n
+ n
+ "* " (p (with-temp-buffer
+ (magit-git-wash #'magit-diff-wash-diffs
+ "diff" "--staged")
+ (goto-char (point-min))
+ (when (and
+ (re-search-forward "\\-(define-public \\(\\S-+\\)"
+ nil 'noerror)
+ (re-search-backward "modified[ ]*\\(\\S-+\\)"
+ nil 'noerror))
+ (match-string-no-properties 1)))
+ source)
+ " (" (s var) "): Move from here…" n
+ "* " (concat (string-replace " " "/" new-module) ".scm")
+ " (" (s var) "): …to here.")
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")`