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

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

Re: ispell and flyspell


From: wael-zwaiter
Subject: Re: ispell and flyspell
Date: Sat, 2 Jan 2021 16:35:35 +0100

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 via email to

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