From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: How to get "emacsclient --eval x" to DWIM when Emacs is not started Date: Sun, 30 Mar 2008 18:49:00 -0400 Message-ID: References: <7dbe73ed0803301309t3de07534w9b86159192214e07@mail.gmail.com> <47EFF64F.7080408@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206918554 9312 80.91.229.12 (30 Mar 2008 23:09:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 23:09:14 +0000 (UTC) Cc: emacs-devel@gnu.org, Mathias Dahl To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 31 01:09:45 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 1Jg6en-0004eK-43 for ged-emacs-devel@m.gmane.org; Mon, 31 Mar 2008 01:09:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg6eB-0000kX-6J for ged-emacs-devel@m.gmane.org; Sun, 30 Mar 2008 19:09:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jg6dL-0008Sy-3V for emacs-devel@gnu.org; Sun, 30 Mar 2008 19:08:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jg6dJ-0008S3-ID for emacs-devel@gnu.org; Sun, 30 Mar 2008 19:08:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jg6dJ-0008Rx-5J for emacs-devel@gnu.org; Sun, 30 Mar 2008 19:08:13 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182] helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jg6Kx-0005qW-Qd for emacs-devel@gnu.org; Sun, 30 Mar 2008 18:49:16 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AisFAPa170fO+LLN/2dsb2JhbACBWqVT X-IronPort-AV: E=Sophos;i="4.25,579,1199682000"; d="scan'208";a="17177698" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 30 Mar 2008 18:49:01 -0400 Original-Received: from pastel.home ([206.248.178.205]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id KZB18701; Sun, 30 Mar 2008 18:49:01 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id B9BB37FDF; Sun, 30 Mar 2008 18:49:00 -0400 (EDT) In-Reply-To: <47EFF64F.7080408@gmail.com> (Lennart Borgman's message of "Sun, 30 Mar 2008 22:21:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:93984 Archived-At: >> 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). Stefan