I'd like to use the cursor color to provide visual feedback on the alphabet I am currently in (I sometimes have to switch rapidly between, say, Latin and Cyrillic, and find myself typing in the wrong script).

Something like this:


But I can't find a good way to detect the keyboard layout (Unicode code page, ...) to tell which language I am in, in order to use that to change the parameters of the cursor.

I am on MacOS, but it would be preferable to have a general solution.

  • 2
    See this Emacs Wiki page and library cursor-chg.el for how to change the cursor depending on the context, including depending on the current input method. But that won't tell you how to detect a given keyboard layout. I doubt there is a way to tell that easily from Emacs, but I could be wrong. Google for emacs keyboard layout? – Drew Dec 6 '17 at 16:18

Your Answer

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

Browse other questions tagged or ask your own question.