On Monday, February 6, 2012, Alin Soare <as1789@gmail.com> wrote:
>> But this does not require all of the junk (events, callbacks, etc)
>> that you've talked about. All that *needs* to be added to Emacs is
>> the very limited API needed to associate tabs with a window or frame,
>> displayable content and a label with each tab, and to query that
>> information. The rest can be implemented with existing Emacs Lisp
>> facilities, such as faces (to change the color of a tab) and process
>> sentinels (one sort of event callback). If you want a GTK-like API,
>> that should be easy to write in Lisp.
>>
>
> Without events, do you have a concrete idea how to signal to a hidden tab that something changed , such that it changes the color?
> I do not need a very limited API. I need a programmable tab bar.
I would give the tab a "wants attention" flag that gets unset when the tab is activated, and set when `(tab-request-attention TAB)' is called, e.g. by a process sentinal. Then the tab's title would switch from `tab-inactive-face' to `tab-wants-attention-face'.
The way I'm picturing it, the tab's internal state consists of four pieces of data: a title, a window (or possibly window configuration), a function that's called when it becomes active, and another function that's called when it becomes inactive. That *seems* like it's meeting all your requirements, as I've understood them.
--
-PJ
Gehm's Corrollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.