如何为特定目录下的所有文件设置 ispell 字典
如何(自动)将特定目录下的每个文件的字典(例如通过自动调用ispell-change-dictionary
)设置为特定语言?
示例:我希望我的标准目录语言为美式英语(例如,通过在我的 .emacs
文件中设置 (setq ispell-dictionary "en_US-wo_accents")
),但是我想对目录 /home/werner/dissertation/
下(或:下)的所有文件使用英式英语。也许对于 /home/werner/letters/
下的所有文件都使用荷兰语。
我知道解决方案规定在文件的第一行使用 -*- ispell-dictionary: "english" -*-
来设置该特定文件的字典(描述于 EmacsWiki.org)。我想避免必须将此行放在我创建的每个新文件的顶部。
How do I (automatically) set the dictionary (e.g. through an automated call to ispell-change-dictionary
) to a specific language for every file below a particular directory?
Example: I'd prefer my standard directory language to be American English (e.g. by setting (setq ispell-dictionary "en_US-wo_accents")
in my .emacs
file) but I'd like to use British English for all files below (or: under) the directory /home/werner/dissertation/
. And perhaps to Dutch for all files under /home/werner/letters/
.
I am aware of the solution that prescribes to use -*- ispell-dictionary: "english" -*-
at the first line of a file to set the dictionary for that particular file (described at EmacsWiki.org). I'd like to prevent to have to put this line on top of every new file that I make.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用类似的东西(但是当您想要为给定文件制作复杂的东西时,这种方法更有用):
或者您可以在
.dir-locals.el
中指定它,如 Emacs 手册 - 我认为,这比第一种方法更简单,类似:对于具有特定模式的文件,或
对于所有文件
You can use something like (but this approach is more useful when you want to make something complex for given files):
or you can specify it in
.dir-locals.el
as described in Emacs Manual - I think, that this will simpler than first approach, something like:for files with specific modes, or
for all files