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: Tabs for console. Date: Wed, 27 Oct 2010 23:34:37 +0300 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=00151750d9ca75936b04939f27d1 X-Trace: dough.gmane.org 1288212203 23233 80.91.229.12 (27 Oct 2010 20:43:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Oct 2010 20:43:23 +0000 (UTC) To: Emacs Dev Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 27 22:43:22 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PBCq2-0006D7-TZ for ged-emacs-devel@m.gmane.org; Wed, 27 Oct 2010 22:43:21 +0200 Original-Received: from localhost ([127.0.0.1]:49102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBCq1-0002N7-8O for ged-emacs-devel@m.gmane.org; Wed, 27 Oct 2010 16:43:13 -0400 Original-Received: from [140.186.70.92] (port=50996 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PBCpE-0001Yv-DJ for emacs-devel@gnu.org; Wed, 27 Oct 2010 16:42:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PBChi-0003MF-T6 for emacs-devel@gnu.org; Wed, 27 Oct 2010 16:34:40 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:47506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PBChi-0003M3-NL for emacs-devel@gnu.org; Wed, 27 Oct 2010 16:34:38 -0400 Original-Received: by gyh20 with SMTP id 20so886995gyh.0 for ; Wed, 27 Oct 2010 13:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=D16gHlFcVJim8iPP0/2kk6gdin0FJ68NRjXpmqxdmZw=; b=rvfLaJOizw7DB0uZ2dcs8/icu4/cSGCnQYGNM2sGUkq7kgUqtUrwhS3JvU4NXB2g9A QajFUPOurYBhs3k5eAhL4yrI40GhUlFdgZ+GaaLRkRAZaGP/oZYgD8jxRokBzZMlwUBO BxqAObSqBZnhogqEy/TDBLDQ651wnvZIzpALg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=baJ4jbomvvW+eywZP9ZigqFu6pmCqyagTnnL0J2QbbQu4aJPwG7NG1EnaXNNhlgSsu D/bHGXS5Cz7Y/sRJZU/ehyfGBA4BT0o9uqTvZfby8LqxIG6DOEr0EP1hHPV8WDbBgi8e Rs4Za5fCF/muMsegwBR70hOVXlsc43K9Zahu8= Original-Received: by 10.151.44.9 with SMTP id w9mr18176620ybj.274.1288211677941; Wed, 27 Oct 2010 13:34:37 -0700 (PDT) Original-Received: by 10.150.95.21 with HTTP; Wed, 27 Oct 2010 13:34:37 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:132148 Archived-At: --00151750d9ca75936b04939f27d1 Content-Type: text/plain; charset=UTF-8 I send again my previous message, because my previous message contained the attachments, and on emacs-devel lists seems there were errors inside the text. I do not attach the patch again (it has unciompressed more than 700K, and it is not complete ). I hope to send it without errors now. ------ I worked long time ago on tabs for console, as many of you already know. 1 year ago I reopened the tabs, and started from scratch, having a different idea. Afterwards I realized the idea was not good, and gave up again. 3 days ago I reopened the problem, and started to re-written it again from scratch. Concretely, this time I do not want to miss again. I do not want to work alone this time. I want to receive your suggestions. I have already talked about this with Stefan Monnier, and I want to implement it as agreed with him. A tab is a formed from a few scripts: an initialization script, an activation script, a deactivation script, etc. Here is the patch. I tried to create a tab that represents a frame with this code: (setq init-tab '( (+ 1 2) (setq fr (make-terminal-frame '((tab . t)))) ) ) (setq act-tab '( (message "activate") (select-frame fr) ) ) (setq deact-tab '( (message "hide tab") ) ) (make-tab (list (cons 'tab-code:init init-tab ) (cons 'tab-code:activate act-tab ) (cons 'tab-code:deactivate deact-tab ) ) ) (activate-tab 0) The parameter '0' of `activate-tab' means to activate the first TAB of the selected frame. It calls the activation script of the first tab, after it calls the deactivation script of the last activated tab (if any). I attach the output of git diff, and a test file test-tabs.el. In order to test it, you have to evaluate make-tab a few times, and afterwards (activate-tab 0) There is some code inserted in patch, and commented . It rested from the previous tries to do the tabs, and it is no longer useful. Do not expect too much ; the patch I send today makes emacs crash after a short period of use of tabs :). Do not install it on your good sources :). (the garbage collector makes it crash, and i do not see what variable is not protected using gcpro..). This is of second importance for now. The bugs will be corrected. Also, take care that the cashes of fonts are not cleared, and when you switch to the tab-frame, the redisplay-internal will not display correctly, and crashes. I forgot how to initialize the fonts for a frame. When you switch back with a command like (let ((f (car (frame-list)))) (select-frame f)) it displays the main frame correctly. For me to be able to finish this work, it is important/crucial for you to suggest me how to do it, in order to agree on the behavior of tabs. It is sure I cannot do this job alone. On the other hand, please report me bugs, and suggestions to solve them :) ) I definitively want to make the tabs as scripts. A particular set of scripts will create tabs as frames, another set as window-configurations, another set will be tabs for compilation, etc. Had emacs had lexical scoping, it would be easier to define the scripts. In dynamic scoping, for each tab one needs a variable with a different name to keep a tab-frame inside the scripts of that tab. I also modified make-terminal-frame, in order to be able to create frames that are not linked into frame-list. I call the frames of frame-list "main frames" (as you see in frame.h). For the next period of time I am able to work on this. I am waiting for your suggestions. It depends only on you if I continue to work and finish the tabs for console or not. Alin. --00151750d9ca75936b04939f27d1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I send again my previous message, because my previous message contained the= attachments, and on emacs-devel lists seems there were errors inside the t= ext.


I do not attach the patch again (it has unciompressed more = than 700K, and it is not complete ). I hope to send it without errors now.<= br>
------


I worked long time ago on = tabs for console, as many of you already know.

1 year ago I reopened= the tabs, and started from scratch, having a different idea. Afterwards I = realized the idea was not good, and gave up again.

3 days ago I reopened the problem, and started to re-written it again f= rom scratch.

Concretely, this time I do not want to miss again.
<= br>I do not want to work alone this time. I want to receive your suggestion= s.

I have already talked about this with Stefan Monnier, and I want to imp= lement it as agreed with him.

A tab is a formed from a few scripts: = an initialization script, an activation script, a deactivation script, etc.=

Here is the patch.

I tried to create a tab that represents a fra= me with this code:

(setq init-tab
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = '( (+ 1 2)
=C2=A0=C2=A0=C2=A0 =C2=A0(setq fr (make-terminal-frame &#= 39;((tab . t)))) ) )

(setq act-tab
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '( (message "activ= ate")
=C2=A0=C2=A0=C2=A0 =C2=A0(select-frame fr) ) )

(setq d= eact-tab
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '( (message "hide tab&q= uot;) ) )

(make-tab (list (cons 'tab-code:init init-tab )
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (cons 'tab-code:activate act-tab = )
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 (cons 'tab-code:deactivate d= eact-tab )
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ) )

(activate-ta= b 0)

The parameter '0' of `activate-tab' means to activa= te the first TAB of the selected frame. It calls the activation script of t= he first tab, after it calls the deactivation script of the last activated = tab (if any).

I attach the output of git diff, and a test file test-tabs.el.

In order to test it, you have to evaluate make-tab a few times, and afterwa= rds (activate-tab 0)

There is some code inserted in patch, and comme= nted . It rested from the previous tries to do the tabs, and it is no longe= r useful.

Do not expect too much ; the patch I send today makes emacs crash after= a short period of use of tabs :). Do not install it on your good sources := ). (the garbage collector makes it crash, and i do not see what variable is= not protected using gcpro..). This is of second importance for now. The bu= gs will be corrected. Also, take care that the cashes of fonts are not clea= red, and when you switch to the tab-frame, the redisplay-internal will not = display correctly, and crashes. I forgot how to initialize the fonts for a = frame. When you switch back with a command like

=C2=A0(let ((f (car (frame-list))))=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
=C2=A0 (select-frame f))

it displays the main frame correctly.

For me to be able to finish this work, it is important/crucial for you = to suggest me how to do it, in order to agree on the behavior of tabs. It i= s sure I cannot do this job alone. On the other hand, please report me bugs= , and suggestions to solve them :) )

I definitively want to make the tabs as scripts. A particular set of sc= ripts will create tabs as frames, another set as window-configurations, ano= ther set will be tabs for compilation, etc. Had emacs had lexical scoping, = it would be easier to define the scripts. In dynamic scoping, for each tab = one needs a variable with a different name to keep a tab-frame inside the s= cripts of that tab. I also modified make-terminal-frame, in order to be abl= e to create frames that are not linked into frame-list. I call the frames o= f frame-list "main frames" (as you see in frame.h).

For the next period of time I am able to work on this. I am waiting for= your suggestions. It depends only on you if I continue to work and finish = the tabs for console or not.


Alin.


--00151750d9ca75936b04939f27d1--