You can add the following to the end of the file:
Local Variables:
eval: (set-input-method 'devanagari-itrans)
End:
(Pretty self-explanatory: (set-input-method 'devanagari-itrans)
will be evaluated when you open the file.)
These lines can, if necessary, be "commented out". For instance, if the file were a python file (with #
as the comment marker), the following would also work:
# Local Variables:
# eval: (set-input-method 'devanagari-itrans)
# End:
Note about safety
Since eval
ing arbitrary lisp forms (as the eval: ARBITRARY_LISP_FORM
construction allows you to do), opens up a huge, potential security hole, emacs
will ask you whether you want to apply the value(s) in the local variables list. You can agree to apply them this one time, not apply them, or set them as safe (to prevent emacs
from asking you about these specific values in the future). The dialogue emacs
provides is pretty helpful.