From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: floyd@barrow.com (Floyd L. Davidson) Newsgroups: gmane.emacs.help Subject: Re: emacs for everything? Date: Thu, 30 Dec 2004 06:11:02 -0900 Organization: __________ Message-ID: <871xd7zurd.fld@barrow.com> References: <87oeh82hia.fsf@thalassa.informatimago.com> <1104390545.758301@sj-nntpcache-3> <1104398985.835551@sj-nntpcache-5> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1104424049 19358 80.91.229.6 (30 Dec 2004 16:27:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Dec 2004 16:27:29 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 30 17:27:04 2004 Return-path: Original-Received: from mail-relay.eunet.no ([193.71.71.242]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ck38h-0003LI-00 for ; Thu, 30 Dec 2004 17:27:04 +0100 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by mail-relay.eunet.no (8.13.1/8.13.1/GN) with ESMTP id iBUGR2dX019799 for ; Thu, 30 Dec 2004 17:27:02 +0100 (CET) (envelope-from help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org) Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Ck3Je-00057e-3W for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Dec 2004 11:38:22 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: gnus 5.10.6/XEmacs 21.4.15/Linux 2.6.5 Cancel-Lock: sha1:xR+nW702A27qDZHxukMQqMyesw4= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 77 Original-Xref: shelby.stanford.edu gnu.emacs.help:127593 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: main.gmane.org gmane.emacs.help:23046 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23046 Ravi Uday wrote: > >> The command is `emacsclient', one word with no dash. >> I belive that was a misprint in the previous message, maybe >> due to the >> dash in the command that start the sever ;) >> > >Yea right, it works, but how does one start the server to enable >this client to connect to it. Do you have a procedure which >could be easily followed ? Everyone is telling you to put it into your ~/.emacs, and I'm going to tell you *do not do that*! If you do, it means you cannot execute Emacs without starting a server... a limitation you do *not* want. So... make either an alias or a shell function to invoke the server in a different manner than a regular Emacs. For example, "alias emacs-server=/usr/bin/emacs -f server-start" is just about the simplest way to start it. However there are other options and issues you might want to think about too... Since it is a server, you may want it to be invoked by the startup for either your login shell or perhaps a window manager. In the case of starting by a window manager, you don't need to ever see the actual emacs window! So use the "-iconic" command line option to get rid of it. alias emacs-server=/usr/bin/emacs -iconic -f server-start" Another possibility is that you'll want other changes to the initialized environment for the server that are different from an emacs invoked separately. That is easy to accomplish too, alias emacs-server=/usr/bin/emacs -l ~/.emacs-server -iconic Now it will, after reading the regular init files (i.e., ~/.emacs), also read ~/.emacs-server. You can put whatever changes you want into that file, and end it with "server-start" in order to invoke the server. What would you want different??? Well, ymmv, but I don't want to kill the server everytime I type in C-x C-c (which is exactly what happens if you do that with only one emacsclient process active). Exiting with C-x C-c is a reflex that my fingers know very well, so I want to continue using that, but don't want to ever kill the server with it. So in my case I've redefined the exit code that C-x C-c is bound to. ;; for GNU Emacs only (unless (featurep 'xemacs) (defvar current-frame nil) (setq gnuserv-frame (current-frame))) ;; ;; disallow exiting from a command (menu option only) ;; (defun do-exit () "Exits Emacs or an Emacs client" (interactive) (if (gnuserv-running-p) (if (eq gnuserv-clients nil) (delete-frame) (gnuserv-edit)))) (define-key ctl-x-map "\C-c" 'do-exit) Warning: I use XEmacs, not GNU's version. Hence none of the above has been tested in a long time and is provided as an example of where to start. -- Floyd L. Davidson Ukpeagvik (Barrow, Alaska) floyd@barrow.com