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: Fwd: Tabs for console. Date: Mon, 8 Nov 2010 21:51:09 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0015176f1376197e7d04948ff208 X-Trace: dough.gmane.org 1289245887 32149 80.91.229.12 (8 Nov 2010 19:51:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 8 Nov 2010 19:51:27 +0000 (UTC) Cc: Emacs Dev To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 08 20:51:19 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 1PFXkM-00085y-P3 for ged-emacs-devel@m.gmane.org; Mon, 08 Nov 2010 20:51:19 +0100 Original-Received: from localhost ([127.0.0.1]:58657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFXkM-0005bO-Ay for ged-emacs-devel@m.gmane.org; Mon, 08 Nov 2010 14:51:18 -0500 Original-Received: from [140.186.70.92] (port=44290 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFXkG-0005al-6x for emacs-devel@gnu.org; Mon, 08 Nov 2010 14:51:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFXkE-0006zC-Hn for emacs-devel@gnu.org; Mon, 08 Nov 2010 14:51:12 -0500 Original-Received: from mail-gw0-f41.google.com ([74.125.83.41]:54016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFXkE-0006yz-CR for emacs-devel@gnu.org; Mon, 08 Nov 2010 14:51:10 -0500 Original-Received: by gwb17 with SMTP id 17so273116gwb.0 for ; Mon, 08 Nov 2010 11:51:09 -0800 (PST) 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:cc:content-type; bh=0w2bqfEIbwEw93NqCIR3HqTY+3AhZnNMozK7iCofx0Q=; b=IHiR99K3l4AvEDnV3M7owD3pZVO1YXHB5wSJ2iyqVfYo1k9OzQpwWVUI9rAWPKnPMT yhv4ahvTEyyw0AGEf0NAr6V3ZP/iBb+ZRdaOG3Gsb4zNUDwNKiPBzNsuUZK6dPeGzaSa lGnjXS3OLTfO/ixhu81PRSILXXHVJvjTRcbRA= 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 :cc:content-type; b=Fl8LoKN82TultlPQCq+Jc6QeaTXH7F75mmU3YtfejR7DXYAYiX1RQ/kGCeOP9ZVk/W AGYxSA9PdE/UMhztA7azt+Tsfyjg3LjH2KUDNJpXM40GxzYFkzMQQROK7FGuJqwr+QC5 b1/4ibfzVw/RxG14F81UVt+7k50nJ6KKGGLko= Original-Received: by 10.151.100.6 with SMTP id c6mr9184712ybm.103.1289245869833; Mon, 08 Nov 2010 11:51:09 -0800 (PST) Original-Received: by 10.150.95.21 with HTTP; Mon, 8 Nov 2010 11:51:09 -0800 (PST) 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:132459 Archived-At: --0015176f1376197e7d04948ff208 Content-Type: text/plain; charset=UTF-8 The patch I sent contained a bug of garbage collerctor, and more than that it was not commented. I am preparing now a patch that contains - no bug - comments - minimal code, that takes no action apart from showing the tabs. I will resend the patch again in a few days, when I have time to complete it, and we will discuss again about what a tab should do, in order to implementent what you ask for a tab, etc. See you soon. alin 2010/11/8 Stefan Monnier > > A tab is a formed from a few scripts: an initialization script, and > > activation script, an deactivation script, etc. > > > Here is the patch. > > The patch is huge and includes a lot of irrelevant changes (mostly > reverting recent changes), so it's not readable as sent. > Make sure you send a diff that's relative to the code that you modified, > and not to some other version of the code: check the patch visually and > if you see a change in there which *you* did not write, then the patch > is wrong (i.e. you're calling git with incorrect arguments). > > > 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 desact-tab > > '( (message "hide tab") ) ) > > > (make-tab (list (cons 'tab-code:init init-tab ) > > (cons 'tab-code:activate act-tab ) > > (cons 'tab-code:desactivate desact-tab ) > > ) ) > > > (activate-tab 0) > > I don't know what the above means. Please explain what the above is > meant to do and in what way. > > One problem I see with the above is that it uses quoted code, which has > the major disadvantage of not being byte-compilable. Always try and use > functions instead of quoted code. Something like: > > (setq init-tab > (lambda () > (+ 1 2) > (setq fr (make-terminal-frame '((tab . t)))))) > > (setq act-tab > (lambda () > (message "activate") > (select-frame fr))) > > (setq desact-tab > (lambda () > (message "hide tab"))) > > > The parameter '0' of `activate-tab' means to activate the first TAB of > the > > selected frame. > > Why? Are they numbered? > > > 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. > > Are your tabs "per-frame" or "per-window", or something else? > > > Stefan > --0015176f1376197e7d04948ff208 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The patch I sent contained a bug of garbage collerctor, and more than t= hat it was not commented. I am preparing now a patch that contains

-= no bug
- comments
- minimal code, that takes no action apart from sh= owing the tabs.

I will resend the patch again in a few days, when I have time to comple= te it, and we will discuss again about what a tab should do, in order to im= plementent what you ask for a tab, etc.

See you soon.


alin



2010/11/8 Stefan Monnier <monnier@iro.= umontreal.ca>
> A tab is a formed from a few scripts: an initializat= ion script, and
> activation script, an deactivation script, etc.

> Here is the patch.

The patch is huge and includes a lot of irrelevant changes (mostly reverting recent changes), so it's not readable as sent.
Make sure you send a diff that's relative to the code that you modified= ,
and not to some other version of the code: check the patch visually and
if you see a change in there which *you* did not write, then the patch
is wrong (i.e. you're calling git with incorrect arguments).

> I tried to create a tab that represents a frame with this code:

> (setq init-tab
> =C2=A0 =C2=A0 =C2=A0 '( (+ 1 2)
> =C2=A0 =C2=A0 =C2=A0(setq fr (make-terminal-frame '((tab . t)))) )= )

> (setq act-tab
> =C2=A0 =C2=A0 =C2=A0 '( (message "activate")
> =C2=A0 =C2=A0 =C2=A0(select-frame fr) ) )

> (setq desact-tab
> =C2=A0 =C2=A0 =C2=A0 '( (message "hide tab") ) )

> (make-tab (list (cons 'tab-code:init init-tab )
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cons 'tab-code:activate act-tab )
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cons 'tab-code:desactivate desact-tab= )
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 ) )

> (activate-tab 0)

I don't know what the above means. =C2=A0Please explain what the = above is
meant to do and in what way.

One problem I see with the above is that it uses quoted code, which has
the major disadvantage of not being byte-compilable. =C2=A0Always try and u= se
functions instead of quoted code. =C2=A0Something like:

=C2=A0 (setq init-tab
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda ()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (+ 1 2)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq fr (make-terminal-frame '((ta= b . t))))))

=C2=A0 (setq act-tab
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda ()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "activa= te")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (select-frame fr)))

=C2=A0 (setq desact-tab
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda ()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message "hide tab")))

> The parameter '0' of `activate-tab' means to activate the = first TAB of the
> selected frame.

Why? =C2=A0Are they numbered?

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

Are your tabs "per-frame" or "per-window", or som= ething else?


=C2=A0 =C2=A0 =C2=A0 =C2=A0Stefan

--0015176f1376197e7d04948ff208--