From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Blink cursor changes, possible W32 breakage. Date: Wed, 17 Jul 2013 18:29:46 +0200 Message-ID: <534E99D7-CC13-4C8D-A80B-EC00995F741A@swipnet.se> References: <83oba22ymd.fsf@gnu.org> <6B4F86F0-164D-4CBE-8CD2-9BC9326451C4@swipnet.se> <8361w93k8e.fsf@gnu.org> <871u6x4we0.fsf@catnip.gol.com> <58D8CF7D-C157-4D48-93B4-2EFFAA4AAF61@swipnet.se> <8338rd2q1h.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1374078599 10949 80.91.229.3 (17 Jul 2013 16:29:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Jul 2013 16:29:59 +0000 (UTC) Cc: miles@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 17 18:29:58 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UzUc2-0001WJ-9X for ged-emacs-devel@m.gmane.org; Wed, 17 Jul 2013 18:29:58 +0200 Original-Received: from localhost ([::1]:40717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzUc1-0006hl-Ty for ged-emacs-devel@m.gmane.org; Wed, 17 Jul 2013 12:29:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzUbx-0006hY-UC for emacs-devel@gnu.org; Wed, 17 Jul 2013 12:29:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzUbu-0003lk-W3 for emacs-devel@gnu.org; Wed, 17 Jul 2013 12:29:53 -0400 Original-Received: from mailout.melmac.se ([62.20.26.67]:48306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzUbu-0003jF-I8 for emacs-devel@gnu.org; Wed, 17 Jul 2013 12:29:50 -0400 Original-Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id 6798F9A56 for ; Wed, 17 Jul 2013 18:29:46 +0200 (CEST) Original-Received: (qmail 21163 invoked by uid 89); 17 Jul 2013 16:29:46 -0000 Original-Received: from h-46-59-42-57.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.57) by mail01.melmac.se with ESMTPA; 17 Jul 2013 16:29:46 -0000 Original-Received: from [172.20.199.13] (unknown [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id EA7CA1A1B8C; Wed, 17 Jul 2013 16:29:45 +0000 (UTC) In-Reply-To: <8338rd2q1h.fsf@gnu.org> X-Mailer: Apple Mail (2.1508) X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 62.20.26.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161980 Archived-At: Hello. 17 jul 2013 kl. 16:56 skrev Eli Zaretskii : >> From: Jan Dj=E4rv >> Date: Wed, 17 Jul 2013 09:38:32 +0200 >> Cc: Eli Zaretskii , >> emacs-devel@gnu.org >>=20 >>> Eli Zaretskii writes: >>>> If you only stop the timers that blink the cursor, then this isn't >>>> going to fix the problem. There's any number of timers active at >>>> any given time in any non-trivial Emacs session. You need to stop >>>> them all, or the battery drain will continue. >>>=20 >>=20 >> We can't know what other timers do, in general. Maybe they are = supposed to run some Elisp in the background and/or when the frame has = no focus. In contrast, we know very well what blinking timers are = supposed to do, so we have control over those. >=20 > But if you stop one timer, but leave the other N running, what did you > accomplish, exactly, in terms of allowing the laptop stop using > battery power and perhaps swap Emacs out of RAM? In the default configuration, i.e. starting Emacs, editing files and so = on, the only repeating timer there is is the blinking timer, there are = no N other timers. So for the majority of setups, this is a win. >=20 >>> Is it _timers_ that cause battery drain, or _timers firing_? I'd >>> imagine that with a reasonable implementation, it would be the >>> latter... >>=20 >> You are right, it is the latter of course. >=20 > Now I'm completely confused: if blink-cursor timer doesn't drain the > battery, why should we try hard to stop it? Why isn't it enough to > stop blinking when no Emacs frame has focus? The terms used here are not clear. When I say timer I mean when the = timer fires. The blink timer fires every 0.5 seconds, so saying "the = blink timer" and "the blink timer firing" is almost the same thing. It = would be another thing for a timer that only fires every hour or so. Emacs did not previously stop the blink timer from firing when focus was = lost, hence the introduction if the FOCUS_OUT_EVENT. Before, even if = there was no visible blinking going on in any Emacs window, the timer = kept firing every 0.5 seconds, running code to update the cursor state = for the window. This is the main issue, stop executing code for no = reason every 0.5 seconds. The other change, to stop blinking after 10 blinks, is a separate issue, = inspired by other applications, and the comment made by Chong Yidong at = http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00718.html: > On the Gnome terminal, the cursor stops blinking after ten blinks > (edits, X window selection, and cursor motion cause the blinking to > resume). I think this idea is a reasonable one for us copy, and it > would eliminate the power wasting problem. We can have focus out stopping the timer from firing without the = "stopping after 10 blinks". That is what happens if you set blink-cursor-blinks to 0. Jan D.