[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: changing cursor color depending on input method
From: |
Kevin Rodgers |
Subject: |
Re: changing cursor color depending on input method |
Date: |
Thu, 19 Feb 2004 10:07:26 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
Alexander Verbovetsky wrote:
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
Well, you explicitly check whether the selected window is a minibuffer window.
What happens if you leave that test out?
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.
--
Kevin Rodgers