[Top][All Lists]

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

Tabs for console.

From: Alin Soare
Subject: Tabs for console.
Date: Wed, 27 Oct 2010 23:34:37 +0300

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.


reply via email to

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