all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* debug connecting to emacsclient
@ 2009-01-17 15:02 Harry Putnam
  2009-01-17 15:44 ` Sven Bretfeld
       [not found] ` <mailman.5122.1232207060.26697.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Harry Putnam @ 2009-01-17 15:02 UTC (permalink / raw)
  To: help-gnu-emacs

I've never used emacsclient but since emacs-23 makes it easier to
connect to a running gnus session, I thought I'd try it out.

I have a `(server-start)' line in .emacs and I see the server start.
when I start emacs on local host.

However when I ssh in from remote host and say emacsclient ~/myfile

I get an interminable message `waiting for emacs....'

I see no obvious way to debug this. 





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: debug connecting to emacsclient
       [not found] <mailman.5120.1232204586.26697.help-gnu-emacs@gnu.org>
@ 2009-01-17 15:43 ` Richard Riley
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Riley @ 2009-01-17 15:43 UTC (permalink / raw)
  To: help-gnu-emacs


Harry Putnam <reader@newsguy.com> writes:

> I've never used emacsclient but since emacs-23 makes it easier to
> connect to a running gnus session, I thought I'd try it out.
>
> I have a `(server-start)' line in .emacs and I see the server start.
> when I start emacs on local host.
>
> However when I ssh in from remote host and say emacsclient ~/myfile
>
> I get an interminable message `waiting for emacs....'
>
> I see no obvious way to debug this. 

I use cvs emacs 23 like this all the time.

Did you try specifically emacsclient -c (need x forwarding) or -t?


-- 
 important and urgent problems of the technology of today are no longer the satisfactions of the primary needs or of archetypal wishes, but the reparation of the evils and damages by the technology of yesterday.  ~Dennis Gabor, Innovations:  Scientific, Technological and Social, 1970


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: debug connecting to emacsclient
  2009-01-17 15:02 Harry Putnam
@ 2009-01-17 15:44 ` Sven Bretfeld
  2009-01-17 16:03   ` Sven Bretfeld
                     ` (2 more replies)
       [not found] ` <mailman.5122.1232207060.26697.help-gnu-emacs@gnu.org>
  1 sibling, 3 replies; 7+ messages in thread
From: Sven Bretfeld @ 2009-01-17 15:44 UTC (permalink / raw)
  To: help-gnu-emacs

Hello Harry

Harry Putnam <reader@newsguy.com> writes:

> However when I ssh in from remote host and say emacsclient ~/myfile

That's not correct. You have to specify an additional parameter. If you
connect via ssh (thus in a shell), you have to type 'emacsclient -t'. If
you have a graphical environment, you have to type 'emacsclient -c'.
There is no need to specify a file. 

> I get an interminable message `waiting for emacs....'

Do you have more than one Emacs version installed? If you are, for
example, under Debian or Ubuntu, Emacs 23 will probably come from the
emacs-snapshot package. If you, then, type 'emacsclient -c' you will
invoke the client of Emacs 22. But Emacs 22 has no server running, so
the client waits for ever. You can do two things:

a) Make a symbolic link from /usr/bin/emacs to the emacs-snapshot
flavor, or

b) invoke the client with 'emacsclient.emacs-snapshot -c'

An additional hint: You should consider to run emacs as a daemon. I have
the following entry in my startup menu under GNOME: 'emacs-snapshot
--daemon'. This starts Emacs in the background right after the system
comes up. If I need Emacs, I always start a client: F2
'emacsclient.emacs-snapshot -c' (of course I have an icon for this). The
advantage is, that the client starts within one second. You can close it
without losing your buffers. Gnus remains open and everything else too.
MultiTTY is wonderful. For example, I have defined a Key that opens a
client with a small framesize. Whenever I find an interesting book in
the internet, I invoke this small client right next to the browser and
quickly hack the data into my bib-file, which is already open in the
daemon instance. 

Hope that helps,

Sven




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: debug connecting to emacsclient
       [not found] ` <mailman.5122.1232207060.26697.help-gnu-emacs@gnu.org>
@ 2009-01-17 15:47   ` Richard Riley
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Riley @ 2009-01-17 15:47 UTC (permalink / raw)
  To: help-gnu-emacs

"Sven Bretfeld" <sven.bretfeld@gmx.ch> writes:

> Hello Harry
>
> Harry Putnam <reader@newsguy.com> writes:
>
>> However when I ssh in from remote host and say emacsclient ~/myfile
>
> That's not correct. You have to specify an additional parameter. If you
> connect via ssh (thus in a shell), you have to type 'emacsclient -t'. If
> you have a graphical environment, you have to type 'emacsclient -c'.
> There is no need to specify a file. 

Actually you don't. "emacsclient file" defaults to "emacsclient -t" on
my ssh session. I dont know if thats some old config I have lying around
but it works regardless.


-- 
 important and urgent problems of the technology of today are no longer the satisfactions of the primary needs or of archetypal wishes, but the reparation of the evils and damages by the technology of yesterday.  ~Dennis Gabor, Innovations:  Scientific, Technological and Social, 1970


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: debug connecting to emacsclient
  2009-01-17 15:44 ` Sven Bretfeld
@ 2009-01-17 16:03   ` Sven Bretfeld
  2009-01-17 19:26   ` Harry Putnam
  2009-01-17 19:48   ` Harry Putnam
  2 siblings, 0 replies; 7+ messages in thread
From: Sven Bretfeld @ 2009-01-17 16:03 UTC (permalink / raw)
  To: help-gnu-emacs

"Sven Bretfeld" <sven.bretfeld@gmx.ch> writes:

> a) Make a symbolic link from /usr/bin/emacs to the emacs-snapshot
> flavor, or

/usr/bin/emacsclient of course.

Greetings

Sven




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: debug connecting to emacsclient
  2009-01-17 15:44 ` Sven Bretfeld
  2009-01-17 16:03   ` Sven Bretfeld
@ 2009-01-17 19:26   ` Harry Putnam
  2009-01-17 19:48   ` Harry Putnam
  2 siblings, 0 replies; 7+ messages in thread
From: Harry Putnam @ 2009-01-17 19:26 UTC (permalink / raw)
  To: help-gnu-emacs

"Sven Bretfeld" <sven.bretfeld@gmx.ch> writes:

> Hello Harry
>
> Harry Putnam <reader@newsguy.com> writes:
>
>> However when I ssh in from remote host and say emacsclient ~/myfile
>
> That's not correct. You have to specify an additional parameter. If you
> connect via ssh (thus in a shell), you have to type 'emacsclient -t'. If
> you have a graphical environment, you have to type 'emacsclient -c'.
> There is no need to specify a file. 
>
>> I get an interminable message `waiting for emacs....'

Apparently the emacs manual disagrees with you:

=====     *     =====     *     =====     *     =====
 
(emacs)Top:: > *Note Emacs Server:: > Invoking emacsclient

42.1 Invoking `emacsclient'
===========================

The simplest way to use the `emacsclient' program is to run the shell
command `emacsclient FILE', where FILE is a file name.  This connects
to an Emacs server, and tells that Emacs process to visit FILE in one
of its existing frames--either a graphical frame, or one in a text-only
terminal (*note Frames::).  You can then select that frame to begin
editing.
[...]
=====     *     =====     *     =====     *     =====

However I find what the manual says is not accurate in my case.
Following the suggestion of -c or -t... if I call 
`emacsclient -c file'  It does work.
`emacsclient -c ' works just as well and opens emacs.

So I initially read the info manual above which indicates one should
call `emacsclient file'  but when I do I just get the ..`waiting'.. 
that never ends.

Having changed nothing on the server side... I see `emacsclient -c'
does exactly what I expected.... thanks.

Perhaps that is a bug in the documentation.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: debug connecting to emacsclient
  2009-01-17 15:44 ` Sven Bretfeld
  2009-01-17 16:03   ` Sven Bretfeld
  2009-01-17 19:26   ` Harry Putnam
@ 2009-01-17 19:48   ` Harry Putnam
  2 siblings, 0 replies; 7+ messages in thread
From: Harry Putnam @ 2009-01-17 19:48 UTC (permalink / raw)
  To: help-gnu-emacs

"Sven Bretfeld" <sven.bretfeld@gmx.ch> writes:

> Do you have more than one Emacs version installed? If you are, for
> example, under Debian or Ubuntu, Emacs 23 will probably come from the
> emacs-snapshot package. If you, then, type 'emacsclient -c' you will
> invoke the client of Emacs 22. But Emacs 22 has no server running, so
> the client waits for ever. You can do two things:

Yes, but that is handled for gentoo users by eselect which targets one 
version.  So that isn't a problem.

But In another post I mentioned that Svens advice for -c -t was right
on the money inspite of what the emacsclient manual says.

I'm starting to like Svens idea about backgrounding a daemon too.

I've run into a problem about starting the server.  I've found that
following the advice of the emacs info on emacsclient, to put
(open-server) in .emacs leads to a problem.

Every time I start emacs it starts a new server so if I have started
more than one and turned it back off, it seems to make impossible to
connect to the remaining emacs server.  Or maybe it gets stopped when
another emacs starts or something.

My usage of emacs has always been to start an emacs when ever I feel
the need... turning some of them off when done but usually leaving a
session of emacs running gnus.  That is usually what I want to connect
to when I ssh in remotely.  But if I started another emacs in the
meantime I'll connect to it instead.  Or if I started and stopped
another emacs I won't be able to connect to emacs at all.

So it seems there should be some info about that being a problem.
Maybe some example code that will recognize that a server is running
and not start another one.  

All though I wouldn't expect this in the manual, in my case
something like predicating starting a server on whether 
  `ps wwaux|grep [g]nus' 
shows an emacs running gnus already would be useful.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-01-17 19:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.5120.1232204586.26697.help-gnu-emacs@gnu.org>
2009-01-17 15:43 ` debug connecting to emacsclient Richard Riley
2009-01-17 15:02 Harry Putnam
2009-01-17 15:44 ` Sven Bretfeld
2009-01-17 16:03   ` Sven Bretfeld
2009-01-17 19:26   ` Harry Putnam
2009-01-17 19:48   ` Harry Putnam
     [not found] ` <mailman.5122.1232207060.26697.help-gnu-emacs@gnu.org>
2009-01-17 15:47   ` Richard Riley

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.