unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alexander Verbovetsky <verbovet@mccme.ru>
Subject: changing cursor color depending on input method
Date: Sun, 15 Feb 2004 14:58:40 +0300	[thread overview]
Message-ID: <pan.2004.02.15.11.58.40.335708@mccme.ru> (raw)

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

             reply	other threads:[~2004-02-15 11:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-15 11:58 Alexander Verbovetsky [this message]
2004-02-19 17:07 ` changing cursor color depending on input method Kevin Rodgers
2004-02-19 18:38   ` Alexander Verbovetsky
2004-02-20 17:21     ` Alexander Verbovetsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pan.2004.02.15.11.58.40.335708@mccme.ru \
    --to=verbovet@mccme.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).