diff mbox series

[bug#57487] guix: Add tempel snippet move.

Message ID 87r10xkcdf.fsf@ngraves.fr
State Accepted
Headers show
Series [bug#57487] guix: Add tempel snippet move. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Nicolas Graves Aug. 30, 2022, 2:57 p.m. UTC
---
 etc/snippets/tempel/text-mode | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Ludovic Courtès Sept. 26, 2022, 7:54 p.m. UTC | #1
Hi,

Nicolas Graves <ngraves@ngraves.fr> skribis:

> ---
>  etc/snippets/tempel/text-mode | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)

Applied with a commit log, thanks!

Ludo’.
diff mbox series

Patch

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.")