From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: How to get "emacsclient --eval x" to DWIM when Emacs is not started Date: Mon, 31 Mar 2008 00:55:29 +0200 Message-ID: <47F01A61.6010508@gmail.com> References: <7dbe73ed0803301309t3de07534w9b86159192214e07@mail.gmail.com> <47EFF64F.7080408@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1206917749 6958 80.91.229.12 (30 Mar 2008 22:55:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 22:55:49 +0000 (UTC) Cc: Juanma Barranquero , emacs-devel@gnu.org, Mathias Dahl To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 31 00:56:20 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jg6Ro-0000hv-0H for ged-emacs-devel@m.gmane.org; Mon, 31 Mar 2008 00:56:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg6RC-00077N-5i for ged-emacs-devel@m.gmane.org; Sun, 30 Mar 2008 18:55:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jg6R8-00077H-T2 for emacs-devel@gnu.org; Sun, 30 Mar 2008 18:55:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jg6R6-000775-F8 for emacs-devel@gnu.org; Sun, 30 Mar 2008 18:55:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg6R6-000772-94 for emacs-devel@gnu.org; Sun, 30 Mar 2008 18:55:36 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jg6R5-0000K7-QM for emacs-devel@gnu.org; Sun, 30 Mar 2008 18:55:36 -0400 Original-Received: from c83-254-150-27.bredband.comhem.se ([83.254.150.27]:61883 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1Jg6R2-0007Wd-48; Mon, 31 Mar 2008 00:55:32 +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 In-Reply-To: X-Antivirus: avast! (VPS 080330-0, 2008-03-30), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.150.27 X-ACL-Warn: Too high rate of unknown addresses received from you X-Scan-Result: No virus found in message 1Jg6R2-0007Wd-48. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1Jg6R2-0007Wd-48 125f10c80d2463a499084a20bb6ce0a2 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:93976 Archived-At: 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.