From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alin Soare Newsgroups: gmane.emacs.devel Subject: Re: Tabs are ready? -> Let us give a definition of tabs. Date: Sun, 5 Feb 2012 00:36:42 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8f3bb0453f695b04b82b103c X-Trace: dough.gmane.org 1328395010 26195 80.91.229.3 (4 Feb 2012 22:36:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 4 Feb 2012 22:36:50 +0000 (UTC) Cc: Juri Linkov , Juanma Barranquero , Emacs Dev To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 04 23:36:49 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RtoDw-0003ok-M6 for ged-emacs-devel@m.gmane.org; Sat, 04 Feb 2012 23:36:49 +0100 Original-Received: from localhost ([::1]:39194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtoDw-0005c7-2Z for ged-emacs-devel@m.gmane.org; Sat, 04 Feb 2012 17:36:48 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:53410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtoDt-0005al-Ii for emacs-devel@gnu.org; Sat, 04 Feb 2012 17:36:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RtoDs-0006ii-Cd for emacs-devel@gnu.org; Sat, 04 Feb 2012 17:36:45 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:58074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RtoDs-0006iX-7r for emacs-devel@gnu.org; Sat, 04 Feb 2012 17:36:44 -0500 Original-Received: by iagz16 with SMTP id z16so8509231iag.0 for ; Sat, 04 Feb 2012 14:36:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=Wot738piVUo/WS68uMQMx6U/ocuT7jTEPA4ULXEocYg=; b=J4A3+rAohsHcIOYdGrwQpwJX5aEmKXTxqK/NI6bCjoVTsBSXjXTq1qMpXstl1FktfY ezRLViWSCorK9NtLkGg92MIORwq5qsb8XLRboVeoIb25cDXqVGSpvXJJO42H7MBXwdbM +QiK31X188fNtZP6l5KtgQxmybMB8WQg0c+MA= Original-Received: by 10.50.169.9 with SMTP id aa9mr4000913igc.23.1328395002538; Sat, 04 Feb 2012 14:36:42 -0800 (PST) Original-Received: by 10.231.42.209 with HTTP; Sat, 4 Feb 2012 14:36:42 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.169 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:148167 Archived-At: --e89a8f3bb0453f695b04b82b103c Content-Type: text/plain; charset=UTF-8 I propose you to give a general definition of a tab, otherwise it will be disagreement between the tabs of GTK/motif/console , etc. I propose you a defintion. In choosing a definition, one must agree first of all on some * general principles ** in C must be written as little as possible ** almost tab behaviour must be defined in elisp Here what I propose: The tabs should be a defined as a list of objects (of type 'tab) in the struct frame. On the frame, the tab is represented as a widget in GTK/motif/ , or something similar in console. A tab object should be defined as a list of association, in which every standard event is associated with an elisp function. Apart from events, it can be defined some constants, like tab-name, etc. It is useful to be able to insert in this this other variables, that can be seen as tab-local. The events should be: - create the elisp funciton is executed once, immediately after the initialization of a tab - hide executed when the tab is hidden - show executed when we switch to that tab etc. Example: a tab that does nothing To create a tab that does absolutely nothing, we define no elisp function for all events. After the creation of such a tab, it will be visible in gtk widget, but commuting to it, nothing happens. Other example: a tab that switches to a buffer assoc with a file, like /root/.emacs - initialization event is defined so: -- erase all windows, and keep 1 window ( delete-other-windows ) -- open the file . emacs - hide event -- memorize window configuration into a variable 'OLD-window-config inserted in the assoc list of the tab - show event -- restaurate 'OLD-window-config - close event -- eventually kill the buffer .emacs In this manner one can define tabs to run processes in background, like compilations. Etc. I hope we could agree on such a definition of a tab. I implemented it 2 years ago, and give a simple example , in which tabs saves and restore window-configurations. Note that it require not too much work at C level, and it gives a huge number of possibilities of defining tabs, exactly as the 2 principles says. Alin --e89a8f3bb0453f695b04b82b103c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

I propose you to give a general definition of a tab, ot= herwise it will be disagreement between the tabs of GTK/motif/console , etc= .

I propose you a defintion. In choosing a definit= ion, one must agree first of all on some

* general principles

** in C m= ust be written as little as possible

** almost tab behaviour = must be defined in elisp


Here what = I propose:


The tabs should be a defined as a list o= f objects (of type 'tab) in the struct frame.

= On the frame, the tab is represented as a widget in GTK/motif/ , or somethi= ng similar in console.

A tab object should be defined as a list of association= , in which every standard event is associated with an elisp function. Apart= from events, it can be defined some constants, like tab-name, etc. It is u= seful to be able to insert in this this other variables, that can be seen a= s tab-local.

The events should be:

=C2=A0- = create

=C2=A0 =C2=A0 =C2=A0the elisp funciton is e= xecuted once, immediately after the initialization of a tab

<= /div>
=C2=A0- hide

=C2=A0 =C2=A0 executed when the tab is hidden

=C2=A0- show

=C2=A0 =C2=A0 execute= d when we switch to that tab

etc.


Example: a tab that does nothing

To create a tab t= hat does absolutely nothing, we define no elisp function for all events.

After the creation of such a tab, it will be visible= in gtk widget, but commuting to it, nothing happens.

Other example: a tab that switches to a buffer assoc wi= th a file, like /root/.emacs

=C2=A0- initializatio= n event is defined so:

=C2=A0 =C2=A0-- erase all w= indows, and keep 1 window ( delete-other-windows )=C2=A0

=C2=A0 =C2=A0-- open the file . emacs

=C2=A0- hide event

=C2=A0 =C2=A0-- memoriz= e window configuration into a variable 'OLD-window-config inserted in t= he assoc list of the tab

=C2=A0- show event

=C2=A0 -- r= estaurate=C2=A0'OLD-window-config

=C2=A0- clos= e event

=C2=A0 -- eventually kill the buffer .emac= s


In this manner one can define tabs to run processes in = background, like compilations.

Etc.

=

I hope we could agree on such a definition of a t= ab.

I implemented it 2 years ago, and give a simple example= , in which tabs saves and restore window-configurations.

Note that it require not too much work at C level, and it gives a h= uge number of possibilities of defining tabs, exactly as the 2 principles s= ays.



Alin

=


--e89a8f3bb0453f695b04b82b103c--