emacs-devel
[Top][All Lists]
Advanced

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

questions about blink-cursor-mode


From: Drew Adams
Subject: questions about blink-cursor-mode
Date: Wed, 18 Nov 2009 10:59:13 -0800

I need to turn on blink-cursor-mode for a particular major mode.

blink-cursor-mode is a global minor mode. I don't know how to turn it on only
locally. (Is that possible? how?)

So, as a workaround, I save the value of the mode variable `blink-major-mode'
when my major mode is entered, and then restore blinking or not-blinking (by
calling function `blink-major-mode' to reflect the saved value) when the major
mode is exited. In this way, at least whatever behavior the user had before s?he
will get again after the major mode is exited.

But I don't know how to update the saved value that I record, which should
reflect the user's preference, if the user calls blink-cursor-mode (or
customizes the mode var) to change it.

blink-cursor-mode is defined using `define-minor-mode', and the doc for that
says that "It finishes by running the mode hook variable `MODE-hook'." But there
doesn't seem to be any variable `blink-cursor-mode-hook'. How can that be? Why
is that? If there were such a hook, I could presumably use it to update my
variable that reflects the user's preference.

What's the right way (a good way) to do what I need? I don't want to trample the
user's preference for blinking or not blinking, but the major mode in question
really needs a blinking cursor.

And if, as I understand it, there is no way to make the blinking be local to my
major mode, then it could be acceptable to at least make it blink only for the
duration, i.e. until the major mode is exited. That's what I'm doing now, but I
don't know how to pick up any user preference changes - once I've saved the
value of blink-cursor-mode upon entry to my major mode, that saved value stays
the same.





reply via email to

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