如何为文件设置特定的输入法
问题描述:
我用多种语言编写,我想为不同的文件定义不同的输入法。有没有办法做到?
I write in several languages, and I would like to define a different input method for different files. Is there a way to do this?
(例如,设置一个特定的字典,在文件的末尾,我写以下内容:
(For example, to set a specific dictionary, at the end of a file I write the following:
<!-- Local IspellDict: british -->
我可以对输入法做类似的事情吗?)
Can I do something similar for input methods?)
答
您可以在文件的开头:
-*- eval: (activate-input-method 'latin-4-postfix); -*-
或在文件末尾:
Local Variables:
eval: (activate-input-method 'latin-4-postfix)
End:
在任何一种情况下,如果主模式具有注释语法,则可以/应该注释行。
In either case, you can/should comment the lines if the major mode has a comment syntax.
如果您只想选择在键入 C-\ 时启用的输入法,则代替:
If you just want to select which input method will be enabled if you type C-\ then instead of:
eval: (activate-input-method 'latin-4-postfix)
您将使用:
default-input-method: latin-4-postfix