Function: git-commit-setup-flyspell
git-commit-setup-flyspell is a byte-compiled function defined in
git-commit.el.
Signature
(git-commit-setup-flyspell)
Documentation
Unconditionally turn on Flyspell mode.
Also check text that is already in the buffer, while avoiding to check most text that Git will strip from the final message, such as the last comment and anything below the cut line ("--- >8 ---").
Aliases
git-commit-turn-on-flyspell (obsolete since git-commit 4.6.0)
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/git-commit.el
(defun git-commit-setup-flyspell ()
"Unconditionally turn on Flyspell mode.
Also check text that is already in the buffer, while avoiding to check
most text that Git will strip from the final message, such as the last
comment and anything below the cut line (\"--- >8 ---\")."
(require 'flyspell)
(flyspell-mode 1)
(setq flyspell-generic-check-word-predicate #'git-commit--flyspell-verify)
(let ((end nil)
;; The "cut line" is defined in "git/wt-status.c". It appears
;; in the commit message when `commit.verbose' is set to true.
(cut-line-regex (format "^%s -\\{8,\\} >8 -\\{8,\\}$" comment-start))
(comment-start-regex (format "^\\(%s\\|$\\)" comment-start)))
(save-excursion
(goto-char (or (re-search-forward cut-line-regex nil t)
(point-max)))
(while (and (not (bobp)) (looking-at comment-start-regex))
(forward-line -1))
(unless (looking-at comment-start-regex)
(forward-line))
(setq end (point)))
(flyspell-region (point-min) end)))