From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Flyspell difficult to configure, documentation not honest Date: Fri, 13 Jul 2018 09:35:56 +0300 Message-ID: <83in5jej77.fsf@gnu.org> References: <1186940967.5630978.1531432200575.ref@mail.yahoo.com> <1186940967.5630978.1531432200575@mail.yahoo.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1531463670 12718 195.159.176.226 (13 Jul 2018 06:34:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 13 Jul 2018 06:34:30 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "R. Diez" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 13 08:34:26 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdrer-0003B3-6x for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Jul 2018 08:34:25 +0200 Original-Received: from localhost ([::1]:35488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdrgy-0006TV-4R for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Jul 2018 02:36:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdrgO-0006TN-7b for help-gnu-emacs@gnu.org; Fri, 13 Jul 2018 02:36:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdrgK-0006zJ-8T for help-gnu-emacs@gnu.org; Fri, 13 Jul 2018 02:36:00 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdrgK-0006zB-3p; Fri, 13 Jul 2018 02:35:56 -0400 Original-Received: from [176.228.60.248] (port=3084 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fdrgI-00074t-O2; Fri, 13 Jul 2018 02:35:55 -0400 In-reply-to: <1186940967.5630978.1531432200575@mail.yahoo.com> (rdiezmail-emacs@yahoo.de) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117421 Archived-At: > Date: Thu, 12 Jul 2018 21:50:00 +0000 (UTC) > From: "R. Diez" > Cc: "help-gnu-emacs@gnu.org" > > First of all, thanks for your answer and the fixes to the source code and docs. You are welcome. In the future, I suggest to post such reports using "M-x report-emacs-bug RET", as that is how we prefer to deal with bugs and feature requests. > >> I tried flyspell-region, and that is one of the biggest surprises: > >> the spell check is performed just once, and is not updated > >> as I type inside that region. > > > Like everything else in Flyspell, misspelled words are re-checked > > when you move across them or modify them. That's a feature. > > > If you don't like that, I suggest to use ispell-region instead. > > On the contrary, that is the behaviour I do want. Am I doing something wrong? If I mark a region (click on the beginning, hold shift, move to the end), and then run flyspell-region, the region gets spell-checked, and all the dictionary misses are underlined in red, as expected. But then, if I fix the words, the spelling marking (the red underlining) is not removed. It looks like Flyspell is not 'live' anymore within that region. The "overlay" is left behind as static font faces. Do you have flyspell-mode turned on in that buffer? It sounds like you don't. Turn it on, and the highlight will disappear when you correct the misspelled words. > >> Well, I can manually recheck, however inconvenient. But the biggest > >> surprise is trying to remove the spelling marks at the end. > > > If the word is still a misspelling, why should the mark be removed? > > Often I get too many dictionary misses (too much red underlining). Or I just do not want to be distracted anymore. That is the reason why I want to be able to turn spell-checking on and off on demand on a particular region. And, when I want it off, I want to remove the "overlays" from that region. Why should they remain? At the moment, there is no direct way to do that. Just invoke flyspell-mode once again, it will turn itself off, and remove all the highlights. > > They are strings, aren't they? How should Flyspell know that some > > > string is a file name? > > I would not have expected the filenames inside #include statements to be considered literal strings to be spell-checked. That does not make any sense. Flyspell just reuses the syntax analysis of the major mode, that's all. I could understand a feature request to make this much smarter, but such a feature was never designed nor implemented. > Anyway, like I said, I do not want to check literal strings. Just comments. Emacs does know the difference. After all, the link I posted described how to turn off spell checking based on fonts/faces. And Emacs does show different colours depending on the C syntax, so it must know what is a literal string, what is an include filename, etc. Like I said, please submit a feature request about that. > >> To top it all, there is one little surprise in store: disabling > >> flyspell-persistent-highlight renders flyspell-region useless. > > > Disabling flyspell-persistent-highlight turns off highlight > > once point moves off the misspelled word. I've now added > > that to the doc string. > > That is an improvement, but it is not enough. What I mean is that, if you turn flyspell-persistent-highlight off, then flyspell-region does nothing other than consume CPU cycles. The red underlining for dictionary misses does not show up at all. That's inaccurate. If you watch closely enough, you will see each misspelled word highlighted when cursor moves across it, then the highlight turned off when the cursor moves off that word. So yes, this feature (which I find weird to begin with, and would never use in my workflows) is incompatible with flyspell-region.