[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 61f3a4b: Add flyspell option to ignore duplicates o
From: |
Reuben Thomas |
Subject: |
[Emacs-diffs] master 61f3a4b: Add flyspell option to ignore duplicates of different case |
Date: |
Mon, 10 Sep 2018 10:09:08 -0400 (EDT) |
branch: master
commit 61f3a4b4fcc43241caaac63195205774ab1a5732
Author: Reuben Thomas <address@hidden>
Commit: Reuben Thomas <address@hidden>
Add flyspell option to ignore duplicates of different case
* lisp/textmodes/flyspell.el (flyspell-case-fold-duplications): Add
option.
---
etc/NEWS | 7 +++++++
lisp/textmodes/flyspell.el | 9 ++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/etc/NEWS b/etc/NEWS
index 9ab2622..fa93112 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -232,6 +232,13 @@ typographic quotes, “like this”, in text modes, and in
comments in
non-text modes.
---
+** New user option 'flyspell-case-fold-duplications'.
+This option controls whether Flyspell mode considers consecutive words
+to be duplicates if they are not in the same case. If non-nil, the
+default, words are considered to be duplicates even if their letters'
+case does not match.
+
+---
** 'write-abbrev-file' now includes special properties.
'write-abbrev-file' now writes special properties like ':case-fixed'
for abbrevs that have them.
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index f6a809b..e5a7639 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")))
@@ -1154,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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 61f3a4b: Add flyspell option to ignore duplicates of different case,
Reuben Thomas <=