From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Start emacs without opening a window (X11) Date: Tue, 11 Sep 2007 14:54:17 +0200 Organization: University Koblenz-Landau Campus Koblenz Message-ID: <877imxs6py.fsf@baldur.tsdh.de> References: <87hcm130rf.fsf@toyland.sauerland.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1189518041 26296 80.91.229.12 (11 Sep 2007 13:40:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2007 13:40:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 11 15:40:38 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IV5yf-00044w-SH for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2007 15:40:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IV5yf-0004gh-Tm for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Sep 2007 09:40:29 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-kl.de!cache.uni-koblenz.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 70 Original-NNTP-Posting-Host: dslb-084-063-005-239.pools.arcor-ip.net Original-X-Trace: cache.uni-koblenz.de 1189515258 11206 84.63.5.239 (11 Sep 2007 12:54:18 GMT) Original-X-Complaints-To: news@cache.uni-koblenz.de Original-NNTP-Posting-Date: Tue, 11 Sep 2007 12:54:18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Xref: shelby.stanford.edu gnu.emacs.help:151974 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:47484 Archived-At: Sebastian Kaps writes: Hi Sebastian, > Is there a possibility to start Emacs without opening a window? I > want to start the Emacs server from my .emacs and then use only > emacsclient to pop up a new window. If you use the current development version of emacs which includes multi-tty, then you can use these two scripts. --8<---------------cut here---------------start------------->8--- #!/bin/bash # # Usage: emacs-preload [] # # Preloads the Emacs instance called NAME in a detached screen session. Does # nothing if the instance is already running. If WAITP is non-empty, the # function waits until the server starts up and creates its socket; otherwise # it returns immediately. name="$1" waitp="$2" screendir="/var/run/screen/S-$USER" serverdir="/tmp/emacs$UID" emacs=/usr/bin/emacs if [ -z "$name" ]; then echo "Usage: preload_emacs []" >&2 exit 1 fi if [ ! -e "$screendir"/*."$name" ]; then if [ -e "$serverdir/$name" ]; then # Delete leftover socket (for the wait option) rm "$serverdir/$name" fi screen -d -m -S "$name" "$emacs" -nw --eval "(setq server-name \"$name\")" --funcall server-start fi if [ ! -z "$waitp" ]; then while [ ! -e "$serverdir/$name" ]; do sleep 1; done fi --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- #!/bin/bash # Usage: connect-emacs ... # # Connects to the Emacs instance called NAME. Starts up the instance if it is # not already running. The rest of the arguments are passed to emacsclient. name="$1" shift if [ -z "$name" ]; then echo "Usage: connect_emacs ..." >&2 exit 1 fi # Startup that emacs if it's not running! emacs-preload "$name" wait /usr/bin/emacsclient -s "$name" "$@" --8<---------------cut here---------------end--------------->8--- Bye, Tassilo