簡體   English   中英

在Emacs flyspell-mode中,如何在字典中添加新單詞?

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

在flyspell模式的Aquamacs中,當flyspell將單詞標記為拼寫錯誤時,我可以右鍵單擊將該單詞添加到我的字典中,如果它實際上是拼寫正確的。

在OSX上的GNU Emacs中,當flyspell-mode突出顯示它認為拼寫錯誤的單詞時,如何將單詞添加到字典中? 查看文檔,我沒有看到像flyspell-learn-wordispell-add-word-to-personal-dictionary這樣的函數。

您正在尋找的功能是flyspell-correct-word-before-point 默認情況下,它綁定到鍵Cc $ 將您的觀點移至錯誤的單詞並執行命令。 您將獲得一個帶有可能更正的彈出菜單,以及一個將單詞保存到詞典的選項。

如果您想要一個命令來保存當前單詞,這就是我能夠從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))))

您可以使用M-$打開建議,然后i保存到字典。 系統會提示您進行確認。

資源

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM