From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67628: Emacs 29.1: (x-open-connection (getenv "DISPLAY")) gets "Display :0.0 does not exist" error Date: Tue, 05 Dec 2023 20:37:00 +0800 Message-ID: <87edg0omfn.fsf@yahoo.com> References: <20231204193138.3bb398b8@Elitebook> <83il5d683k.fsf@gnu.org> <20231205004405.3fc7190e@Elitebook> <83a5qo6dce.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22143"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Herman , 67628@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 05 13:38:10 2023 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 1rAUgj-0005Zc-4O for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Dec 2023 13:38:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAUgT-0008Uh-Tb; Tue, 05 Dec 2023 07:37:53 -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 1rAUgR-0008UK-0L for bug-gnu-emacs@gnu.org; Tue, 05 Dec 2023 07:37:51 -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 1rAUgQ-00087q-KG for bug-gnu-emacs@gnu.org; Tue, 05 Dec 2023 07:37:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rAUgb-0002Ja-MP for bug-gnu-emacs@gnu.org; Tue, 05 Dec 2023 07:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Dec 2023 12:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67628 X-GNU-PR-Package: emacs Original-Received: via spool by 67628-submit@debbugs.gnu.org id=B67628.17017798528861 (code B ref 67628); Tue, 05 Dec 2023 12:38:01 +0000 Original-Received: (at 67628) by debbugs.gnu.org; 5 Dec 2023 12:37:32 +0000 Original-Received: from localhost ([127.0.0.1]:36742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAUg8-0002Ir-2m for submit@debbugs.gnu.org; Tue, 05 Dec 2023 07:37:32 -0500 Original-Received: from sonic314-20.consmr.mail.ne1.yahoo.com ([66.163.189.146]:45310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rAUg6-0002Ib-3z for 67628@debbugs.gnu.org; Tue, 05 Dec 2023 07:37:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1701779833; bh=8+z3pOqcBYWqKt/uths04jQgOVrEixieruplmsCpyhI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=bI3j6bNS8n/6/RsLWuAk4j21aLECVrrs2vyQWQp1VO6e07NcrBlCClnDtOZV2NiSJ10JKuQ+ghF+iDDIxcj5OUYDHzFWy0PEeMicPRsxq/NcmW6BFViy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pA3CKwGCjlMRH540mB6ctjFKamUdlODWWXAyT 7f.M5sQkNyxkFUfN6uT_KR6HvlYVGpav5c40.Gbhm8htbfvjSbomGjlktvUfArOubZe9YLRG.kLe fcL9kaQsqG8jzfPMqyfjAY1Ce4ySIzBJPtJSj3.plckGCdBbO__LPMlbCQFHeTysAfZ_1L9dj_bU AopWvbbznz_wAN218MpI8DHeLN8iu2pG0lZkBO6EFydt52LXRUQkj2y_y2i3XAHXql7W8k.19Kts _io4c_qqUrM7wTi7yh8aTkLJ3Y4ZZD.9Ki3OKhkfDTb.ye44PbhR6Qb_8jFav28stJBRuauLllgZ ntj4Cjsdh4eKQPeFmZKMPLh2VEkw0hxGziGOgigYFl0GK3YLTg0M_QMmvx9avs1p28LZkzQfdIqj fwmf0kp.w223VRcqT7pLhkJ93Ej0606x9YobBI5Lc5Tx6_bGt9npD.uGHgWyjZQw.JyIe.BlJR9n 3H8DDDbVhx6Fi6V88EARvdyblq5C_1MEPQmNsTjsAO X-Sonic-MF: X-Sonic-ID: fdb9173c-b76e-41a8-b312-5a92b070331e Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Tue, 5 Dec 2023 12:37:13 +0000 Original-Received: by hermes--production-sg3-599557b48c-hbm6x (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 1259ead04e09c548d26e85ec13b3ea04; Tue, 05 Dec 2023 12:37:09 +0000 (UTC) In-Reply-To: <83a5qo6dce.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 05 Dec 2023 14:30:41 +0200") X-Mailer: WebService/1.1.21943 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:275566 Archived-At: Eli Zaretskii writes: >> Date: Tue, 5 Dec 2023 00:44:05 +0200 >> From: Herman >> Cc: 67628@debbugs.gnu.org >> >> On Mon, 04 Dec 2023 22:11:43 +0200 >> Eli Zaretskii wrote: >> >> > > Date: Mon, 4 Dec 2023 19:31:38 +0200 >> > > From: Herman >> > > >> > > 'x-create-frame' succeeds, but 'x-open-connection' fails with same >> > > display argument. >> > > >> > > This error "Display :0.0 does not exist" happens only, when >> > > variable 'debug-on-error' is non-nil. When 'debug-on-error' is nil, >> > > the error is not present. I.e. it works on the principle - you get >> > > what you are looking for. >> > >> > It could be that the code catches the error and proceeds, but your >> > setting debug-on-error non-nil prevents that. >> > >> > Why do you need to set debug-on-error in that case? >> >> At first I also thought that it is actually normal to catch an error when debug is enabled. I had debug turned on to look for other errors. >> >> One argument could be that in version 28.2 debug did not catch such an error when debug is enabled. Version 29.1 behaves differently. >> >> Another argument is that in the Elisp manual, in the Multiple >> terminals chapter, it is written that: "Normally, Emacs Lisp >> programs need not call 'x-open-connection' function, as >> 'make-frame-on-display' calls it automatically. The only reason for >> calling it is to check whether communication can be established with >> a given X display." >> If in 29.1 now >> $ emacs --daemon -Q >> $ emacsclient -e "(setq debug-on-error t)" >> then >> $ emacsclient -e "(make-frame-on-display (getenv \"DISPLAY\"))" >> does not give an error, i.e. the display is found >> >> but if >> $ emacs --daemon -Q >> $ emacsclient -e "(setq debug-on-error t)" >> then >> $ emacsclient -e "(x-open-connection (getenv \"DISPLAY\"))" >> gives an error, i.e. the display does not exist. > > Po Lu, any ideas or suggestions? The display is opened successfully, but the next event to arrive activates the dynamic-setting machinery that calls get-device-terminal, which signals an error in response to there being no frames on that display at the time. The sound fix is for get-device-terminal to search for the device provided within x_display_list instead of the list of live frames.