GNU bug report logs - #65509
[PATCH] Use correct env var when opening frames with freedesktop menu entries

Previous Next

Package: emacs;

Reported by: Davide Masserut <dm <at> mssdvd.com>

Date: Thu, 24 Aug 2023 18:45:01 UTC

Severity: normal

Tags: patch

Merged with 64310

Found in version 29.0.92

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #61 received at 65509 <at> debbugs.gnu.org (full text, mbox):

From: Davide Masserut <dm <at> mssdvd.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>,
 65509 <at> debbugs.gnu.org
Subject: Re: bug#65509: [PATCH] Use correct env var when opening frames with
 freedesktop menu entries
Date: Tue, 05 Sep 2023 16:46:30 +0200
Po Lu <luangruo <at> yahoo.com> writes:

> Davide Masserut <dm <at> mssdvd.com> writes:
>
>> X DEs don't set the $WAYLAND_DISPLAY environment variable, so
>> querying for it returns an empty string.
>>
>> If I run this in X:
>>
>> emacsclient --alternate-editor= --display=$WAYLAND_DISPLAY 
>> .emacs.el
>>
>> the following occurs.
>>
>> When the --display argument is an empty string, Emacs first tries 
>> to
>> reuse an exiting frame and, if doesn't find one, it falls back to
>> open it in the same terminal.  The problem arises when an instance 
>> is
>> launched through the DE facilities: Emacs can't use a terminal as a
>> fallback and therefore it opens in the background without showing 
>> the
>> frame.
>>
>> If we decide that handling such case is not worth the trouble, an
>> error in system log should warn the user to use the X backend.
>
> I don't quite follow: if neither of the display environment 
> variables
> are present, then Emacs deduces that no display server is running,
> whereupon it resorts to displaying a TTY frame.

Correct.  However, that TTY is occupied by the X window manager, which 
hides the Emacs interface.

When the argument of --display doesn't exits or is empty, should we 
check if $DISPLAY is present in the environment and use its value?

When PGTK is enabled, we could check $WAYLAND_DISPLAY and then 
$DISPLAY before resorting to displaying the frame in a terminal or in 
a TTY.

I tested this with Gnome and i3, both started from a TTY using startx. 
I'm not sure how this behaves when using a display manager.




This bug report was last modified 1 year and 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.