unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Nix <nix@esperi.org.uk>
To: Alin Soare <as1789@gmail.com>
Cc: Juri Linkov <juri@jurta.org>, martin rudalics <rudalics@gmx.at>,
	Emacs Dev <emacs-devel@gnu.org>,
	Drew Adams <drew.adams@oracle.com>,
	Juanma Barranquero <lekktu@gmail.com>
Subject: Re: Tabs are ready? -> Let us give a definition of tabs.
Date: Thu, 09 Feb 2012 11:19:55 +0000	[thread overview]
Message-ID: <87ehu46yp0.fsf@spindle.srvr.nix> (raw)
In-Reply-To: <CA+Xtq3XW_VXGYrH-i4q_1YMz84ANoG5EGx-uEBgDWSXT98mF4w@mail.gmail.com> (Alin Soare's message of "Thu, 9 Feb 2012 01:43:41 +0200")

On 8 Feb 2012, Alin Soare outgrape:

> I propose the following  [brief/ main steps of a] concrete solution for
> changing the color of a hidden tab whose process gave output in the
> meantime:
>
> 1. Every tab has a unique ID that can be read and not modified. This ID is
> dubbed by the system at the creation of the tab.

This is pointless. Window configurations don't need a 'unique ID',
neither does this. Just reify the tab: make it a unique Lisp object type
(again, like window-configurations). Now the tab object serves as its
own unique ID.

> 1' Every tab has an internal state. The tab can be seen as a dispather of
> messages (or actor) of scheme.

I don't understand. Are you saying that each tab is its own recursive
editing loop? Because that seems unnecessary (and likely to be very
confusing to users).

> 2. When the tab is created , it starts the process, and memorize the
> process in its internal state.

Tabs surely have nothing to do with processes. I expect most tabs to
contain buffers (or window configurations, perhaps). A constraint that
they all contain processes is surely impractical.

Do you mean that (create-tab ...) returns a 'tab process', much as
'make-network-process' does, and that this 'tab process' is then used to
receive events from the tab somehow (such as the user switching to it)?

That's reasonable, I suppose, though we'd need to define what that
process sentinel does. For network processes this is clear enough:
creation of a network connection, its breaking, and the reception of
data invoke the sentinel and optionally dump the data into a buffer.

This makes conceptual sense because network connections are like
processes in that they are things down which asynchronous bytestreams
are transmitted in both directions. None of this is true for tabs, as
far as I can see, so the process sentinel model isn't such a good fit.
(I can't think of anything that is a better fit, except perhaps
some hooks called from the C core whenever a tab is switched to. I would
strongly advise against any concept of tab-local variables: while they
make programming a tiny bit easier they make variable lookup slower and
much harder to get right. Frame-local variables have enough ugliness and
unfixable bugs that they are being removed. Let's not make it worse. I
know nobody has proposed this yet: I thought I'd just shoot it down
pre-emptively.)

> 3. we use the hooks from process , low level programming.

You need a lot more description than that. What does a tab sentinel
function do? Processes and network streams send and receive data. What
do tabs do?

> 4. we add a hook that calls a function like tabs-process-signals. This is
> either a function of the internal state of a tab, and in case must be
> generated for each tab, using the ID of a tab, or be in global environment,
> and loop over each tab.

The latter is unscalable, but there's no requirement for something in
the global environment to necessarily do any sort of loop. A tabs hook
function would probably be called with the tab object as a parameter.

> 5. this function (tabs--process-signals) either is generated separately for
> each tab, or loops over the list of tabs, and identify the tab whose
> process' buffer modified.

If you passed the tab object as a parameter, that would be entirely
unnecessary.

> If emacs had actors, a tab could be implemented directly. If not, the idea
> of internal state can be encoded somehow.

Er, yeah, quite a lot of things in Emacs have internal state. More
internal state than you can shake a stick at. :)

-- 
NULL && (void)



  reply	other threads:[~2012-02-09 11:19 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04 22:36 Tabs are ready? -> Let us give a definition of tabs Alin Soare
2012-02-05 10:42 ` martin rudalics
2012-02-05 12:44   ` Alin Soare
2012-02-05 13:17     ` martin rudalics
2012-02-05 13:39       ` Alin Soare
     [not found]         ` <CA+Xtq3U5PkH=m1ZRMMm2LJQ_BHZXc08Vk4TbhNyyFLta+1EkBw@mail.gmail.com>
2012-02-05 13:44           ` Fwd: " Alin Soare
2012-02-05 14:50             ` Alin Soare
2012-02-05 17:56               ` Andy Moreton
2012-02-05 18:51                 ` Drew Adams
2012-02-06  3:35                   ` Stephen J. Turnbull
2012-02-05 18:16               ` martin rudalics
2012-02-05 21:33                 ` Alin Soare
2012-02-06 10:35                   ` martin rudalics
2012-02-06 13:21                     ` Alin Soare
2012-02-05 23:56                 ` Alin Soare
2012-02-06 10:36                   ` martin rudalics
2012-02-06 13:34                     ` Alin Soare
2012-02-06 14:46                       ` Stephen J. Turnbull
2012-02-06 16:18                         ` Alin Soare
2012-02-06 16:21                           ` Alin Soare
2012-02-06 17:53                           ` Stephen J. Turnbull
2012-02-06 22:51                             ` Alin Soare
2012-02-06 22:55                               ` Alin Soare
2012-02-07 16:15                               ` Stephen J. Turnbull
2012-02-09 15:55                               ` PJ Weisberg
2012-02-09 16:11                                 ` Alin Soare
2012-02-09 16:16                                   ` Alin Soare
2012-02-10 19:04                                     ` Alin Soare
2012-02-10 19:08                                       ` Alin Soare
2012-02-11 14:16                                     ` Nix
2012-02-11 14:41                                       ` Alin Soare
2012-02-12 13:40                                         ` Nix
2012-02-12 16:23                                           ` Alin Soare
2012-02-12 18:48                                             ` Alin Soare
2012-02-13  6:06                                       ` Stephen J. Turnbull
2012-02-13 12:29                                         ` Nix
2012-02-13 15:53                                           ` Tom Tromey
2012-02-13 16:21                                             ` Nix
2012-02-13 16:30                                               ` Tom Tromey
2012-02-13 18:50                                                 ` Nix
2012-02-15 20:35                                                   ` Tom Tromey
2012-02-15 22:59                                                     ` Stefan Monnier
2012-02-15 23:03                                                     ` Nix
2012-02-28 15:13                                                       ` Alin Soare
2012-02-28 15:16                                                         ` Alin Soare
2012-02-13 13:24                                         ` Stefan Monnier
2012-02-13 13:49                                           ` Nix
2012-02-13 15:20                                             ` Stefan Monnier
2012-02-13 16:21                                               ` Nix
2012-02-06 18:00                         ` martin rudalics
2012-02-06 17:05                       ` martin rudalics
2012-02-05 18:15         ` martin rudalics
2012-02-05 21:38           ` Alin Soare
2012-02-05 22:30             ` joakim
2012-02-05 22:53               ` Alin Soare
2012-02-06 10:35             ` martin rudalics
2012-02-06 13:25               ` Alin Soare
2012-02-06 17:03                 ` martin rudalics
2012-02-06 19:19                   ` Nix
2012-02-06 19:43                     ` martin rudalics
2012-02-06 19:45                       ` Nix
2012-02-06 19:54                       ` Drew Adams
2012-02-08 23:43                         ` Alin Soare
2012-02-09 11:19                           ` Nix [this message]
2012-02-09 13:05                             ` Alin Soare
2012-02-09 13:07                               ` Alin Soare
2012-02-07 15:57                     ` Stephen J. Turnbull
2012-02-07 17:15                       ` Nix
2012-02-06 20:05                   ` Alin Soare
2012-02-07 16:03                     ` Stephen J. Turnbull
2012-02-06 17:04                 ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ehu46yp0.fsf@spindle.srvr.nix \
    --to=nix@esperi.org.uk \
    --cc=as1789@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    --cc=lekktu@gmail.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).