From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: questions about blink-cursor-mode Date: Wed, 18 Nov 2009 10:59:13 -0800 Message-ID: <59E57B2EDA3D465DA20C720A327090CC@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1258570778 442 80.91.229.12 (18 Nov 2009 18:59:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Nov 2009 18:59:38 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 18 19:59:31 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NApkZ-00026s-55 for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2009 19:59:31 +0100 Original-Received: from localhost ([127.0.0.1]:60592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NApkY-0006L5-MA for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2009 13:59:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NApkT-0006Km-To for emacs-devel@gnu.org; Wed, 18 Nov 2009 13:59:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NApkO-0006Jo-Cm for emacs-devel@gnu.org; Wed, 18 Nov 2009 13:59:24 -0500 Original-Received: from [199.232.76.173] (port=39986 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NApkO-0006Jl-82 for emacs-devel@gnu.org; Wed, 18 Nov 2009 13:59:20 -0500 Original-Received: from acsinet12.oracle.com ([141.146.126.234]:45948) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NApkN-0005TN-LY for emacs-devel@gnu.org; Wed, 18 Nov 2009 13:59:19 -0500 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nAIIwsgp014310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Nov 2009 18:58:55 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id nAI9SLnn027119 for ; Wed, 18 Nov 2009 18:59:18 GMT Original-Received: from abhmt002.oracle.com by acsmt355.oracle.com with ESMTP id 440994431258570753; Wed, 18 Nov 2009 10:59:13 -0800 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 18 Nov 2009 10:59:12 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcpogTg4wgSCDluLRNWONZ0+zkdmZQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt356.oracle.com [141.146.40.156] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090205.4B044402.0092:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:117200 Archived-At: 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.