help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flyspell difficult to configure, documentation not honest


From: Eli Zaretskii
Subject: Re: Flyspell difficult to configure, documentation not honest
Date: Fri, 13 Jul 2018 09:35:56 +0300

> Date: Thu, 12 Jul 2018 21:50:00 +0000 (UTC)
> From: "R. Diez" <rdiezmail-emacs@yahoo.de>
> Cc: "help-gnu-emacs@gnu.org" <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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]