From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: multiple users, one emacs - how? Date: Sun, 04 Jun 2006 03:04:24 +0200 Organization: Informatimago Message-ID: <87mzct689z.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1149385231 29144 80.91.229.2 (4 Jun 2006 01:40:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 4 Jun 2006 01:40:31 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 04 03:40:30 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FmhbQ-0001iv-HU for geh-help-gnu-emacs@m.gmane.org; Sun, 04 Jun 2006 03:40:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FmhbQ-0003qG-1E for geh-help-gnu-emacs@m.gmane.org; Sat, 03 Jun 2006 21:40:28 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!news.germany.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 84 Original-X-Trace: individual.net GxiZlc8M+r5NkfV+rVZR9A/9VS4VLE52TQjEGE8qOHlrCCuWCM Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:v8HsTBYHZO0NMVg754F4p26qBuk= Original-Xref: shelby.stanford.edu gnu.emacs.help:139701 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35325 Archived-At: Joe Corneli writes: > 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). Well, when you connect to a remote host, you can know the IP. But you're right, you may be behind a NAT router. In that case, you can send the X traffic thru ssh: ssh publishes a X display on a local port on the remote that it forward back to the client, so you can have the display on the local computer with: ssh -X remote.host xclock -display localhost:10 for example. > 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? You have several options. You could use the multitty branch of emacs, which allows to create new tty frames as we can create new X frames. In terminal 1: emacs In terminal 2: emacsclient --tty You could also use: M-x make-frame-on-tty RET /dev/pts/NN RET xterm RET But you'd need to ensure that your input in the xterm is not taken by another program: run sleep 100000 for example! xterm -display :0.0 -e bash -c 'ls -l /proc/$$/fd/;sleep 1000' The advantage of multi-tty emacs is that you can have both X and terminal frames. You can also use screen, which would allow you to share terminals on the same shell for any terminal application, including an emacs (even a non multi-tty one): screen -e^^^^ -d -m emacs -nw # to launch an emacs screen -r -x # to attach to the session screen -r -x # to attach to the session from another terminal. (with emacs, it's useful to use C-^ as screen escape instead of the default C-a). You can try it with: screen -e^^^^ -d -m emacs -nw xterm -e screen -r -x & xterm -e screen -r -x & xterm -e screen -r -x & The advantage of screen is that you can easily detach from the session and having it go on with no terminal. -- __Pascal Bourguignon__ http://www.informatimago.com/ ATTENTION: Despite any other listing of product contents found herein, the consumer is advised that, in actuality, this product consists of 99.9999999999% empty space.