From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: bug in server-start Date: Tue, 16 Dec 2008 08:01:39 -0800 (PST) Message-ID: <200812161601.mBGG1dqw004070@mothra.ics.uci.edu> References: <18758.7352.558182.931572@kahikatea.snap.net.nz> <18758.14760.572830.277734@kahikatea.snap.net.nz> <200812151724.mBFHOSnS029425@mothra.ics.uci.edu> <18759.21210.387155.565065@a1ihome1.kph.uni-mainz.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1229443766 7573 80.91.229.12 (16 Dec 2008 16:09:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Dec 2008 16:09:26 +0000 (UTC) Cc: Ulrich Mueller , emacs-devel@gnu.org, Nick Roberts , Stefan Monnier To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 16 17:10:30 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 1LCcUc-00053N-RW for ged-emacs-devel@m.gmane.org; Tue, 16 Dec 2008 17:09:57 +0100 Original-Received: from localhost ([127.0.0.1]:50693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCcTQ-0004wC-Cy for ged-emacs-devel@m.gmane.org; Tue, 16 Dec 2008 11:08:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LCcN6-0002KY-JJ for emacs-devel@gnu.org; Tue, 16 Dec 2008 11:02:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LCcN4-0002Jb-0G for emacs-devel@gnu.org; Tue, 16 Dec 2008 11:02:08 -0500 Original-Received: from [199.232.76.173] (port=53172 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LCcN3-0002JS-Qi for emacs-devel@gnu.org; Tue, 16 Dec 2008 11:02:05 -0500 Original-Received: from barrelv2.ics.uci.edu ([128.195.1.114]:51068) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1LCcN2-0001Ce-Nt for emacs-devel@gnu.org; Tue, 16 Dec 2008 11:02:05 -0500 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by barrelv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id mBGG1dfw012926; Tue, 16 Dec 2008 08:01:39 -0800 (PST) Original-Received: (from dann@localhost) by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id mBGG1dqw004070; Tue, 16 Dec 2008 08:01:39 -0800 (PST) In-Reply-To: (Juanma Barranquero's message of "Tue, 16 Dec 2008 10:38:10 +0100") Original-Lines: 63 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: mBGG1dfw012926 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-0.34, required 5, autolearn=disabled, ALL_TRUSTED -1.44, FM_MULTI_ODD2 1.10) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:106969 Archived-At: "Juanma Barranquero" writes: > On Tue, Dec 16, 2008 at 08:03, Ulrich Mueller wrote: > > > Exit with an error, please. And if possible, the parent process should > > return a nonzero exit status. (AFAICS, not calling daemon-initialized > > should be sufficient for this, but I haven't tested it.) > > Please, try the attached patch. > > Juanma > > > > Index: lisp/server.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/server.el,v > retrieving revision 1.176 > diff -u -2 -r1.176 server.el > --- lisp/server.el 12 Dec 2008 00:33:34 -0000 1.176 > +++ lisp/server.el 16 Dec 2008 09:21:13 -0000 > @@ -480,5 +480,6 @@ > (ignore-errors (delete-file server-file)) > (setq server-mode nil) ;; already set by the minor mode code > - (error "Server %S is already running" server-name)) > + (display-warning 'server (format "Server %S is already running" server-name)) > + (setq leave-dead t)) > ;; If this Emacs already had a server, clear out associated status. > (while server-clients > @@ -487,5 +488,5 @@ > (if leave-dead > (progn > - (server-log (message "Server stopped")) > + (unless (eq t leave-dead) (server-log (message "Server stopped"))) > (setq server-process nil)) > ;; Make sure there is a safe directory in which to place the socket. > Index: lisp/startup.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/startup.el,v > retrieving revision 1.523 > diff -u -2 -r1.523 startup.el > --- lisp/startup.el 22 Nov 2008 20:44:42 -0000 1.523 > +++ lisp/startup.el 16 Dec 2008 09:22:11 -0000 > @@ -695,4 +695,5 @@ > > (defvar server-name) > +(defvar server-process) > > (defun command-line () > @@ -1221,5 +1222,8 @@ > (when (stringp dn) (setq server-name dn)) > (server-start) > - (daemon-initialized))) > + (if server-process > + (daemon-initialized) > + (message "Could not start daemon %S" server-name) This shouldn't mention the server-name name if --daemon is not passed any argument. Most users won't know, nor care about that. The same is true about the server.el error: Server "server" is already running is kind of confusing.