unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: Yuan Fu <casouri@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: A new collaborative editing package (maybe tangent)
Date: Sat, 30 Dec 2023 00:28:55 -0500	[thread overview]
Message-ID: <87cyuob6nc.fsf@red-bean.com> (raw)
In-Reply-To: <3E633CB5-B727-4933-8CF1-E1044CF39E70@gmail.com> (Yuan Fu's message of "Fri, 29 Dec 2023 20:22:55 -0800")

On 29 Dec 2023, Yuan Fu wrote:
>I’ve been working on a collaborative editing package on-and-off 
>for a
>while. I call it collab-mode. It’s far from complete but I want 
>to
>gather some early feedback (and find some people to test it).
>
>Yes, another collab editing package. I know there’s a pile of
>abandoned collab editing packages already, and whether it’s 
>really
>very useful is questionable in the age of google docs.

There is no question at all about its usefulness!  Having a 
reliable, usable, and easy-to-install Emacs package for 
collaborative editing would be amazing.  Even if it were to only 
support Emacs<->Emacs it would be a great thing; if it allows 
collaborative editing with people using other editors, then it 
will make the stars shine and the moon sing.

I know you said it's not there yet, but I just wanted to respond 
to your remark about questionable usefulness.  Many people would 
love to have this.  I hope you keep working on it!  (Personally, 
if I had time for sustained Emacs development, this would be my 
highest priority.)

>Nevertheless, there seems to be some niche use-cases and I want
>to make something original.

Not niche, not niche! :-)

I'll try to test it with a colleague in January.

Since you're using OT anyway, I wonder if eventually it can be 
compatible with Etherpad, which I believe is also OT not CRDT. 
That would be a nice win.

>It is still very much a WIP so expect it to break a lot and maybe
>don’t post it on Reddit or HN :-) After all, I might never 
>complete
>and publish it.

Understood.

Good luck!  We'll report bugs in your tracker when ready.

Best regards,
-Karl

>My goal for collab-mode is for it to be a p2p, cross-editor, 
>real-time
>collab editing package (Emacs collab with Vim!). It works kind of 
>like
>language servers (LSP): a local “collab server” (called collab
>process) talks to the editor over JSONRPC, and collab processes 
>talk
>among themselves over the internet. Most of the hard work is done 
>by
>the collab process and the editor end should be relatively easy 
>to
>implement.
>
>As of right now, collab-mode has these features:
>- Sharing a plain text file
>- Sharing a directory (still have rough edges)
>- Undo & redo (linear)
>- Builtin NAT traversal
>
>And it lacks:
>- Authentication and access control
>- Auto-resume from network breakage
>- Follow mode
>- Better error message and error handling in general
>- Documentation for writing a editor frontend
>- Any form of API stability whatsoever
>
>And obviously there’s no support for other editors yet.
>
>
>Getting started
>===============
>
>I hope I didn’t scare everyone away, here’s how to try it out:
>
>You can find the project at 
>https://github.com/casouri/collab-mode
>
>You can either clone the repo and
>
>    make session-1
>
>to run the collab process (you need rust toolchain to compile 
>it). Or
>download the pre-built binary from Releases [1], and run the 
>server
>with
>
>    RUST_BACKTRACE=1 RUST_LOG=debug ./collab-mode run --socket
>
>Then, load lisp/collab-mode.el, and
>
>    M-x collab RET
>
>It’ll prompt for your name, and give you some options to 
>continue.
>Press:
>
>  h  to open the dashboard (hub)
>  s  to share the current buffer
>  S  to share a file or directory
>
>Let’s go to the hub first. The dashboard should look like this:
>
>+-----------------------------------------------------------+
>|Connection: UP                                             |
>|Connection type: (socket 7701)                             |
>|Accepting remote peer connections: NO                      |
>|                                                           |
>|                                                           |
>|                                                           |
>|🧚 No shared docs, not here, not now.                      |
>|Let’s create one, and here’s how!                          |
>|                                                           |
>|                                                           |
>|PRESS + TO SHARE A FILE                                    |
>|PRESS C TO CONNECT TO A REMOTE DOC                         |
>|PRESS A TO ACCEPT REMOTE CONNECTIONS (for 180s)            |
>|                                                           |
>------------------------------------------------------------+
>
>You can share a file by pressing "+". It’ll open that file, start
>collab-monitored-mode (which should flash green on success), and
>present the share link in the hub:
>
>+-----------------------------------------------------------+
>|Connection: UP                                             |
>|Connection type: (socket 7701)                             |
>|Accepting remote peer connections: YES                     |
>|Server at: wss://signal.collab-mode.org/c28c65c2-a02a-11e..|
>|                                                           |
>|                                                           |
>|🧚 Your file is shared, and here’s the link                |
>|Anyone can connect with just a click!                      |
>|LINK: wss://signal.collab-mode.org/c28c65c2-a02a-11ee-b1e..|
>|                                                           |
>|                                                           |
>|self                                                       |
>|shared-file.txt *                                          |
>|                                                           |
>|PRESS + TO SHARE A FILE                                    |
>|PRESS C TO CONNECT TO A REMOTE DOC                         |
>|PRESS A TO ACCEPT REMOTE CONNECTIONS (for 180s)            |
>|                                                           |
>+-----------------------------------------------------------+
>
>You’ll notice that the link starts with 
>signal.collab-mode.org. Does
>that mean your file is hosted on that server? No. The sharer 
>hosts the
>file. This server is a _signaling_ server that I set up for NAT
>traversal, ie, to help setup the connection between collab 
>processes.
>
>On another editor, go to the hub, type "C", and enter the link;
>collab-mode will connect to the other editor and open the shared 
>file.
>It’ll open the buffer and start collab-monitored-mode (followed 
>by a
>green flash on success).
>
>Note that, when you share a file, your local collab process will 
>be
>open for public connection for 3 minutes. During this time, since
>there’s no authentication right now, anyone that knows your 
>address
>(wss://signal.collab-mode.org/c28c65c2-...) can connect to you.
>
>If you want to accept remote connection again, press "A" in the 
>hub.
>That’ll give you another 3 minutes.
>
>
>In the shared buffer
>====================
>
>In the shared buffer, you can only use collab-mode’s undo and 
>redo
>function, which are bound to "C-/" and "C-.", respectively. You 
>can
>also use undo-only and undo-redo, they are remapped to 
>collab-mode’s
>undo/redo commands.
>
>In the shared buffer, use collab-share-link to copy the share 
>link to
>clipboard.
>
>
>In the hub buffer
>=================
>
>I’ve setup eldoc for the hub buffer. When you leave point on a 
>doc,
>eldoc will show you the available commands for this doc.
>
>
>When things go wrong
>====================
>
>When refreshing in the hub buffer (pressing "g"), if something 
>goes
>wrong (can’t connect to local or remote collab process), the 
>error
>will be printed in the bottom.
>
>When in a shared buffer, if something goes wrong, the screen will
>flash red, and Emacs will show a warning detailing the error. In 
>that
>case, if you can, please collect the warning and terminal logs 
>and
>send them to me, so I can try to debug it.
>
>
>For the curious minds
>=====================
>
>There’s a README in src/README.md, it’s mostly for myself so 
>it’ll be
>hard to read for others. And before you ask, collab-mode doesn’t 
>use
>CRDT, it uses OT with tombstones.
>
>
>Help with rhymes
>================
>
>I hope you don’t find the fairy and her bad rhymes annoying. I’m 
>not
>very good at rhymes, chatgpt is even worse. If you can come up 
>with
>better ones, please do send them along :-)
>
>
>[1] The prebuilt binaries are debug build, which are pretty 
>large; the
>release build is much smaller (~6MB).



  reply	other threads:[~2023-12-30  5:28 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-30  4:22 A new collaborative editing package (maybe tangent) Yuan Fu
2023-12-30  5:28 ` Karl Fogel [this message]
2023-12-30 10:56   ` Philip Kaludercic
2024-01-02  3:16     ` Richard Stallman
2023-12-30 19:49   ` Yuan Fu
2023-12-31 15:33     ` T.V Raman
2024-01-01  4:35       ` Yuan Fu
2024-01-01 15:49   ` Richard Stallman
2024-01-02  3:54     ` Yuan Fu
2024-01-05  4:22       ` Richard Stallman
2023-12-30  8:56 ` Aw: " Arne Babenhauserheide
2023-12-30 20:09   ` Yuan Fu
2024-01-01  3:32     ` Richard Stallman
2024-01-01  4:53       ` Yuan Fu
2024-01-01 23:09         ` Stefan Kangas
2024-01-02  3:45           ` Yuan Fu
2024-01-04  3:59         ` Richard Stallman
2024-01-04  8:02           ` Dr. Arne Babenhauserheide
2024-01-05  0:33             ` Yuan Fu
2024-01-06  4:33               ` Richard Stallman
2024-01-06  7:14                 ` Yuan Fu
2024-01-08  3:48                   ` Richard Stallman
2024-01-09  2:49                     ` Richard Stallman
2024-01-06  4:33               ` Richard Stallman
2024-01-06  7:17                 ` Yuan Fu
2024-01-08  3:48                   ` Richard Stallman
2024-01-07  4:28             ` Richard Stallman
2024-01-07  4:28             ` Richard Stallman
2024-01-07  7:06               ` Yuan Fu

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=87cyuob6nc.fsf@red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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).