使用ispell时如何更改Emacs中的语言?

Bru*_*ert 45 emacs ispell

我想在Emacs中使用ispell-buffer命令.它默认使用英语.是否有一种简单的方法可以切换到另一个字典(例如,另一种语言)?

ste*_*nea 43

以下命令建议使用的已安装字典列表:

M-x ispell-change-dictionary
Run Code Online (Sandbox Code Playgroud)

通常,也M-x isp-c-d扩展到上面.


Pie*_*rre 25

从ispell.el文件中,您可以为ispell命令指定一些选项.这通过在文件末尾添加一个部分来实现,如下所示:

;; Local Variables:
;; ispell-check-comments: exclusive
;; ispell-local-dictionary: "american"
;; End:
Run Code Online (Sandbox Code Playgroud)

请注意,双分号标记当前模式中注释的开头.它应该被改变以反映您的文件(编程语言)引入注释的方式,例如//Java.


boc*_*doa 15

在LaTeX文件的末尾,您可以使用:

%%% Local Variables:
%%% ispell-local-dictionary: "british"
%%% End:
Run Code Online (Sandbox Code Playgroud)

这将设置仅用于该文件的字典.


小智 11

使用M-x ispell-change-dictionary和点击TAB查看可用的字典.

然后在你的密码中写下默认字典的设置.emacs,并为你的特定模式添加一个自动启动ispell的钩子(如果你想要的话).

例如,使用英式英语自动启动AUCTeX中的ispell(默认情况下,英语词典是美式英语)

(add-hook 'LaTeX-mode-hook 'flyspell-mode) ;start flyspell-mode
(setq ispell-dictionary "british")    ;set the default dictionary
(add-hook 'LaTeX-mode-hook 'ispell)   ;start ispell
Run Code Online (Sandbox Code Playgroud)