Collaborative Text Editor

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ed Suominen

    Collaborative Text Editor

    I'm thinking of implementing a real-time collaborative text editor in Python
    using Twisted. An initial plan is to use a Twisted PB server daemon that
    accepts user:password:f ile connections from text editor clients to make
    changes to a specified file on the server, and have the text editor clients
    update their local copies of the file based on local user input or input
    entered from other users, relayed via the server.

    Jabber compatibility would be nice, as would color-coding of different
    users' text, etc. But I really want to keep this as simple as possible for
    a specific purpose. (I've written with twisted PB recently and am very
    pleased with its power and ease of use.)

    I'd appreciate pointers to any existing, simple Python-based text editors
    suitable for being adapted to this purpose. "Suitable" means under an
    OSI-approved license and written cleanly and modularly to facilitate
    incorporation into another project.

    Offers to collaborate would be gratefully accepted. The result, if any, will
    be GPL'd and released. If anyone wants to take these ideas and run with a
    project of their own, be my guest.

    Thanks,
    Ed Suominen
  • Ville Vainio

    #2
    Re: Collaborative Text Editor

    >>>>> "Ed" == Ed Suominen <ed-no@spam-eepatents.com> writes:

    Ed> I'm thinking of implementing a real-time collaborative text
    Ed> editor in Python using Twisted. An initial plan is to use a
    Ed> Twisted PB server daemon that

    ...

    Ed> Jabber compatibility would be nice, as would color-coding of
    Ed> different users' text, etc. But I really want to keep this as
    Ed> simple as possible for

    Do check out Leo:



    Not so much because of the potential for code looting (many seem to
    use scintilla for that, http://www.scintilla.org/), but because it
    would just be a neat idea and would further augment Leo's mind blowing
    qualities :-).

    --
    Ville Vainio http://tinyurl.com/2prnb

    Comment

    • John J. Lee

      #3
      Re: Collaborative Text Editor

      Ed Suominen <ed-no@spam-eepatents.com> writes:
      [color=blue]
      > I'm thinking of implementing a real-time collaborative text editor in Python
      > using Twisted.[/color]

      Cool! I've wondered about this in the past. Not sure how useful it
      would turn out to be, but would be fun to find out.

      [color=blue]
      > An initial plan is to use a Twisted PB server daemon that
      > accepts user:password:f ile connections from text editor clients to make
      > changes to a specified file on the server, and have the text editor clients
      > update their local copies of the file based on local user input or input
      > entered from other users, relayed via the server.[/color]

      I wonder if client-server is the way to go here. On the surface, P2P
      seems more natural fit.

      The way I've always imagined it working is as follows. I'm sure
      experimentation is the way to find out what works, though, so Twisted
      certainly sounds like a great idea.

      - At any time, exactly one person has control.

      - The only person able to move the cursor and edit text is the one
      with control.

      - Anybody may flag up that they want control. Everybody is notified
      when this happens.

      - Control passes from one person to another by means of the person
      with control yielding it to a specified person.


      If I were doing this (which I'm not, of course), I would go out of my
      way to meet the following goals:

      - Critical: the way should be left open to implementing the protocol
      on any decent editor.

      - Important: the protocol should be efficient, so that latency is
      minimised. I imagine this requires pushing changes out rather than
      polling to check for changes, and having reasonably high-level
      primitive operations -- maybe insert, cut, paste, move, maybe
      rectangle-wise cut/paste operations too, maybe indent / dedent, plus
      operations on a circular clipboard stack (strange image ;-).

      [color=blue]
      > Jabber compatibility would be nice, as would color-coding of different
      > users' text, etc.[/color]

      Jabber certainly seems an entirely secondary thing: if it helps meet
      your goals, great. If not, who cares?

      I don't see how colour coding would work, other than to have text that
      has been entered since the last switch of control coloured
      differently.

      [...][color=blue]
      > I'd appreciate pointers to any existing, simple Python-based text editors
      > suitable for being adapted to this purpose. "Suitable" means under an
      > OSI-approved license and written cleanly and modularly to facilitate
      > incorporation into another project.[/color]
      [...]

      I know vim is Python-scriptable, and has a fairly wide user base
      (especially if you count).

      For a number of reasons I've been meaning to learn vi properly for
      ages, but find it very hard to kick my emacs habit...

      have-the-appropriate-amount-of-fun-ly y'rs


      John

      Comment

      • Bengt Richter

        #4
        Re: Collaborative Text Editor

        On 14 Jul 2004 23:21:38 +0100, jjl@pobox.com (John J. Lee) wrote:
        [color=blue]
        >Ed Suominen <ed-no@spam-eepatents.com> writes:
        >[color=green]
        >> I'm thinking of implementing a real-time collaborative text editor in Python
        >> using Twisted.[/color]
        >
        >Cool! I've wondered about this in the past. Not sure how useful it
        >would turn out to be, but would be fun to find out.
        >
        >[color=green]
        >> An initial plan is to use a Twisted PB server daemon that
        >> accepts user:password:f ile connections from text editor clients to make
        >> changes to a specified file on the server, and have the text editor clients
        >> update their local copies of the file based on local user input or input
        >> entered from other users, relayed via the server.[/color]
        >
        >I wonder if client-server is the way to go here. On the surface, P2P
        >seems more natural fit.
        >
        >The way I've always imagined it working is as follows. I'm sure
        >experimentatio n is the way to find out what works, though, so Twisted
        >certainly sounds like a great idea.
        >
        >- At any time, exactly one person has control.[/color]
        Why not like a multiplayer game, where everyone sees the same world
        (document with signs of other player's activity) and all are able
        to play (select text for editing) at the same time (just not on overlapping text).[color=blue]
        >
        >- The only person able to move the cursor and edit text is the one
        > with control.[/color]
        Why? Why not have two windows, one with the common world view, where
        anyone can select thus-far unselected text -- which on selection changes
        appearance and may have hint-info floating to say whose selection is is, etc --
        and the other window to edit the selected text, which would only change in
        the common view when an editing person did a save. A save-and-release would
        make the text selectable by others again.
        [color=blue]
        >
        >- Anybody may flag up that they want control. Everybody is notified
        > when this happens.[/color]
        See above. They just do a selection, and either succeed or not, according
        to first come first served.[color=blue]
        >
        >- Control passes from one person to another by means of the person
        > with control yielding it to a specified person.[/color]
        Too bothersome. Also, if someone goes off and forgets to close his session,
        there should be a timeout. Perhaps a selection should have a for-how-long entry,
        and it should show counting down in the hint.
        [color=blue]
        >
        >
        >If I were doing this (which I'm not, of course), I would go out of my
        >way to meet the following goals:
        >
        >- Critical: the way should be left open to implementing the protocol
        > on any decent editor.
        >
        >- Important: the protocol should be efficient, so that latency is
        > minimised. I imagine this requires pushing changes out rather than
        > polling to check for changes, and having reasonably high-level
        > primitive operations -- maybe insert, cut, paste, move, maybe
        > rectangle-wise cut/paste operations too, maybe indent / dedent, plus
        > operations on a circular clipboard stack (strange image ;-).
        >[/color]
        I'd ask game people how they manage and cache common state.[color=blue]
        >[color=green]
        >> Jabber compatibility would be nice, as would color-coding of different
        >> users' text, etc.[/color][/color]
        Not excluded from game-like approach.[color=blue]
        >
        >Jabber certainly seems an entirely secondary thing: if it helps meet
        >your goals, great. If not, who cares?[/color]
        Being able to communicate separately with the current editor of any of all the
        active areas would seem useful.[color=blue]
        >
        >I don't see how colour coding would work, other than to have text that
        >has been entered since the last switch of control coloured
        >differently.[/color]
        I'd use one slight background color change or such to indicate a text area under edit,
        and use hints or right-click popups or such for additional details and comm access.
        Selection in structured text such as xml etc might operate with useful constraints,
        or optionally as with raw text.[color=blue]
        >
        >[...][color=green]
        >> I'd appreciate pointers to any existing, simple Python-based text editors
        >> suitable for being adapted to this purpose. "Suitable" means under an
        >> OSI-approved license and written cleanly and modularly to facilitate
        >> incorporation into another project.[/color]
        >[...]
        >[/color]
        Since selection and common-state viewing would be in a separate window,
        the result of a selection could be getting a temp file locally for editing,
        and any editor should be able to handle that.

        The save and save-and-release functions might require some specialized macros,
        but I'd guess any decent editor could be made to do it. Or maybe wrap editor
        execution in a shell that notices file updates and the final editor exit...
        [color=blue]
        >I know vim is Python-scriptable, and has a fairly wide user base
        >(especially if you count).
        >
        >For a number of reasons I've been meaning to learn vi properly for
        >ages, but find it very hard to kick my emacs habit...
        >
        >have-the-appropriate-amount-of-fun-ly y'rs
        >
        >
        >John[/color]
        Just OTTOMH...

        Regards,
        Bengt Richter

        Comment

        • Peter Hansen

          #5
          Re: Collaborative Text Editor

          John J. Lee wrote:[color=blue]
          > The way I've always imagined it working is as follows. I'm sure
          > experimentation is the way to find out what works, though, so Twisted
          > certainly sounds like a great idea.
          >
          > - At any time, exactly one person has control.
          >
          > - The only person able to move the cursor and edit text is the one
          > with control.[/color]
          [snip other ideas]

          There are already editors that support such things, so imagining
          how it works, while interesting, might not be the best approach
          to get started... vim, for example, already can do this sort
          of thing. I'm certain there are others out there.

          -Peter

          Comment

          • Paramjit Oberoi

            #6
            Re: Collaborative Text Editor

            > I'm thinking of implementing a real-time collaborative text editor in Python[color=blue]
            > using Twisted. An initial plan is to use a Twisted PB server daemon that
            > accepts user:password:f ile connections from text editor clients to make
            > changes to a specified file on the server, and have the text editor clients
            > update their local copies of the file based on local user input or input
            > entered from other users, relayed via the server.[/color]

            Also take a look at SubEthaEdit:


            Comment

            • Nick Vargish

              #7
              Re: Collaborative Text Editor

              jjl@pobox.com (John J. Lee) writes:
              [color=blue]
              > Cool! I've wondered about this in the past. Not sure how useful it
              > would turn out to be, but would be fun to find out.[/color]

              See SubEthaEdit (Mac OS X only, unfortunately) for a very nice
              implementation of this idea.
              [color=blue]
              > I wonder if client-server is the way to go here. On the surface, P2P
              > seems more natural fit.[/color]

              I think client-server is the way to go, it reduces complexity when you
              have more than two people collaborating at once. The person who
              initiates the edit session has the cannonical version of the file.
              [color=blue]
              > - At any time, exactly one person has control.[/color]

              SubEthaEdit allows all participants to write at the same time. Text
              from each participant is marked with a highlight color specific to
              that contributor.

              Token-passing is an interesting idea, but it could be frustrating for
              people who do not get the token (which could happen for any number of
              reasons, deserved or undeserved).

              Nick

              --
              # sigmask || 0.2 || 20030107 || public domain || feed this to a python
              print reduce(lambda x,y:x+chr(ord(y )-1),' Ojdl!Wbshjti!=o bwAcboefstobudi/psh?')

              Comment

              • Ed Suominen

                #8
                Re: Collaborative Text Editor

                Nicola Larosa on the twisted-python mailing list pointed me to a very
                helpful link:
                [color=blue]
                > Are you aware of LeoN?
                > http://ryalias.freezope.org/souvenirs/leon
                >
                > Leo (without 'N') is an outlining editor written in Python, old and
                > powerful, and LeoN is an extension for collaborative editing based on
                > Twisted, new and alpha, but probably worth a look.[/color]

                Ed Suominen wrote:
                [color=blue]
                > I'm thinking of implementing a real-time collaborative text editor in
                > Python using Twisted. An initial plan is to use a Twisted PB server daemon
                > that accepts user:password:f ile connections from text editor clients to
                > make changes to a specified file on the server, and have the text editor
                > clients update their local copies of the file based on local user input or
                > input entered from other users, relayed via the server.
                >
                > Jabber compatibility would be nice, as would color-coding of different
                > users' text, etc. But I really want to keep this as simple as possible for
                > a specific purpose. (I've written with twisted PB recently and am very
                > pleased with its power and ease of use.)
                >
                > I'd appreciate pointers to any existing, simple Python-based text editors
                > suitable for being adapted to this purpose. "Suitable" means under an
                > OSI-approved license and written cleanly and modularly to facilitate
                > incorporation into another project.
                >
                > Offers to collaborate would be gratefully accepted. The result, if any,
                > will be GPL'd and released. If anyone wants to take these ideas and run
                > with a project of their own, be my guest.
                >
                > Thanks,
                > Ed Suominen[/color]

                Comment

                • Jacek Generowicz

                  #9
                  Re: Collaborative Text Editor

                  Nick Vargish <nav+posts@band ersnatch.org> writes:
                  [color=blue]
                  > jjl@pobox.com (John J. Lee) writes:
                  >[color=green]
                  > > Cool! I've wondered about this in the past. Not sure how useful it
                  > > would turn out to be, but would be fun to find out.[/color]
                  >
                  > See SubEthaEdit (Mac OS X only, unfortunately) for a very nice
                  > implementation of this idea.[/color]

                  There is also something called Hydra.

                  (And make-frame-on-display in Emacs, can be used for the same sort of
                  thing.)

                  Comment

                  • John J. Lee

                    #10
                    Re: Collaborative Text Editor

                    Peter Hansen <peter@engcorp. com> writes:
                    [color=blue]
                    > John J. Lee wrote:[color=green]
                    > > The way I've always imagined it working is as follows. I'm sure
                    > > experimentation is the way to find out what works, though, so Twisted
                    > > certainly sounds like a great idea.
                    > > - At any time, exactly one person has control.
                    > > - The only person able to move the cursor and edit text is the one
                    > > with control.[/color]
                    > [snip other ideas]
                    >
                    > There are already editors that support such things, so imagining
                    > how it works, while interesting, might not be the best approach
                    > to get started... vim, for example, already can do this sort
                    > of thing. I'm certain there are others out there.[/color]

                    Could you provide a link to any info on how to do this in vim?


                    John

                    Comment

                    • Robin Becker

                      #11
                      Re: Collaborative Text Editor

                      John J. Lee wrote:
                      [color=blue]
                      > Peter Hansen <peter@engcorp. com> writes:
                      >
                      >[color=green]
                      >>John J. Lee wrote:
                      >>[color=darkred]
                      >>>The way I've always imagined it working is as follows. I'm sure
                      >>>experimentat ion is the way to find out what works, though, so Twisted
                      >>>certainly sounds like a great idea.
                      >>>- At any time, exactly one person has control.
                      >>>- The only person able to move the cursor and edit text is the one
                      >>> with control.[/color]
                      >>
                      >>[snip other ideas]
                      >>
                      >>There are already editors that support such things, so imagining
                      >>how it works, while interesting, might not be the best approach
                      >>to get started... vim, for example, already can do this sort
                      >>of thing. I'm certain there are others out there.[/color]
                      >
                      >
                      > Could you provide a link to any info on how to do this in vim?
                      >
                      >
                      > John[/color]
                      There's some info at http://docsynch.sourceforge.net/index.php and


                      --
                      Robin Becker

                      Comment

                      • Michael Hudson

                        #12
                        Re: Collaborative Text Editor

                        Jacek Generowicz <jacek.generowi cz@cern.ch> writes:
                        [color=blue]
                        > Nick Vargish <nav+posts@band ersnatch.org> writes:
                        >[color=green]
                        > > jjl@pobox.com (John J. Lee) writes:
                        > >[color=darkred]
                        > > > Cool! I've wondered about this in the past. Not sure how useful it
                        > > > would turn out to be, but would be fun to find out.[/color]
                        > >
                        > > See SubEthaEdit (Mac OS X only, unfortunately) for a very nice
                        > > implementation of this idea.[/color]
                        >
                        > There is also something called Hydra.[/color]

                        Hydra == old name of SubEthaEdit.

                        I don't know why they changed the name.

                        Cheers,
                        mwh

                        --
                        First time I've gotten a programming job that required a drug
                        test. I was worried they were going to say "you don't have
                        enough LSD in your system to do Unix programming". -- Paul Tomblin
                        -- http://home.xnet.com/~raven/Sysadmin/ASR.Quotes.html

                        Comment

                        Working...