unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: wael-zwaiter@gmx.com
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: ispell and flyspell
Date: Sat, 2 Jan 2021 16:35:35 +0100	[thread overview]
Message-ID: <trinity-48f4e2bc-69ac-49dd-afd1-8087c1093cce-1609601735612@3c-app-mailcom-bs01> (raw)
In-Reply-To: <83pn2ne7nu.fsf@gnu.org>

Have written the following function, but (ispell-region) is failing.
How can I make option 2 call (ispell-region) on the current paragraph.

Basically, option 1 will check the current word, option 2 will check the current
paragraph, and option 3 will check the whole buffer.

(defvar spelt-state nil)
(defun spelt ()
  "Corrects the spelling of text."
  (interactive)

  (pcase spelt-state
    (1 (flyspell-mode 0)
       (ispell-word)
       (message "%s" "Spell: Word")
       (setq spelt-state 2))

    (2 (ispell-region)
       (message "%s" "Spell: Region")
       (setq spelt-state 3))

    (3 (ispell-buffer)
       (message "%s" "Spell: Buffer")
       (setq spelt-state 0))

    (_ (flyspell-mode)
       (setq spelt-state 1))) )

(global-unset-key (kbd "M-v"))
(global-set-key (kbd "M-v") 'spelt)



> Sent: Saturday, January 02, 2021 at 7:57 PM
> From: "Eli Zaretskii" <eliz@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: ispell and flyspell
>
> > From: wael-zwaiter@gmx.com
> > Date: Sat, 2 Jan 2021 13:26:34 +0100
> >
> > Writing prose in texinfo, I wonder how best to use ispell and flyspell.  Should I
> > use both modes together or should I concentrate primarily on one rather than the
> > other?
>
> I'd suggest to turn on flyspell-mode, it will highlight the spelling
> mistakes as you type.
>
>



  reply	other threads:[~2021-01-02 15:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02 12:26 ispell and flyspell wael-zwaiter
2021-01-02 14:27 ` Eli Zaretskii
2021-01-02 15:35   ` wael-zwaiter [this message]
2021-01-02 16:23     ` Eli Zaretskii
2021-01-02 16:34       ` wael-zwaiter
2021-01-02 16:44         ` Eli Zaretskii
2021-01-02 16:57           ` wael-zwaiter
2021-01-02 17:11             ` Eli Zaretskii
2021-01-02 17:21               ` wael-zwaiter
2021-01-02 17:47                 ` Eli Zaretskii
2021-01-02 17:52                   ` wael-zwaiter
2021-01-02 17:53                     ` Eli Zaretskii
2021-01-02 17:57                       ` wael-zwaiter

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=trinity-48f4e2bc-69ac-49dd-afd1-8087c1093cce-1609601735612@3c-app-mailcom-bs01 \
    --to=wael-zwaiter@gmx.com \
    --cc=eliz@gnu.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).