Discussion:
multiple users, one emacs - how?
Joe Corneli
2006-06-03 21:00:22 UTC
Permalink
The closest I've found to an answer is the suggestion by Pascal
in the thread "howto: 2 users interactively edit the same file ?",

http://lists.gnu.org/archive/html/help-gnu-emacs/2005-10/msg00842.html

I haven't had a chance to try this -- but I am primarily interested in
a solution that doesn't involve/require X (e.g. because me and my
collaborators are typically editing files in cybercafes, where it is
AFAIK impossible to determine an actual IP address for the computer --
if I'm wrong about this, I'd be willing to accept an X windows
solution).

Ideally (at least for now) what I'd like would be to have a copy of
emacs running on a computer somewhere where we'd log in via shell
accounts, and then we'd e.g. fire up an emacsclient and all get access
to that emacs's state.

It seems to be insinuated that (or anyway I've imagined) emacsclient
can actually do this. (Cf. this thread:
http://lists.gnu.org/archive/html/help-gnu-emacs/2005-08/msg00226.html)

Is this the case? Can emacsclient be used by multiple users to access
the same emacs through a shell? Or, if not emacsclient, can anyone
suggest a good solution?
Han Boetes
2006-06-03 21:22:55 UTC
Permalink
Use ssh to log in as the same user -- su - will not work -- and
then use screen to look at the same window.



# Han
--
::. +------------------------------------------------------+
(\./) .-""-. | A university is what a college becomes when the |
`\'-'` \ | faculty loses interest in students. - John Ciardi |
'.___,_^__/ +------------------------------------------------------+
Joe Corneli
2006-06-03 23:54:13 UTC
Permalink
I appreciate the suggestion (and I might well try this for fun), but
for long-term use, I think it best to have multiple distict users
recognized by the emacs process, so that Emacs can keep track of
different (distinct) users. I don't know if this is even possible
from Emacs's perspective, but please, let's start from the assumption
that it may be possible.

Use ssh to log in as the same user -- su - will not work -- and
then use screen to look at the same window.

Also, I don't particularly care that people actually see the same
Emacs window (in fact, I prefer that they be able to see whatever
window they want), just that they have access to the same Emacs
process.
Han Boetes
2006-06-04 00:06:51 UTC
Permalink
Post by Joe Corneli
Also, I don't particularly care that people actually see the
same Emacs window (in fact, I prefer that they be able to see
whatever window they want), just that they have access to the
same Emacs process.
shared libraries take care of the fact that users can securely use
the same resources while their privacy is assured.

Even though they don't use the same process the resources are
shared.

For example when I log in to the shell account of my ISP, whith
hundreds of simultanious users, emacs starts up within 0.1 second,
simply because somebody else is running it as well.



# Han
--
_ A furore Normanorum libera nos, O Domine! [From the fury of the
_V.-o norsemen deliver us, O Lord!] -- Medieval prayer
/ |`-'
(7_\\
Károly Lőrentey
2006-07-29 19:14:40 UTC
Permalink
Post by Joe Corneli
I haven't had a chance to try this -- but I am primarily interested in
a solution that doesn't involve/require X (e.g. because me and my
collaborators are typically editing files in cybercafes, where it is
AFAIK impossible to determine an actual IP address for the computer --
if I'm wrong about this, I'd be willing to accept an X windows
solution).
If the cafe allows you to use ssh, you can use its X tunneling feature
to forward a connection to your X server to any remote host. Very
useful.
Post by Joe Corneli
Ideally (at least for now) what I'd like would be to have a copy of
emacs running on a computer somewhere where we'd log in via shell
accounts, and then we'd e.g. fire up an emacsclient and all get access
to that emacs's state.
That should work fine in the multi-tty branch. The participants must
use the same user account, though.

It's not as convenient as it could be, because of the "single-kboard
mode": while Emacs is executing a complex command, it accepts input
From only a single terminal---the others will seem frozen. For
example, pressing M-x freezes all other terminals until you enter a
command and it executes. Recursive edits also lock out other
terminals. In my experience you can get used to this quite easily,
but you have to be aware of what is happening.

(Note that single-kboard mode was in fact added to prevent confusion
in the case you describe: multiple users interacting with Emacs at the
same time. Sadly it is very hard to teach Emacs to keep track of
multiple editing states simultaneously, so we need single-kboard to
serialize user requests.)
Post by Joe Corneli
It seems to be insinuated that (or anyway I've imagined) emacsclient
http://lists.gnu.org/archive/html/help-gnu-emacs/2005-08/msg00226.html)
Is this the case? Can emacsclient be used by multiple users to access
the same emacs through a shell?
Yes indeed; collaborative editing is supported in the multi-tty
branch. You can even have some users connect from a tty and others
From X.
Post by Joe Corneli
Or, if not emacsclient, can anyone suggest a good solution?
Han suggested GNU Screen. It is indeed a very useful and quite
powerful tool.

I think it would also be possible to write a Lisp package for editing
a file from multiple Emacs instances, with modifications appearing
realtime on all instances. I think the standard talk.el package that
comes with Emacs already does something similar.
--
K?roly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.fnord.hu/pipermail/multi-tty/attachments/20060729/a77b66dd/attachment.pgp
Continue reading on narkive:
Loading...