From 6994e6743603ab73cc32d32786a55672f4fa46f0 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Tue, 26 Mar 2019 13:44:50 +0100 Subject: [PATCH] etc: Add "rename" snippet. * etc/snippets/text-mode/guix-commit-message-rename-package: New file. --- .../guix-commit-message-rename-package | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 etc/snippets/text-mode/guix-commit-message-rename-package diff --git a/etc/snippets/text-mode/guix-commit-message-rename-package b/etc/snippets/text-mode/guix-commit-message-rename-package new file mode 100644 index 0000000000..9695ca1b3d --- /dev/null +++ b/etc/snippets/text-mode/guix-commit-message-rename-package @@ -0,0 +1,20 @@ +# -*- mode: snippet -*- +# name: guix-commit-message-rename-package +# key: rename +# condition: git-commit-mode +# -- +gnu: ${1:`(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)))`}: Rename package to ${2:`(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)))`}. + +* `(car (magit-staged-files))` ($1): Define in terms of +'deprecated-package'. +($2): New variable, formerly known as "$1". \ No newline at end of file