From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Haselwarter Newsgroups: gmane.emacs.devel Subject: Re: screen & emacs Date: Thu, 03 Feb 2011 21:31:58 +0100 Message-ID: <87wrlghnb5.fsf@nzebook.haselwarter.org> References: <87k4hh4thk.fsf@sysu76.podval.org> <20110203181348.GA15004@andres.andreas> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1296765147 6321 80.91.229.12 (3 Feb 2011 20:32:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 3 Feb 2011 20:32:27 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 03 21:32:24 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pl5qp-0005d5-Hq for ged-emacs-devel@m.gmane.org; Thu, 03 Feb 2011 21:32:23 +0100 Original-Received: from localhost ([127.0.0.1]:35354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pl5qo-0000yn-Ee for ged-emacs-devel@m.gmane.org; Thu, 03 Feb 2011 15:32:22 -0500 Original-Received: from [140.186.70.92] (port=55625 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pl5qg-0000xM-CN for emacs-devel@gnu.org; Thu, 03 Feb 2011 15:32:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pl5qe-0006lc-QR for emacs-devel@gnu.org; Thu, 03 Feb 2011 15:32:14 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:50149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pl5qe-0006l2-IC for emacs-devel@gnu.org; Thu, 03 Feb 2011 15:32:12 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pl5qc-0005Vq-W0 for emacs-devel@gnu.org; Thu, 03 Feb 2011 21:32:11 +0100 Original-Received: from mna75-3-89-83-43-131.dsl.club-internet.fr ([89.83.43.131]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Feb 2011 21:32:10 +0100 Original-Received: from philipp.haselwarter by mna75-3-89-83-43-131.dsl.club-internet.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 03 Feb 2011 21:32:10 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: mna75-3-89-83-43-131.dsl.club-internet.fr X-NSA-Fodder: Jyllandsposten Uzbekistan Pine Gap JFK DRM Adriatic Osama CDC X-Flame: You have the rotten spelling of a maniac. User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:jD4lGmZsjFo0CvGopLcaQnNYjbg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135521 Archived-At: Andreas Marschke writes: > Hi! > ---8<---[snipped 20 lines]---8<--- > > Here is a more elaborate example from both my `.screenrc' and my > `.bashrc': > --------: .bashrc > function emacs() > { > if [ -x /tmp/emacs$UID/server ];then > emacsclient -nw $@ > else > screen emacs -nw -f server-start $@ > fi > } > ---8<---[snipped 91 lines]---8<--- This shouldn't be necessary anymore, I used to use a similar construct, but there's simpler. If you run emacsclient with `-a=""' or `--alternate-editor=""', it tries to connect to the server first, and if it fails to connect, starts it. This way, you never end up trying to start several daemons at once etc: .bashrc: --8<---------------cut here---------------start------------->8--- alias emacs='emacsclient -a="" -nw' --8<---------------cut here---------------end--------------->8--- and similarly in your .screenrc: --8<---------------cut here---------------start------------->8--- screen -t EMACS 4 emacsclient -a="" -nw --8<---------------cut here---------------end--------------->8--- -- Philipp Haselwarter