unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: count all ispell(flyspell) errors in a buffer
Date: Mon, 27 Nov 2023 00:53:59 +0100	[thread overview]
Message-ID: <878r6kdqaw.fsf@dataswamp.org> (raw)
In-Reply-To: 87a5r2gclr.fsf@mat.ucm.es

Uwe Brauer wrote:

> I usually use flyspell on most of my buffers, but sometimes
> are interested to run ispell-region.
>
> Is there any way to find out how many errors ispell finds
> when the program starts

You can use this

(condition-case nil
    (not (ispell-word))
  (error nil) )

It returns t if the word is correct, otherwise nil.

Put in a loop that iterates all the words in the region with
`forward-word'.

For every word that is nil, do `cl-incf' on some error
variable that is initiated to 0.

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2023-11-26 23:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-25 13:57 count all ispell(flyspell) errors in a buffer Uwe Brauer
2023-11-26 23:53 ` Emanuel Berg [this message]
2023-11-27  0:36 ` Emanuel Berg
2023-11-27  0:53 ` Emanuel Berg

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=878r6kdqaw.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@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.
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).