From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#68799: 30.0.50; emacs --fg-daemon fails silently if server-start fails Date: Tue, 13 Feb 2024 15:02:00 -0500 Message-ID: References: <865xysr17s.fsf@gnu.org> <86mss4p83n.fsf@gnu.org> <86jzn8p2px.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8387"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 68799@debbugs.gnu.org, monnier@iro.umontreal.ca, jasonr@gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 13 21:04:47 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rZz1L-0001uY-3p for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Feb 2024 21:04:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZyzw-0003dW-Nv; Tue, 13 Feb 2024 15:03:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZyzN-0002wp-Bu for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 15:02:46 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZyzM-000268-UL for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 15:02:44 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rZyze-0005L1-2X for bug-gnu-emacs@gnu.org; Tue, 13 Feb 2024 15:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Feb 2024 20:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68799 X-GNU-PR-Package: emacs Original-Received: via spool by 68799-submit@debbugs.gnu.org id=B68799.170785454720467 (code B ref 68799); Tue, 13 Feb 2024 20:03:02 +0000 Original-Received: (at 68799) by debbugs.gnu.org; 13 Feb 2024 20:02:27 +0000 Original-Received: from localhost ([127.0.0.1]:47599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZyz4-0005K3-M5 for submit@debbugs.gnu.org; Tue, 13 Feb 2024 15:02:27 -0500 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:47071) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZyz1-0005Jm-M1 for 68799@debbugs.gnu.org; Tue, 13 Feb 2024 15:02:25 -0500 In-Reply-To: <86jzn8p2px.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Feb 2024 21:46:02 +0200") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1707854520; bh=FJFYpX0DjVjR8XakJb1gvp7BmjVn4m7yMXlw4gi6hl8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=TZwprFEyLT+10zJJbTI6vDJO2oy/i/oWiMwwsQYgbcQFWHG53H+tm0UjJXPrQWM1D q2ShHuiAHxx0j8eYp9hs7CMFVajZwED42fcInUv36voc6ShoreYthIXQg/quyC2Ipv f+8WoJTkX2lGSggzXKYllOwej05VTW9GO5bjSypCNsY5d/4+wV/fJmldyjA6qnr0Kb dVQQRvXCi8vtWAVxvSSeJ/VS+WxBFi9hwWd8J6s6f0K0/adaP/ThoZi8dWgVVW8XSp eXORIAjB9H4bEZnPpiIc6h6QDOfHqPh/ebbAdChvsX1T0HDaSShX9v3Lnc6+7kZwPE s1Ib8GD6ggeDA== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279977 Archived-At: Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: 68799@debbugs.gnu.org, monnier@iro.umontreal.ca, jasonr@gnu.org >> Date: Tue, 13 Feb 2024 13:04:24 -0500 >> >> Eli Zaretskii writes: >> >> > Using DAEMON_RUNNING would mean any errors while starting the server >> > will fail to show the explicit error message about that. That's a >> > regression in my book. So I hope we can find a better solution. >> >> Could you be more specific about what would regress in this situation? >> Preferably with a step by step of something that behaves worse. > > I mean this error message: > > (let ((dn (daemonp))) > (when dn > (when (stringp dn) (setq server-name dn)) > (server-start) > (if server-process > (daemon-initialized) > (if (stringp dn) > (message > "Unable to start daemon: Emacs server named %S already running" > server-name) > (message "Unable to start the daemon.\nAnother instance of Emacs is running the server, either as daemon or interactively.\nYou can use emacsclient to connect to that Emacs process.")) > (kill-emacs 1)))) Yes. With my patch, those messages will still show in exactly the same cases. No regression. >> Currently the error message doesn't get shown at all, so I'm not clear >> what could be regressing. > > We already established why the message doesn't show: because errors in > server-start are not caught. I thought we also agreed that catching > the errors there and letting startup.el show the above error messages > is something that should be done. Yes. > I think your patch will prevent us from doing that because the code > which you suggest to patch with DAEMON_RUNNING will kill Emacs before > startup.el gets the chance to show the error message, because > daemon-initialized has not yet been run by that time. Nope, it won't prevent us from doing that. My patch affects only *uncaught* errors, and improves behavior when errors are uncaught. The separate change we will make to the code you posted is to *catch more errors*. A change to the behavior for uncaught errors doesn't interfere with us deciding to catch more errors. Defining an explicit error handler, of course, completely overrides the default handle for uncaught errors. So they're totally separate patches.