The inbuilt flyspell-auto-correct-previous-word works like a charm for me. I have bound it to F12 and I haven't looked back. It has consistently correctly words for me not matter how many words back the incorrect word was.
From the function documentation:
flyspell-auto-correct-previous-word is an interactive compiled Lisp
function in `flyspell.el'.
After a bit of digging, I found a hint in [this Superuser.com answer: you need to set flyspell-mode-predicate to a function that will decide whether words should be checked or not. Here's a way to get Flyspell to ignore anything starting with "http" or "https":
(defun flyspell-ignore-http-and-https ()
"Function used for `flyspell-generic-check-word-...
Yes, hunspell is THE spell-checker to use with emacs 26.1, as there's no windows binary of aspell 0.6 for the time being, and no one can foretell when there will be one. I tried hunspell this morning with emacs 26.1 on Windows 10 and it ran perfectly well.
You will find some very useful tips on how to configure your .emacs file for hunspell here. Have a ...
Sounds like you are being bitten by the fact that one command is bound to mouse-2, another command is bound to down-mouse-2, and the two commands do not play well together.
Do C-h k and then click mouse-2 on text (e.g. mistaake). The help should tell you what mouse-2 and down-mouse-2 are bound to.
If I'm right in my guess, you can try doing one of these ...
You can install aspell or hunspell with https://www.msys2.org/. MSYS2 has native binaries for aspell available which are compatible with Emacs 26.1. Note you can also install emacs using MSYS2 as well.
After installing, MSYS2 MinGW 64-bit should be in your start menu. Launch that, which brings up a terminal, and search for packages using pacman -Ss aspell.
The accepted answer for org-mode is written by me. org-mode is tricky because its own check-word-predicate is already defined.
markdown is simpler because it uses default predicate provided by flyspell-mode,
(defun flyspell-generic-textmode-verify ()
"Used for `flyspell-generic-check-word-predicate' in text modes."
;; (point) is next char after the ...
I'm pretty sure other people will come up with different solutions that will
be useful for future readers. However, here is how I currently handle this.
I think flyspell-correct-word-before-point is a good place to start,
because it at least can be invoked with key pressing and it displays menu of
possible corrections. To fix the menu I've written package
Let me refer you to my post on this.
I've found that abbrevs are the best way to do correction on SPC,
you only need to define the corrections that you want. For that, I
take the following approach:
Add the code below to your init file.
Whever you type something wrong, hit C-x C-i and choose one of the corrections offered.
That's it! The correction will be ...
There are already some different ways to show ispell correction candidates, I guess you just meant correcting misspelled word in a popup menu, not company-mode itself.
To correct misspelled word at point, both built-in M-$ (ispell-word) and C-c $ (flyspell-correct-word-before-point) works great, the former uses a buffer to show correction choices, while the ...
With helm-flyspell you can choose from the list of corrections efficiently. I use the following code to jump to the errors and correct them with it, it saves the position of the point to the mark-ring so you can jump back to the position where you started or corrected words previously:
(defun flyspell-goto-previous-error (arg)
"Go to arg previous spelling ...
Here's a quick trip down the flyspell source code rabbit hole. (Try C-h l flyspell to get to it.)
flyspell-prog-mode uses flyspell-generic-progmode-verify.
That function uses text properities to decide whether or not to fire
based on whether or not the text property of the previous character
is a member of flyspell-prog-text-faces.
Now, the flyspell-prog-...
The patches (referred to below) were created by @lawlist from select portions of the Aquamacs:
To enable native spellchecking on OSX in the vanilla/generic version of Emacs, it is necessary to patch the C-source-code prior building, and a few lisp files also need to be modified. The patch is too big to post in ...
I use enchant in wcheck-mode, which lists "the" as the first suggested correction (though with wcheck you don't have to scroll through corrections to select the one you want, you just type the number or letter of the correction you want).
For example, if I type the following:
To be or not to be, that is hte question.
and then M-x wcheck-actions with point ...
As mentioned before, you can try aspell. I've also tried hunspell, but I had the same problems as you. I found this answer.
(if (file-exists-p "/usr/bin/aspell")
(setq ispell-program-name "aspell")
'(progn (defun ispell-get-coding-system () 'utf-8)))))
Ispell and flyspell are two packages. Setup of ispell has no effect on flyspell. (flyspell does use very limited ispell APIs but it should be invisible to users).
In your case, "iostream" is checked because its font face is font-lock-string-face. By default, flyspell-prog-mode is used for any major-mode inherits from prog-mode (for example, c++-mode ...
You can temporarily disable message with the following advice for ispell-init-process.
That is a general approach which also works for other functions emitting unwanted messages.
(defun message-off-advice (oldfun &rest args)
"Quiet down messages in adviced OLDFUN."
(let ((message-off (make-symbol "message-off")))
Here's a simple attempt:
(defun my-flyspell-correct-on-space ()
(local-set-key " " 'my-flyspell-correct-on-space)
It behaves strangely when you insert more than one space in a row, and sometimes it splits off part of the word being corrected. Thus this post ...
The error appears if you have an empty file or no file in place.
You need at least a header line in your dictionary file.
following the format
personal_ws-1.1 lang num [encoding]
personal_ws-1.1 en 0
as described in aspell documentation
Thanks to chen bin, I have added a flyspell-generic-check-word-predicate function to Markdown mode. If you're using the latest development version, or use the next release version, then you won't have to use local modifications to achieve this.
For those curious, perhaps to implement a predicate for another mode, the current function is below. It checks ...
It suffices to properly choose and trickily chain hooks.
(add-hook 'text-mode-hook #'flyspell-mode)
(add-hook 'flyspell-mode-hook #'flyspell-local-vars)
(defun flyspell-local-vars ()
(add-hook 'hack-local-variables-hook #'flyspell-buffer))
text-mode-hook: executed by text major-modes hooks like those of all TeX variants, e.g. latex-mode-hook.
I compiled Emacs today (March 14, 2016) from git, version 126.96.36.199 for Windows 8.1, 64-bit. Run into the same issue. Found this answer by the indefatigable Eli Zaretskii and shortened the code for hunspell to this lines in my .emacs:
(add-to-list 'exec-path "C:/cygwin64/usr/local/bin")
(setq ispell-program-name (executable-find "hunspell"))
Insert below code into ~/.emacs or ~/.emacs.d/init,
(setq ispell-program-name "hunspell")
(setq ispell-local-dictionary "de_DE")
'(("de_DE" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)))
AFTER above setup, you need turn on flyspell-mode by (flyspell-mode 1).
Please make sure your dictionary is loaded ...
Flyspell is unfortunately slow and that is just life when using Emacs. The minor-mode does, however, have a few built-in optimizations that are customizable.
The variables flyspell-default-deplacement-commands and flyspell-deplacement-commands are used to prevent flyspell from checking a word. Essentially, if this-command (the current command) is the same ...