Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in Emacs flyspell-mode, how to add new word to dictionary?

People also ask

How do I use Flyspell Emacs?

Once Ispell is installed, restart Emacs and you should be good to go. Working with Flyspell is easy as well. Just type away and Flyspell will check your spelling on the fly. Incorrectly spelled words will get a nice little red squiggly line underneath them.

How do you use Flyspell?

Flyspell mode is a minor mode that performs automatic spell-checking of the text you type as you type it. When it finds a word that it does not recognize, it highlights that word. Type M-x flyspell-mode to toggle Flyspell mode in the current buffer.


The function you are looking for is flyspell-correct-word-before-point. By default it is bound to the keys C-c$. Move your point to the incorrect word and execute the command. You will get a popup-menu with possible corrections and an option to save the word to you dictionary.

If you want a single command to save the current word, this is what I was able to extract from flyspell.el

(defun my-save-word ()
  (interactive)
  (let ((current-location (point))
         (word (flyspell-get-word)))
    (when (consp word)    
      (flyspell-do-correct 'save nil (car word) current-location (cadr word) (caddr word) current-location))))

You can probably use M-$ to open suggestions, then i to save to dictionary. You'd be prompted for confirmation.

Source