[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

changing cursor color depending on input method

From: Alexander Verbovetsky
Subject: changing cursor color depending on input method
Date: Sun, 15 Feb 2004 14:58:40 +0300


I'm using Emacs to write mathematical texts in Russian,
so I often change input method with C-\

It is very convinient if the cursor change its color
when the input mode is activated.

Currently I have the following quick and dirty code
in my .emacs:
(add-hook 'input-method-activate-hook
          '(lambda ()
             (if (not (eq (selected-window) (minibuffer-window)))
                 (set-cursor-color "red"))))
(add-hook 'input-method-inactivate-hook
          '(lambda ()
             (if (not (eq (selected-window) (minibuffer-window)))
                 (set-cursor-color "black"))))
This works in 95%, but the color isn't changed when in the minibuffer
and goes wrong after "C-x C-f" (to repear I press C-\ twice).

Does a better way to do this exist?

What would be nice, IMO, is to have red cursor if next letter is
going to be non-latin and black otherwise, in all modes and regimes.

Thanks for the help.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]