snippets: tempel: Reformat.

This makes it so that ‘indent-region’ and ‘delete-trailing-whitespace’ do not
change the file.

* etc/snippets/tempel/text-mode: Reformat.
This commit is contained in:
Liliana Marie Prikler 2022-10-06 19:04:23 +02:00
parent 980c34853e
commit da281417cc
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -2,31 +2,31 @@
text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode)) text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
(add\ (add\ "gnu: 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.")
(remove\
"gnu: Remove "
(p (with-temp-buffer (p (with-temp-buffer
(magit-git-wash #'magit-diff-wash-diffs (magit-git-wash #'magit-diff-wash-diffs
"diff" "--staged") "diff" "--staged")
(goto-char (point-min)) (goto-char (point-min))
(when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror) (when (re-search-forward "\\+(define-public \\(\\S-+\\)"
nil 'noerror)
(match-string-no-properties 1))) (match-string-no-properties 1)))
var) "." n n var)
"." n n
"* " (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.") "* " (car (magit-staged-files)) " (" (s var) "): Delete variable.")
(rename\ (rename\ "gnu: "
"gnu: "
(p (with-temp-buffer (p (with-temp-buffer
(magit-git-wash #'magit-diff-wash-diffs (magit-git-wash #'magit-diff-wash-diffs
"diff" "--staged") "diff" "--staged")
@ -41,18 +41,21 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
(beginning-of-buffer) (beginning-of-buffer)
(when (search-forward "+(define-public " nil 'noerror) (when (search-forward "+(define-public " nil 'noerror)
(thing-at-point 'sexp 'no-properties))) (thing-at-point 'sexp 'no-properties)))
new-var) "." n n new-var)
"* " (car (magit-staged-files)) " (" (s prev-var) "): Define in terms of" n "." n n
"* " (car (magit-staged-files)) " (" (s prev-var) "): "
"Define in terms of" n
"'deprecated-package'." n "'deprecated-package'." n
"(" (s new-var) "): New variable, formerly known as \"" (s prev-var) "\".") "(" (s new-var) "): New variable, formerly known as \""
(s prev-var) "\".")
(update\ (update\ "gnu: "
"gnu: "
(p (with-temp-buffer (p (with-temp-buffer
(magit-git-wash #'magit-diff-wash-diffs (magit-git-wash #'magit-diff-wash-diffs
"diff" "--staged") "diff" "--staged")
(goto-char (point-min)) (goto-char (point-min))
(when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror) (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)"
nil 'noerror)
(match-string-no-properties 1))) (match-string-no-properties 1)))
var) var)
": Update to " ": Update to "
@ -64,16 +67,20 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
(search-forward "+" nil 'noerror) ; first change (search-forward "+" nil 'noerror) ; first change
(when (and (search-forward "version " nil 'noerror) (when (and (search-forward "version " nil 'noerror)
(looking-at-p "\"")) (looking-at-p "\""))
(let ((end (save-excursion (search-forward "\")" nil 'noerror)))) (let ((end (save-excursion (search-forward "\")"
nil 'noerror))))
(when end (when end
(forward-char) (forward-char)
(buffer-substring-no-properties (point) (- end 2)))))) (buffer-substring-no-properties (point) (- end 2))))))
version) "." n n version)
"* " (car (magit-staged-files)) " (" (s var) "): Update to " (s version) "." "." n n
n (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files)) "\n")) "* " (car (magit-staged-files)) " (" (s var) "): "
"Update to " (s version) "." n
(mapconcat (lambda (file) (concat "* " file))
(cdr (magit-staged-files))
"\n"))
(addcl\ (addcl\ "gnu: Add cl-"
"gnu: Add cl-"
(p (replace-regexp-in-string (p (replace-regexp-in-string
"^cl-" "" (with-temp-buffer "^cl-" "" (with-temp-buffer
(magit-git-wash #'magit-diff-wash-diffs (magit-git-wash #'magit-diff-wash-diffs
@ -83,36 +90,44 @@ text-mode :when (and (fboundp 'git-commit-mode) (git-commit-mode))
(replace-regexp-in-string (replace-regexp-in-string
"^sbcl-" "" "^sbcl-" ""
(thing-at-point 'sexp 'no-properties))))) (thing-at-point 'sexp 'no-properties)))))
var) "." n n var)
"." n n
"* " (car (magit-staged-files)) "* " (car (magit-staged-files))
" (cl-" (s var) ", ecl-" (s var) ", sbcl-" (s var) "): New variables.") " (cl-" (s var)
", ecl-" (s var)
", sbcl-" (s var) "): New variables.")
(https\ (https\ "gnu: "
"gnu: "
(p (with-temp-buffer (p (with-temp-buffer
(magit-git-wash #'magit-diff-wash-diffs (magit-git-wash #'magit-diff-wash-diffs
"diff" "--staged") "diff" "--staged")
(goto-char (point-min)) (goto-char (point-min))
(when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror) (when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)"
nil 'noerror)
(match-string-no-properties 1))) (match-string-no-properties 1)))
var) var)
": Use HTTPS home page." n n ": Use HTTPS home page." n n
"* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use HTTPS." n "* " (car (magit-staged-files)) " (" (s var) ")[home-page]: Use HTTPS."
(mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files)) "\n")) n
(mapconcat (lambda (file) (concat "* " file))
(cdr (magit-staged-files))
"\n"))
(move\ (move\ "gnu: "
"gnu: "
(p (with-temp-buffer (p (with-temp-buffer
(magit-git-wash #'magit-diff-wash-diffs (magit-git-wash #'magit-diff-wash-diffs
"diff" "--staged") "diff" "--staged")
(goto-char (point-min)) (goto-char (point-min))
(when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror) (when (re-search-forward "\\-(define-public \\(\\S-+\\)"
nil 'noerror)
(match-string-no-properties 1))) (match-string-no-properties 1)))
var) var)
": Move to " ": Move to "
(concat "(" (concat "("
(string-replace "\.scm" "" (string-replace "\.scm" ""
(string-replace "/" " " (car (magit-staged-files)))) (string-replace "/" " "
").") n (car (magit-staged-files))))
").")
n
n "* " (car (magit-staged-files)) " (" (s var) "): Move from here…" n "* " (car (magit-staged-files)) " (" (s var) "): Move from here…"
n "* " (cadr (magit-staged-files)) " (" (s var) "): …to here.") n "* " (cadr (magit-staged-files)) " (" (s var) "): …to here.")