From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: emacsclientw Date: Tue, 14 Nov 2006 01:45:46 +0100 Message-ID: <455911BA.6030900@student.lu.se> References: <455859DA.5010402@gnu.org> <45587D1A.9070500@student.lu.se> <4558F7BF.8020806@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1163465172 24866 80.91.229.2 (14 Nov 2006 00:46:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Nov 2006 00:46:12 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 14 01:46:09 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GjmRE-0001Sq-2a for ged-emacs-devel@m.gmane.org; Tue, 14 Nov 2006 01:46:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjmRD-0001i4-1O for ged-emacs-devel@m.gmane.org; Mon, 13 Nov 2006 19:46:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GjmQx-0001hK-U3 for emacs-devel@gnu.org; Mon, 13 Nov 2006 19:45:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GjmQx-0001gl-BY for emacs-devel@gnu.org; Mon, 13 Nov 2006 19:45:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GjmQx-0001gi-9X for emacs-devel@gnu.org; Mon, 13 Nov 2006 19:45:51 -0500 Original-Received: from [80.76.149.213] (helo=ch-smtp02.sth.basefarm.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GjmQx-0007s7-6T for emacs-devel@gnu.org; Mon, 13 Nov 2006 19:45:51 -0500 Original-Received: from [83.254.145.24] (port=59567 helo=[192.168.123.121]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.63) (envelope-from ) id 1GjmQt-0000Cs-7s; Tue, 14 Nov 2006 01:45:47 +0100 User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) Original-To: Juanma Barranquero In-Reply-To: X-Scan-Result: No virus found in message 1GjmQt-0000Cs-7s. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1GjmQt-0000Cs-7s d6e1a1bbe653abd0446a27857cfb6e1d 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:62263 Archived-At: Juanma Barranquero wrote: > On 11/13/06, Lennart Borgman wrote: > >> Though I am unsure >> about some details ... - if setup of a network socket fails, is it then >> ok to try again later? I mean I assume that the socket setup failed >> because there was no emacs server running. Can those cases be >> recognized? > > That's one of the reasons I don't like this. emacsclient is based upon > the idea that you try to connect to Emacs, and if you can't, you just > run the alternate editor. Now, you're going to be forced to > distinguish between running the alternate editor, and running Emacs, > because they should be treated in two very different ways, and have > all sort of configuration options for the case that you run Emacs. > Unless you're thinking of getting rid of --alternate-editor, which > wouldn't be a good idea. > > It would be far easier, I think, to have a second program (let's call > it launchemacs) that does: > > 1) Run Emacs and wait until Emacs is running the server. The program > should have options to start Emacs the way the user wants (either a > config file, command line options, environmente variables, whatever) > 2) Once the seerver is running, execvp emacsclient(w?).exe with the > original arguments passed to launchemacs. > > The trick is that then you can do > > emacsclient --alternate-editor=launchemacs myfile.txt > > and you don't have to modify emacsclient *at all*. My idea is a little, little bit different. Keep --alternative-editor. Add a new option --start-timeout=[seconds]. If this new option is given then wait max that many seconds for emacs server to be available after launching --alternative-editor. Let the default for --alternative-editor be "emacs" (or "runemacs" on w32). With full path taken from emacsclient path. Doing it this way no second program is needed and it is (I hope) easy to wait for emacs server.