大きなプロジェクト/リポジトリ内の複数のファイルでスペル チェックを行い、自分のものとは異なるプライベート ディクショナリを使用したいと考えています。代わりにプロジェクト辞書を使用し、後でこれをアップロードして他のユーザーが使用できるようにします。
2818 次
3 に答える
5
クリスの答えは正しいです。aspell
これは、私が個人辞書とaspell
言語を切り替えるために使用するもののほんの一例です。と の両方を使用flyspell
しispell
ます。個人辞書へのパスは、ユーザーの仕様に従って調整する必要があります。
(defface ispell-alpha-num-choice-face
'((t (:background "black" :foreground "red")))
"Face for `ispell-alpha-num-choice-face`."
:group 'ispell)
(defface ispell-text-choice-face
'((t (:background "black" :foreground "forestgreen")))
"Face for `ispell-text-choice-face`."
:group 'ispell)
(defun my-ispell-change-dictionaries ()
"Switch between language dictionaries."
(interactive)
(let ((choice (read-char-exclusive (concat
"["
(propertize "E" 'face 'ispell-alpha-num-choice-face)
"]"
(propertize "nglish" 'face 'ispell-text-choice-face)
" | ["
(propertize "S" 'face 'ispell-alpha-num-choice-face)
"]"
(propertize "panish" 'face 'ispell-text-choice-face)))))
(cond
((eq choice ?E)
(setq flyspell-default-dictionary "english")
(setq ispell-dictionary "english")
(setq ispell-personal-dictionary "/Users/HOME/.0.data/.0.emacs/.aspell.en.pws")
(ispell-kill-ispell)
(message "English"))
((eq choice ?S)
(setq flyspell-default-dictionary "spanish")
(setq ispell-dictionary "spanish")
(setq ispell-personal-dictionary "/Users/HOME/.0.data/.0.emacs/.aspell.es.pws")
(ispell-kill-ispell)
(message "Español"))
(t (message "No changes have been made."))) ))
于 2014-12-18T17:02:52.057 に答える
4
Emacs から、変数ispell-personal-dictionary
を使用して個人辞書ファイルを選択できます。
個人用スペリング辞書のファイル名、または nil。nil の場合、デフォルトの個人用辞書 (ispell の場合は "~/.ispell_DICTNAME" または aspell の場合は "~/.aspell.LANG.pws") が使用されます。ここで、DICTNAME はデフォルトの辞書の名前で、LANG は 2 文字の言語コードです。 .
最近のシステムでは、Emacs のispell-
関数は一般にGNUaspell
を使用します。
最終的に Ispell を置き換えるように設計された、無料でオープン ソースのスペル チェッカー
あなたの質問からは、誰もが Emacs を使ってスペルチェックを行うかどうかは明らかではありません。幸いなことに、aspell
同様に機能するコマンドライン オプションがサポートされています。
--personal=<file>, -p <file>
Personal word list file name.
于 2014-12-18T16:39:26.937 に答える