all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: questions about blink-cursor-mode
Date: Wed, 18 Nov 2009 10:59:13 -0800	[thread overview]
Message-ID: <59E57B2EDA3D465DA20C720A327090CC@us.oracle.com> (raw)

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	other threads:[~2009-11-18 18:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AcpogTg4wgSCDluLRNWONZ0+zkdmZQ==>
2009-11-18 18:59 ` Drew Adams [this message]
2009-11-18 23:31   ` questions about blink-cursor-mode Juanma Barranquero
2009-11-18 23:39     ` Drew Adams
2009-11-19  1:06       ` Stefan Monnier
2009-11-19  1:30         ` Lennart Borgman
2009-11-19 17:17         ` Drew Adams

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

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

  git send-email \
    --in-reply-to=59E57B2EDA3D465DA20C720A327090CC@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.