Domanda

In Aquamacs in flyspell-mode, when flyspell flags a word as misspelled, I can right-click to add the word to my dictionary if it is in fact correctly spelled.

In GNU Emacs on OSX, when flyspell-mode highlights a word it thinks is misspelled, how can I add the word to the dictionary? Looking at the documentation, I do not see a function like flyspell-learn-word or ispell-add-word-to-personal-dictionary.

È stato utile?

Soluzione

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))))

Altri suggerimenti

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

Source

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top