emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Power: blink-cursor-mode is a pig


From: 山本 光晴
Subject: Re: Power: blink-cursor-mode is a pig
Date: Fri, 30 Dec 2011 21:49:22 +0900

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 
                                address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]