all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Davide Masserut via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Stefan Kangas <stefankangas@gmail.com>,
	65509@debbugs.gnu.org
Subject: bug#65509: [PATCH] Use correct env var when opening frames with freedesktop menu entries
Date: Tue, 05 Sep 2023 16:46:30 +0200	[thread overview]
Message-ID: <87il8oodrm.fsf@mssdvd.com> (raw)
In-Reply-To: <87edjekc1k.fsf@yahoo.com>


Po Lu <luangruo@yahoo.com> writes:

> Davide Masserut <dm@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.





  reply	other threads:[~2023-09-05 14:46 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 18:32 bug#65509: [PATCH] Use correct env var when opening frames with freedesktop menu entries Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-31  9:34 ` Eli Zaretskii
2023-08-31 11:32   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-01 18:43     ` Stefan Kangas
2023-09-01 19:04       ` Eli Zaretskii
2023-09-02 16:24         ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02 16:58           ` Eli Zaretskii
2023-09-03  0:59             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03  5:34               ` Eli Zaretskii
2023-09-03  6:07                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 12:13                   ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 12:41                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 12:48                       ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 12:51                       ` Stefan Kangas
2023-09-03 13:00                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 13:31                           ` Stefan Kangas
2023-09-03 13:42                           ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04  0:38                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-05 14:46                               ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-09-06  0:07                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-06 14:01                                   ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07  8:26                                     ` Eli Zaretskii
2023-09-07  9:26                                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07  9:37                                         ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 15:49                                         ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-15  7:05                                           ` Eli Zaretskii
2023-09-15  7:12                                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-15  7:32                                               ` Eli Zaretskii
2023-09-15  7:44                                                 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-15 11:34                                                   ` 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

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

  git send-email \
    --in-reply-to=87il8oodrm.fsf@mssdvd.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65509@debbugs.gnu.org \
    --cc=dm@mssdvd.com \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=stefankangas@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.