0

I have the following local variables defined in a XeTeX file. As you can see, the input method is currently set to Devanagari. This is inconvenient when I want to type Roman letters. I'd like a way to disable that particular setting so I can then type Roman letters, and then re-enable it. I realise I can change the setting in Emacs, but it would be convenient if I could do so by commenting and uncommenting the file.

%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% eval: (set-input-method 'devanagari-itrans)
%%% TeX-engine: xetex
%%% TeX-master: t
%%% End:

The question How comment out a variable line in a local variable list is related, but doesn't have an answer.

EDIT: I see that the question has been closed as a dupe of this question. I think the the two options provided in the question as at best workarounds. The first one doesn't even attempt to answer the question. The answer even says:

I'm reasonably sure that you can't.

I was hoping there were some other options, at least for my use case - which isn't exactly the same as the other question.

  • The duplicate question does have an answer, which provides two alternatives. – phils Nov 18 at 20:28
  • 1
    Possible duplicate of How comment out a variable line in a local variable list – phils Nov 18 at 20:28
  • "...doesn't even attempt to answer the question. The answer even says: I'm reasonably sure that you can't." -- which is an entirely valid answer to a question asking how to do something which can't be done. I'm honestly not sure what more you're expecting from an answer to such a question. (I mean, I realise you're hoping that the answer is wrong and that it can be done; but I don't understand how you're coming away with "doesn't even attempt to answer the question" as an impression.) – phils Nov 19 at 4:34
  • @phils Ok, fine. I'm hoping that the answer is wrong about it being impossible, or there is another approach to the question I'm asking - which isn't exactly the same as that question. That question has nothing to do with input method. – Faheem Mitha Nov 19 at 12:07
  • I still think your question generalises to "how can I disable a file-local variable?", which is a duplicate. Which variable you are wanting to disable seems largely inconsequential (Stefan's point notwithstanding). If you take another look at my answer to the earlier question, this did cause me to add some further elaboration to one of the workarounds which you might find useful. – phils Nov 19 at 20:21
2

I don't understand why you want to comment out that line (especially since it won't have any effect until you re-open the file or do something like M-x normal-mode): to toggle the devanagari-itrans input method you can simply use C-\.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.