如何将特定输入法设置为emacs特定的主模式?

如何将特定输入法设置为emacs特定的主模式?

问题描述:

我使用几种语言,我需要设置特定的输入法到Emacs中的特定主模式如何将特定输入法设置为emacs特定的主模式?

我的意思是,配置为“自动改变”特定主模式的输入方法。

有没有办法做到这一点?谢谢!

可以在问题使用方式挂接为每种模式要么设置default-input-method(与C- \切换),在该模式下的缓冲区:

(add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook) 
(defun my-emacs-lisp-mode-hook() 
    "Custom behaviours for `emacs-lisp-mode'." 
    (setq-local default-input-method "latin-1-prefix")) 

或继续前进,激活自动输入法:

(add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook) 
(defun my-emacs-lisp-mode-hook() 
    "Custom behaviours for `emacs-lisp-mode'." 
    (activate-input-method "latin-1-prefix")) 

参见How to set a specific input method to a file

+0

谢谢你的回答! –