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: Thu, 12 Jul 2018 19:26:17 +0300 Message-ID: <83va9ke7yu.fsf@gnu.org> References: <974173872.5393015.1531407541695.ref@mail.yahoo.com> <974173872.5393015.1531407541695@mail.yahoo.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1531412692 13139 195.159.176.226 (12 Jul 2018 16:24:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Jul 2018 16:24:52 +0000 (UTC) Cc: "R. Diez" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 12 18:24:47 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 1fdeOd-0003KC-F0 for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Jul 2018 18:24:47 +0200 Original-Received: from localhost ([::1]:32950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdeQk-0001jK-8r for geh-help-gnu-emacs@m.gmane.org; Thu, 12 Jul 2018 12:26:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdeQC-0001jA-Sx for help-gnu-emacs@gnu.org; Thu, 12 Jul 2018 12:26:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdeQB-0001I2-Mh for help-gnu-emacs@gnu.org; Thu, 12 Jul 2018 12:26:24 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdeQ6-0001E2-0q; Thu, 12 Jul 2018 12:26:18 -0400 Original-Received: from [176.228.60.248] (port=2079 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fdeQ5-0006Lo-Fy; Thu, 12 Jul 2018 12:26:17 -0400 In-reply-to: <974173872.5393015.1531407541695@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:117412 Archived-At: > Date: Thu, 12 Jul 2018 14:59:01 +0000 (UTC) > From: "R. Diez" > > I have been trying to use Flyspell, and I found it difficult to configure. I hear you, but FWIW I find Flyspell very easy to use. > You have to search the Internet in order to find good tips. After some time, I found this page, which summarises Flyspell's shortcomings: > > http://ergoemacs.org/emacs/emacs_spell_checker_problems.html It is outdated and partially incorrect (e.g., right mouse click does work on Flyspell). > If the documentation were honest, it would mention those shortcomings itself, maybe as part of a CAVEATS section. Otherwise, you are lead to believe that Flyspell is fine and dandy, which clearly is not the case. After all, we are all used to 'proper' spell checkers all around us (for example, in LibreOffice). I added a few sentences to the Emacs manual to that effect. > I am using Emacs 26.1. The source code comments are outdated. For example: > > > ;; Some user variables control the behavior of flyspell. They are > ;; those defined under the `User variables' comment. > > However, I found no "user variables" comment anywhere on that file. > > Furthermore, this comment does not mention anything about literal strings being checked too (more on that further below): I fixed both of those. However, I must say that M-x customize-group RET flyspell RET would have brought you faster to the stuff you need than reading the comments. My suggestion is to use the built-in documentation (the doc strings, the manual, and the customizable options) first, and only if they don't provide enough info, to read the code. > The first big gotcha was trying to set up automatic language detection, which should arguably be part of Flyspell. This is a general issue in Emacs: we don't yet have any notion of language of the text. In a plain-text editor such as Emacs that is capable of mixing any number of different languages and scripts in the same buffer, this is not an easy job. For now, you must change dictionaries whenever you need to spell-check text in a different language, unless you are using Hunspell, which can load more than one dictionary at the same time. > I have a big text file with all my assorted notes (I haven't learnt Org Mode yet). I cannot spell-check all of it, that would turn up too many spurious errors. I usually find the Ispell facilities to accept "misspelled" words either temporarily or permanently, quite adequate. Type SPC or 'a' to do any of those, when spell-checking a region or the whole buffer. (Flyspell is not the right feature for this job; use ispell-region instead. Flyspell is mainly meant to check what you type on the fly.) > 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. > 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? > I nevertheless tried to push forwards with Flyspell, because alternatives like Wcheck Mode or Speck did not seem quite ready yet. Next step was flyspell-prog-mode . And here I found the next big drawback: it checks literal strings too, even the filenames inside C's #include preprocessor directives, littering too much source code with error marks. They are strings, aren't they? How should Flyspell know that some string is a file name? > Trying to limit spell checking to just source-code comments is hard. I found this page that explains how to do it: > > http://blog.binchen.org/posts/effective-spell-check-in-emacs.html > > But I haven't quite understood it yet (I am no Lisp expert). How about adding a simple customizable variable to turn literal string checking on and off? I suggest to submit a feature request for that, using report-emacs-bug. > 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. > The whole experience reminds me of the expression "death by a thousand paper cuts". Sorry to hear that.