From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alexander Verbovetsky Newsgroups: gmane.emacs.help Subject: changing cursor color depending on input method Date: Sun, 15 Feb 2004 14:58:40 +0300 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1076846609 5630 80.91.224.253 (15 Feb 2004 12:03:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Feb 2004 12:03:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 15 13:03:19 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AsKzX-0000sw-00 for ; Sun, 15 Feb 2004 13:03:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AsKyg-0002Ee-MH for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Feb 2004 07:02:26 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!news2.telebyte.nl!fu-berlin.de!uni-berlin.de!ppp224.dialup.comptek.RU!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-NNTP-Posting-Host: ppp224.dialup.comptek.ru (213.180.195.224) Original-X-Trace: news.uni-berlin.de 1076846321 43802717 I 213.180.195.224 ([209459]) Original-Xref: shelby.stanford.edu gnu.emacs.help:120924 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:16873 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16873 Hello, 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. Alex