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

Re: w3m tab line constantly consumes CPU

In [emacs-w3m : No.12203] Michael Heerdegen wrote:
>> let me know, what/how does renew the value of `w3m-tab-line-format'?

> That is a very good question!  I oversaw that we still start with

>   (or w3m-tab-line-format ...)

Yes, the value should not change once it gets a non-nil value.
But the value and the header line appearance change in practice.
`w3m-tab-line-format' is a buffer-local variable, and its value
is nil in a buffer other than w3m-mode buffers.
However, the :eval form always runs in a w3m-mode buffer as far
as I can observe.  That is a mystery.

> After thinking about it, I came to the conclusion that it can't work,
> theoretically.  After I tried it again, I also came to the conclusion
> that it doesn't work in practice ;-)  Dunno what we both tested...

> Anyway, I think the patch is nonetheless a step in the right direction.
> But we would also have to set `w3m-tab-line-format' to nil when the tab
> line got out of sync - and this in all w3m buffers.  WDYT?

I realized the :eval form of `header-line-format' runs not so
frequently.  So, I think `w3m-tab-line-format' and caching the
value in it is needless.  I.e.:

(defun w3m-tab-line ()
  [calculate the "VALUE" of header-line-format]

Now the `top' command doesn't show the entry for the Emacs
process in the first page. :)