aboutsummaryrefslogtreecommitdiff
path: root/lisp/git-commit.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-01-01 16:53:09 +0100
committerJonas Bernoulli <jonas@bernoul.li>2026-01-01 16:53:09 +0100
commited67642a25e8aa6fc5c5438fb1ddb6d7c7e94ddf (patch)
tree06f6ac33e8492e36301ede1782365d6d3b3b79da /lisp/git-commit.el
parent1c723f86a3eb75d2082506942b3bc057406b0287 (diff)
Improve indentation of cond
Emacs 31.1 adds variable `lisp-indent-local-overrides'.
Diffstat (limited to 'lisp/git-commit.el')
-rw-r--r--lisp/git-commit.el44
1 files changed, 22 insertions, 22 deletions
diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index aee3646..c2133c0 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -159,14 +159,14 @@ full loading."
(remove-hook 'after-change-major-mode-hook
#'git-commit-setup-font-lock-in-buffer)))
(cond
- (global-git-commit-mode
- (add-hook 'find-file-hook #'git-commit-setup-check-buffer)
- (add-hook 'after-change-major-mode-hook
- #'git-commit-setup-font-lock-in-buffer))
- (t
- (remove-hook 'find-file-hook #'git-commit-setup-check-buffer)
- (remove-hook 'after-change-major-mode-hook
- #'git-commit-setup-font-lock-in-buffer))))
+ (global-git-commit-mode
+ (add-hook 'find-file-hook #'git-commit-setup-check-buffer)
+ (add-hook 'after-change-major-mode-hook
+ #'git-commit-setup-font-lock-in-buffer))
+ (t
+ (remove-hook 'find-file-hook #'git-commit-setup-check-buffer)
+ (remove-hook 'after-change-major-mode-hook
+ #'git-commit-setup-font-lock-in-buffer))))
(defcustom git-commit-major-mode #'text-mode
"Major mode used to edit Git commit messages.
@@ -915,20 +915,20 @@ completion candidates. The input must have the form \"NAME <EMAIL>\"."
(setq leading-comment-end (point))
(goto-char (point-max))
(cond
- ;; Look backwards for existing trailers.
- ((re-search-backward (git-commit--trailer-regexp) nil t)
- (end-of-line)
- (insert ?\n string)
- (unless (= (char-after) ?\n)
- (insert ?\n)))
- ;; Or place the new trailer right before the first non-leading
- ;; comments.
- (t
- (while (re-search-backward (concat "^" comment-start)
- leading-comment-end t))
- (unless (looking-back "\n\n" nil)
- (insert ?\n))
- (insert string ?\n))))
+ ;; Look backwards for existing trailers.
+ ((re-search-backward (git-commit--trailer-regexp) nil t)
+ (end-of-line)
+ (insert ?\n string)
+ (unless (= (char-after) ?\n)
+ (insert ?\n)))
+ ;; Or place the new trailer right before the first non-leading
+ ;; comments.
+ (t
+ (while (re-search-backward (concat "^" comment-start)
+ leading-comment-end t))
+ (unless (looking-back "\n\n" nil)
+ (insert ?\n))
+ (insert string ?\n))))
(unless (or (eobp) (= (char-after) ?\n))
(insert ?\n))))