[Top][All Lists]

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

Re: emacsclientw

From: Juanma Barranquero
Subject: Re: emacsclientw
Date: Mon, 13 Nov 2006 14:31:17 +0100

On 11/13/06, dhruva <address@hidden> wrote:

I could do that if I run it from a shell or dos prompt. If I double
click on the explorer to open the file, I cannot pass that extra

Why not? How was the association to run Emacs created?

When I open multiple files 9also through ctags), it can be
rather tiresome to keep pressing 'y' to all the messages.

I think I don't follow you. What messages require you to answer 'y'?
Are you receiving messages about local variables?

Also, I am seeing a strange behavior. I associate a file extension
'.C' to run emacsclientw.exe. With no Emacs running, I double click on
a '.C' file from explorer. It launches Emacs (with the splash screen).

That's only possible if you've defined ALTERNATE_EDITOR, or passing it
with -a to emacsclient.exe...

I go to the buffer containing the file I have opened and close it and
do not see any message in the minibuffer. I double click on another
'C' file and open it. When I close the second file, I get to see the
message. This seems inconsistent.

If emacsclient.exe runs Emacs (through --alternate-editor or
ALTERNATE_EDITOR), Emacs does not necessarily start the server, and if
it does, it has no way to know the file passed on the command line
(which is what emacsclient does: run the alternate editor passing it
the rest of its command line) should be processed by server.el. In
fact, even if it did, the emacsclient.exe that started Emacs is no
longer running.

The second time, emacsclient.exe connects with the running server, so
it does wait indeed.

(In my opinion, if you're gonna use emacsclient that way, it is better
to have an always running instance of Emacs, but I digress.)

To do the "right" thing there, emacsclient should know how to run
Emacs as a subprocess, and specifically how to run it with server.el
active. I don't think that kind of intelligence belongs on

The next best thing is doing what I'm doing now: instead of running
emacs.exe, or runemacs.exe, or emacsclient.exe, I run a .BAT script
which first tries to run emacsclient, and if it fails, starts emacs
and then retries emacsclient. Unfortunately my script runs on a
proprietary CMD replacement, and I haven't yet got the time to adapt
it to CMD. I will, with time.


reply via email to

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