From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-2022-jp?B?GyRCOzNLXBsoQiAbJEI4d0AyGyhC?= Newsgroups: gmane.emacs.devel Subject: Re: Power: blink-cursor-mode is a pig Date: Fri, 30 Dec 2011 21:49:22 +0900 Message-ID: <677E3CA4-7D51-46AA-A499-0ECCDF828847@math.s.chiba-u.ac.jp> References: <4EFCFDCA.6060802@dancol.org> <831urmv30g.fsf@gnu.org> <4EFD826D.2060309@dancol.org> <83pqf6theu.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1325249407 27729 80.91.229.12 (30 Dec 2011 12:50:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2011 12:50:07 +0000 (UTC) Cc: Daniel Colascione , Emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 30 13:49:58 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RgbuH-0001jT-OC for ged-emacs-devel@m.gmane.org; Fri, 30 Dec 2011 13:49:57 +0100 Original-Received: from localhost ([::1]:42245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgbuG-0001nY-Pe for ged-emacs-devel@m.gmane.org; Fri, 30 Dec 2011 07:49:56 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgbuE-0001nT-NS for Emacs-devel@gnu.org; Fri, 30 Dec 2011 07:49:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgbuD-00058y-K2 for Emacs-devel@gnu.org; Fri, 30 Dec 2011 07:49:54 -0500 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:50171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgbuD-00058q-27; Fri, 30 Dec 2011 07:49:53 -0500 Original-Received: from [192.168.1.22] (p5036-ipad01akita.akita.ocn.ne.jp [218.224.25.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTPSA id 5EC4FC055D; Fri, 30 Dec 2011 21:49:49 +0900 (JST) In-Reply-To: <83pqf6theu.fsf@gnu.org> X-Mailer: Apple Mail (2.1251.1) X-detected-operating-system: by eggs.gnu.org: NetBSD 3.0 (DF) X-Received-From: 133.82.132.2 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:147053 Archived-At: On 2011/12/30, at 20:42, Eli Zaretskii wrote: > Timers are not Lisp-level creatures, they are fully implemented in C. > They just call Lisp functions when the value of some variable becomes > non-positive, but that's all they have to do with Lisp. It should be > very easy to avoid calling Lisp under some conditions known at the C > level. > > But I think I actually don't understand what you are trying to achieve > exactly, and why, because I admit I don't know well what exactly is it > that causes power waste due to "Emacs wakeups" you want to avoid. I confess I've been having the same concern as Daniel has. (I usually turn off blink-cursor-mode in order to work around it.) First, let us confirm that Emacs has two kinds of timers ("atimer" and "timer") just in case, because it can be confusing: http://lists.gnu.org/archive/html/emacs-devel/2004-10/msg01350.html . I can observe the difference in the timeout argument of the select calls depending on whether blink-cursor-mode is turned on or not. (compile Emacs with CFLAGS=-g) $ gdb emacs (gdb) b select_wrapper (gdb) command > silent > p *tmo > cont > end (gdb) r -Q -D Then the timeout value becomes 100k sec. This means the Emacs process blocks practically indefinitely as long as it is idle. If you turn on blink-cursor-mode, then the timeout value is shortened to 0.5 sec even if it is idle or there are no focused frames. What Daniel is trying to would be to make this timeout 100k sec while there are no focused frames by suspending the timer for blink-cursor-mode. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp