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,117 +2,132 @@
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
(p (magit-git-wash #'magit-diff-wash-diffs
(with-temp-buffer "diff" "--staged")
(magit-git-wash #'magit-diff-wash-diffs (goto-char (point-min))
"diff" "--staged") (when (re-search-forward "\\+(define-public \\(\\S-+\\)"
(goto-char (point-min)) nil 'noerror)
(when (re-search-forward "\\+(define-public \\(\\S-+\\)" nil 'noerror) (match-string-no-properties 1)))
(match-string-no-properties 1))) var)
var ) "." n n "." n n
"* " (car (magit-staged-files)) " (" (s var ) "): New variable.") "* " (car (magit-staged-files)) " (" (s var ) "): New variable.")
(remove\ (remove\ "gnu: 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-+\\)"
(when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror) nil 'noerror)
(match-string-no-properties 1))) (match-string-no-properties 1)))
var) "." n n var)
"* " (car (magit-staged-files)) " (" (s var) "): Delete variable.") "." n n
"* " (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") (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))) prev-var)
prev-var) ": Rename package to "
": Rename package to " (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") (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)
new-var) "." n n "." n n
"* " (car (magit-staged-files)) " (" (s prev-var) "): Define in terms of" n "* " (car (magit-staged-files)) " (" (s prev-var) "): "
"'deprecated-package'." n "Define in terms of" n
"(" (s new-var) "): New variable, formerly known as \"" (s prev-var) "\".") "'deprecated-package'." n
"(" (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-+\\)"
(when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror) nil 'noerror)
(match-string-no-properties 1))) (match-string-no-properties 1)))
var) var)
": Update to " ": Update to "
(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))
(search-forward "name" nil 'noerror) (search-forward "name" nil 'noerror)
(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 "\")"
(when end nil 'noerror))))
(forward-char) (when end
(buffer-substring-no-properties (point) (- end 2)))))) (forward-char)
version) "." n n (buffer-substring-no-properties (point) (- end 2))))))
"* " (car (magit-staged-files)) " (" (s var) "): Update to " (s version) "." version)
n (mapconcat (lambda (file) (concat "* " file)) (cdr (magit-staged-files)) "\n")) "." n 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 "diff" "--staged")
"diff" "--staged") (beginning-of-buffer)
(beginning-of-buffer) (when (search-forward "+(define-public " nil 'noerror)
(when (search-forward "+(define-public " nil 'noerror) (replace-regexp-in-string
(replace-regexp-in-string "^sbcl-" ""
"^sbcl-" "" (thing-at-point 'sexp 'no-properties)))))
(thing-at-point 'sexp 'no-properties))))) var)
var) "." n n "." 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-+\\)"
(when (re-search-forward "^[ ]*(define-public \\(\\S-+\\)" nil 'noerror) 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-+\\)"
(when (re-search-forward "\\-(define-public \\(\\S-+\\)" nil 'noerror) 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 "* " (car (magit-staged-files)) " (" (s var) "): Move from here…" ").")
n "* " (cadr (magit-staged-files)) " (" (s var) "): …to here.") n
n "* " (car (magit-staged-files)) " (" (s var) "): Move from here…"
n "* " (cadr (magit-staged-files)) " (" (s var) "): …to here.")