summary refs log tree commit diff
path: root/etc
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2022-08-30 16:57:32 +0200
committerLudovic Courtès <ludo@gnu.org>2022-09-26 23:29:36 +0200
commitb6274a20e8e99fa6287264289da42ed364fc976c (patch)
treef8c8a61f2af6e122872dfa4da0c359bad0ff6279 /etc
parent1033645e9d3899edd6b052b19e24c0a718b95e88 (diff)
downloadguix-b6274a20e8e99fa6287264289da42ed364fc976c.tar.gz
etc: Add tempel snippet move.
* etc/snippets/tempel/text-mode (move\): New entry.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'etc')
-rw-r--r--etc/snippets/tempel/text-mode17
1 files changed, 17 insertions, 0 deletions
diff --git a/etc/snippets/tempel/text-mode b/etc/snippets/tempel/text-mode
index a1400aac69..8096d92e47 100644
--- a/etc/snippets/tempel/text-mode
+++ b/etc/snippets/tempel/text-mode
@@ -99,3 +99,20 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
  ": 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)
+
+(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.")