unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Herman <mahlamytsike@gmail.com>, 67628@debbugs.gnu.org
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	[thread overview]
Message-ID: <87edg0omfn.fsf@yahoo.com> (raw)
In-Reply-To: <83a5qo6dce.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 05 Dec 2023 14:30:41 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Tue, 5 Dec 2023 00:44:05 +0200
>> From: Herman <mahlamytsike@gmail.com>
>> Cc: 67628@debbugs.gnu.org
>> 
>> On Mon, 04 Dec 2023 22:11:43 +0200
>> Eli Zaretskii <eliz@gnu.org> wrote:
>> 
>> > > Date: Mon, 4 Dec 2023 19:31:38 +0200
>> > > From: Herman <mahlamytsike@gmail.com>
>> > > 
>> > > '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.





  reply	other threads:[~2023-12-05 12:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 17:31 bug#67628: Emacs 29.1: (x-open-connection (getenv "DISPLAY")) gets "Display :0.0 does not exist" error Herman
2023-12-04 20:11 ` Eli Zaretskii
2023-12-04 22:44   ` Herman
2023-12-05 12:30     ` Eli Zaretskii
2023-12-05 12:37       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-12-06 11:54         ` Eli Zaretskii
2023-12-06 12:21           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-06 12:38             ` Eli Zaretskii
2023-12-06 12:40               ` Eli Zaretskii
2023-12-06 12:50                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-06 13:15                   ` Eli Zaretskii
2023-12-07  1:01                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-09  9:12                       ` Eli Zaretskii
2023-12-06 12:41               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-06 13:10                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edg0omfn.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67628@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=mahlamytsike@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).