From: Reuben Thomas <rrt@sc3d.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32651@debbugs.gnu.org
Subject: bug#32651: flyspell marks doublons when not the same case
Date: Sun, 9 Sep 2018 21:24:15 +0100 [thread overview]
Message-ID: <CAOnWdoiAWiCw6Yt4M4pukZUeYjjQ2tTghGOfwSnR_PhLgUSk7g@mail.gmail.com> (raw)
In-Reply-To: <83zhwqphtt.fsf@gnu.org>
[-- Attachment #1.1: Type: text/plain, Size: 460 bytes --]
On 9 September 2018 at 20:54, Eli Zaretskii <eliz@gnu.org> wrote:
> NEWS should be enough, I think. Also...
>
> > +(defcustom flyspell-case-fold-duplications t
> > + "Non-nil means Flyspell matches duplicate words case-insensitively."
> > + :group 'flyspell
> > + :type 'boolean)
>
> This defcustom should have the :version tag.
>
Thanks. How's the attached? If it's OK, I can install it (with suitable
ChangeLog entry) myself.
--
https://rrt.sc3d.org
[-- Attachment #1.2: Type: text/html, Size: 1164 bytes --]
[-- Attachment #2: flyspell-case-fold-doublons-option.patch --]
[-- Type: text/x-patch, Size: 1771 bytes --]
diff --git a/etc/NEWS b/etc/NEWS
index ff65a5520d..587e17d3f3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -231,6 +231,13 @@ characters that quote text "like this" are replaced by double
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'
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index f6a809b18e..e5a7639e20 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -68,6 +68,12 @@ flyspell-mark-duplications-flag
: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 @@ flyspell-word
(- (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)
next prev parent reply other threads:[~2018-09-09 20:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-06 19:16 bug#32651: flyspell marks doublons when not the same case Reuben Thomas
2018-09-06 19:34 ` Eli Zaretskii
2018-09-06 19:37 ` Reuben Thomas
2018-09-06 19:53 ` Eli Zaretskii
2018-09-06 19:58 ` Reuben Thomas
2018-09-07 5:59 ` Eli Zaretskii
2018-09-07 9:49 ` Reuben Thomas
2018-09-09 19:45 ` Reuben Thomas
2018-09-09 19:54 ` Eli Zaretskii
2018-09-09 20:24 ` Reuben Thomas [this message]
2018-09-10 6:26 ` Eli Zaretskii
2018-09-10 14:12 ` Reuben Thomas
2018-09-10 14:13 ` bug#32651: Installed as commit 61f3a4b4f Reuben Thomas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOnWdoiAWiCw6Yt4M4pukZUeYjjQ2tTghGOfwSnR_PhLgUSk7g@mail.gmail.com \
--to=rrt@sc3d.org \
--cc=32651@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).