1

I use few languages and I need to set up specific input method to specific major-mode in Emacs.

I mean, configuration to "auto change" input method for specific major-mode.

Is there some way to do this? Thank you!

1 Answer 1

1

You can use the MODE-hook for each MODE in question to either set the default-input-method (toggled with C-\) for buffers in that mode:

(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"))

or to go ahead and activate the input method automatically:

(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"))

See also How to set a specific input method to a file.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.