diff options
Diffstat (limited to 'lisp/textmodes/flyspell.el')
-rw-r--r-- | lisp/textmodes/flyspell.el | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 042f432d635..5e6ea52bff0 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -68,6 +68,12 @@ Detection of repeated words is not implemented in :group 'flyspell :type 'boolean) +(defcustom flyspell-case-fold-duplications t + "Non-nil means Flyspell matches duplicate words case-insensitively." + :group 'flyspell + :type 'boolean + :version "27.1") + (defcustom flyspell-mark-duplications-exceptions '((nil . ("that" "had")) ; Common defaults for English. ("\\`francais" . ("nous" "vous"))) @@ -324,14 +330,16 @@ If this variable is nil, all regions are treated as small." ;;* (lambda () (setq flyspell-generic-check-word-predicate */ ;;* 'mail-mode-flyspell-verify))) */ ;;*---------------------------------------------------------------------*/ + +(define-obsolete-variable-alias 'flyspell-generic-check-word-p + 'flyspell-generic-check-word-predicate "25.1") + (defvar flyspell-generic-check-word-predicate nil "Function providing per-mode customization over which words are flyspelled. Returns t to continue checking, nil otherwise. Flyspell mode sets this variable to whatever is the `flyspell-mode-predicate' property of the major mode name.") (make-variable-buffer-local 'flyspell-generic-check-word-predicate) -(define-obsolete-variable-alias 'flyspell-generic-check-word-p - 'flyspell-generic-check-word-predicate "25.1") ;;*--- mail mode -------------------------------------------------------*/ (put 'mail-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify) @@ -506,9 +514,6 @@ See also `flyspell-duplicate-distance'." ;;;###autoload (define-minor-mode flyspell-mode "Toggle on-the-fly spell checking (Flyspell mode). -With a prefix argument ARG, enable Flyspell mode if ARG is -positive, and disable it otherwise. If called from Lisp, enable -the mode if ARG is omitted or nil. Flyspell mode is a buffer-local minor mode. When enabled, it spawns a single Ispell process and checks each word. The default @@ -985,6 +990,11 @@ Mostly we check word delimiters." (let ((command this-command) ;; Prevent anything we do from affecting the mark. deactivate-mark) + (if (and (eq command 'transpose-chars) + flyspell-pre-point) + (save-excursion + (goto-char (- flyspell-pre-point 1)) + (flyspell-word))) (if (flyspell-check-pre-word-p) (save-excursion '(flyspell-debug-signal-pre-word-checked) @@ -1150,7 +1160,8 @@ spell-check." (- (save-excursion (skip-chars-backward " \t\n\f"))))) (p (when (>= bound (point-min)) - (flyspell-word-search-backward word bound t)))) + (flyspell-word-search-backward + word bound flyspell-case-fold-duplications)))) (and p (/= p start))))) ;; yes, this is a doublon (flyspell-highlight-incorrect-region start end 'doublon) |