emacs-devel
[Top][All Lists]
Advanced

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

Re: How to get "emacsclient --eval x" to DWIM when Emacs is not started


From: Lennart Borgman (gmail)
Subject: Re: How to get "emacsclient --eval x" to DWIM when Emacs is not started
Date: Mon, 31 Mar 2008 00:55:29 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Stefan Monnier wrote:
How can I get "emacsclient --eval x" to DWIM when Emacs is not
started? I have tried the following:

emacsclient -e '(message "Hello!")' -a emacs

But that does not work. What happens is that Emacs, when started as
the alternate editor, tries to open a file with the name ''(message
"Hello!").

For normal operation, i.e. not using --eval but just for opening a
file, -a emacs works well and does what I expect. Why does not --eval
do the same? I have, of course, (server-start) in my .emacs file.

As far as I can see, the manual does not mention this case.

You can always try the patches I use for w32. It works fine for cases like
the above though you just write something like

  emacsclient -e "(message \"hello\")"

I think it would be a good change for emacsclient to auto-start an Emacs
server if the server is not running yet.

I have not followed closely your work on this (other than knowing it
exists), so maybe if you can take your current code, bring it down to
the simplest/cleanest patch (ignore everything that can be added
later), we can start discussing it (in a new thread).


I hoped that Juanma should find some time to cooperate on this. I have restructured the code, it is not the best one can find, but the restructuring should help to understand what news it brings (I have moved the GUI part to separate files and only have some "hooks" to it in emacsclient.c).

Juanma, I think that it would be best to do some more restructuring off the list just to avoid unnecessary noise. What do you think?

Anyone else interested in taking part please mail me.




reply via email to

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