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: RE: change cursor type when idle Date: Mon, 28 Aug 2006 08:00:00 -0700 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1156777250 9301 80.91.229.2 (28 Aug 2006 15:00:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Aug 2006 15:00:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 28 17:00:46 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GHibB-0007JQ-Tr for ged-emacs-devel@m.gmane.org; Mon, 28 Aug 2006 17:00:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GHibB-00035I-G7 for ged-emacs-devel@m.gmane.org; Mon, 28 Aug 2006 11:00:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GHiaz-00032B-GW for emacs-devel@gnu.org; Mon, 28 Aug 2006 11:00:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GHiax-0002yr-Bg for emacs-devel@gnu.org; Mon, 28 Aug 2006 11:00:12 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GHiax-0002yo-7R for emacs-devel@gnu.org; Mon, 28 Aug 2006 11:00:11 -0400 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1GHijv-0000vi-AI for emacs-devel@gnu.org; Mon, 28 Aug 2006 11:09:27 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k7SF09SN016474 for ; Mon, 28 Aug 2006 09:00:09 -0600 Original-Received: from dradamslap (dhcp-amer-whq-csvpn-gw3-141-144-81-166.vpn.oracle.com [141.144.81.166]) by rgmgw2.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k7SF07DZ001293 for ; Mon, 28 Aug 2006 09:00:08 -0600 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE 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:58997 Archived-At: > Another possible (minor) feature to consider for after the > release: As an option, let users switch cursor type > automatically when Emacs is idle. > > I've been using this for a while, and I like it. I like a bar > cursor for editing, but the bar cursor is hard to locate, > when I'm not already looking at it or near it. So, I use an > idle timer to change it to a (blinking) box cursor while > Emacs is idle. I find this helps quite a bit - without it, > it's hard to use a bar cursor, IMO. > > Users can choose not to use this, and they can toggle it on > and off. They can also change the number of seconds to wait > before the automatic cursor-type change (2 sec, by default). Brilliant idea! Here's one way to do it. If people don't like a blinking cursor normally, they just have to define blink-cursor-delay to the same value as blink-cursor-idle-cursor-delay. In my own implementation, this feature is separate from whether or not the cursor should blink, which I think is a little better. I just use a timer that, if the current cursor type is not `box', saves that type as the `last-cursor-type', changes the type to `box', and reads an event. When an event arrives, the same function pushes it to `unread-command-events' and, if there is a `last-cursor-type', restores that as the current cursor type. As I mentioned, it's good to also have 1) a toggle for this and 2) make the whole thing an option.