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 20:45:51 +0100 [thread overview]
Message-ID: <CAOnWdoj4LtyuSC1cgbqq+d+xHm=46w1HPPHPCuJM3GtxgfvU3A@mail.gmail.com> (raw)
In-Reply-To: <CAOnWdogAe27UZw=bWGCW-b0vtRLjK780zy8eKf5b3bGjawuvQQ@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 937 bytes --]
On 7 September 2018 at 10:49, Reuben Thomas <rrt@sc3d.org> wrote:
> On 7 September 2018 at 06:59, Eli Zaretskii <eliz@gnu.org> wrote:
>
>>
>> I'm not claiming the current behavior is a good default, I'm saying it
>> is there for a long time, and thus takes precedence, because we cannot
>> possibly poll all those users who see that behavior every day and none
>> of them complained.
>>
>> This is why I suggested a new customizable option: that way, you and
>> anyone else who wants Flyspell to behave differently can have that,
>> and if we learn this is the preferred behavior (by getting requests to
>> set that as default), we can make it the default at some future point.
>> IOW, what I suggested is a path towards potentially changing the
>> default, but gradually and without backward incompatibilities. OK?
>>
>
> OK!
>
Attached, a patch. If the code's OK, I can write a NEWS entry (anything
else?).
--
https://rrt.sc3d.org
[-- Attachment #1.2: Type: text/html, Size: 2141 bytes --]
[-- Attachment #2: flyspell-case-fold-doublons-option.patch --]
[-- Type: text/x-patch, Size: 1054 bytes --]
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 4d7a18969e..cf209abf6a 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -68,6 +68,11 @@ 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)
+
(defcustom flyspell-mark-duplications-exceptions
'((nil . ("that" "had")) ; Common defaults for English.
("\\`francais" . ("nous" "vous")))
@@ -1150,7 +1155,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 19:45 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 [this message]
2018-09-09 19:54 ` Eli Zaretskii
2018-09-09 20:24 ` Reuben Thomas
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='CAOnWdoj4LtyuSC1cgbqq+d+xHm=46w1HPPHPCuJM3GtxgfvU3A@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).