help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: confused about emacs 23 in daemon mode


From: Richard Riley
Subject: Re: confused about emacs 23 in daemon mode
Date: Mon, 12 Oct 2009 04:47:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

dkcombs@panix.com (David Combs) writes:

> In article <4aac9a85$0$17751$ba4acef3@news.orange.fr>,
> Bruno Barbier  <bruno.barbier.cs@begin_dom.orange.fr.end_dom> wrote:
>>On 2009-09-13, Daniel Pittman <daniel@rimspace.net> wrote:
>>> Tim X <timx@nospam.dev.null> writes:
>>>> Rodrigo Amestica <ramestica@gmail.com> writes:
>>>>
>>>>> it is so nice to have emacs starting so blazingly fast when using the
>>>>> daemon and emacsclient combination. However it seems that every other
>>>>> emacsclient I open is not an independent version of emacs and things get
>>>>> intermixed. I think that in emacs parlance the terminology is 'frame', all
>>>>> emacsclient instances are emacs frames.
>>
>>Thanks to emacsclient, you only have one emacs. The fact that you get
>>a new frame or not is just a configuration setting.
>>
>>   (describe-variable 'server-window)
>>
>>I mean, the fact that things get intermixed is one goal of emacsclient
>>(the other one being fast start up).
>>
>>>>> The main problems I have noticed under these circumstances is that 'C- 
>>>>> h-i'
>>>>> seems to be shared by all frames such that browsing in one frame will make
>>>>> the others to move away from their own current info page.  
>>
>>Type M-n to open a new independent info buffer.
>>And most jumping commands have a 'C-u' that jump into a new buffer.
>>      
>>    (info "(info)Create Info buffer")
>>
>>>>> And the mayor
>>>>> show stopper is ECB. It seems that I cannot have 2 emacsclients running
>>>>> their own ECB session.
>>
>>I would use one emacs by ECB and an other one for planning, taking
>>notes, etc.  You can then make emacsclient use the one you want or
>>setup only the third emacs as a server depending on your needs.
>>
>>    From the emacs info manual:
>>
>>    |    If there is more than one Emacs server running, you can specify a
>>    | server name with the `-s NAME' or `--socket-name=NAME' option to
>>    | `emacsclient'.  (This option is not supported on MS-Windows.)
>>
>>    (info "(emacs)Invoking emacsclient")
>>
>>
>
> Using emacsclient is pretty new to me -- and you seem to
> be playing some nice tricks with it.
>
> Please, could you elaborate a bit (or better, much more) on:
>
>   .  the above that you wrote.
>
>   .  your varied uses (and those of others you've seen or
>      heard of) of emacsclient (and other things like it).
>
>   .  You used the term "server".  What with the original
>      emacs-run throwing off emacs-clients that seem to
>      be NOT independent from each other -- sharing buffers,
>      etc.  For vocabulary-creation, would that make it into
>      some kind of subtype of "server"?  (Obvious to all: am
>      pretty ignorant about servers, clients, etc, which is
>      why I'm probing, to learn more.)
>
>   .  Anything else you want to say.  (With the idea that 
>      maybe RMS could munge it into extra doc for the manual
>      or tutorial or something?)

Just think of the daemon as a running program with no human
interface. Emacsclient is then merely a "front end" which displays data
the daemon marshals.. Perhaps you could think of the emacs "server" as
the world wide web and your emacsclient as the browser. If you have two
clients open (web browsers) and the web site changes then both browsers
will show that when you refresh them. Ditto with emacsclient looking at
the emacs process buffers. Not the best analogy but there is oodles out
there in google land about servers and clients.

http://emacs-fu.blogspot.com/2009/02/emacs-daemon.html

The benefits should be self evident: start an emacs process ONCE and
connect to it anytime with negligible start up time - the server is
already started and your emacsclient start is just about instantaneous.

Because the server does not care about the front end too much you can
have different front ends. e.g I have a text mode emacsclient
(emacsclient -nw) running in a linux "screen" session. In addition I
have a hot key set up to fire up an emacsclient on my X desktop. Want to
read my email?  I hit a hot key and the emacsclient is there in a
millisecond and I switch to my gnus buffer. Gnus was already open. No
start time for that either. I thien quite the client or disconnect from
my screen session and emacs server is still there : I can come back to
it later. No screen real estate used. I can keep an emacs server running
on my main development machine and then ssh into it from the other side
of the world and have a fully functioning emacsclient running using
either X or in text mode accessing all my details at my home machine.

Similarly I use it for handling mailto URLs in firefox. See here:

http://www.emacswiki.org/emacs/MailtoHandler#toc4

Particular worthy of being singled out is this line which many people
overlooked when it was added (me included) from earlier emacs server
days :-

emacsclient --alternate-editor="" -c

This will start the server if its not already started and *then* connect
the emacsclient to it.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]