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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65509 in the body.
You can then email your comments to 65509 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Thu, 24 Aug 2023 18:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Davide Masserut <dm <at> mssdvd.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 24 Aug 2023 18:45:02 GMT) Full text and rfc822 format available.

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

From: Davide Masserut <dm <at> mssdvd.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Use correct env var when opening frames with freedesktop menu
 entries
Date: Thu, 24 Aug 2023 20:32:47 +0200
[Message part 1 (text/plain, inline)]
Tags: patch

When Emacs is built with PGTK, frames opened with the 
emacsclient.desktop entry are opened as X11 windows instead of 
Wayland.

This patch adds a sed command to the Makefile that replaces the 
environment variable "$DISPLAY" with "$WAYLAND_DISPLAY" when built 
with PGTK.



In GNU Emacs 30.0.50 (build 32, x86_64-pc-linux-gnu, GTK+ Version
3.24.38, cairo version 1.17.8) of 2023-08-24 built on T480s
Repository revision: 3907c884f03cf5f2a09696bda015b1060c7111ba
Repository branch: master
System Description: Arch Linux

Configured using:
'configure -C --prefix /home/davide/.local --with-pgtk
--with-native-compilation --enable-link-time-optimization
--enable-locallisppath=/usr/share/emacs/site-lisp/
'CFLAGS=-march=native -O2''
[0001-Use-correct-env-var-when-opening-frames-with-freedes.patch (text/patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Thu, 31 Aug 2023 09:36:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Davide Masserut <dm <at> mssdvd.com>, Po Lu <luangruo <at> yahoo.com>
Cc: 65509 <at> debbugs.gnu.org
Subject: Re: bug#65509: [PATCH] Use correct env var when opening frames with
 freedesktop menu entries
Date: Thu, 31 Aug 2023 12:34:19 +0300
> Date: Thu, 24 Aug 2023 20:32:47 +0200
> From:  Davide Masserut via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> When Emacs is built with PGTK, frames opened with the 
> emacsclient.desktop entry are opened as X11 windows instead of 
> Wayland.
> 
> This patch adds a sed command to the Makefile that replaces the 
> environment variable "$DISPLAY" with "$WAYLAND_DISPLAY" when built 
> with PGTK.

Po Lu, any comments on this?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Thu, 31 Aug 2023 11:34:01 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Davide Masserut <dm <at> mssdvd.com>, 65509 <at> debbugs.gnu.org
Subject: Re: bug#65509: [PATCH] Use correct env var when opening frames with
 freedesktop menu entries
Date: Thu, 31 Aug 2023 19:32:38 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Thu, 24 Aug 2023 20:32:47 +0200
>> From:  Davide Masserut via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> When Emacs is built with PGTK, frames opened with the 
>> emacsclient.desktop entry are opened as X11 windows instead of 
>> Wayland.
>> 
>> This patch adds a sed command to the Makefile that replaces the 
>> environment variable "$DISPLAY" with "$WAYLAND_DISPLAY" when built 
>> with PGTK.
>
> Po Lu, any comments on this?

I think this is the fix for the bug I couldn't reproduce earlier,
bug#64310.  The patch seems appropriate, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Fri, 01 Sep 2023 18:44:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Davide Masserut <dm <at> mssdvd.com>,
 65509 <at> debbugs.gnu.org
Subject: Re: bug#65509: [PATCH] Use correct env var when opening frames with
 freedesktop menu entries
Date: Fri, 1 Sep 2023 20:43:03 +0200
forcemerge 64310 65509
thanks

Po Lu writes:

> I think this is the fix for the bug I couldn't reproduce earlier,
> bug#64310.  The patch seems appropriate, thanks.

From the previous discussion, it seems like we wanted to get this
fixed on emacs-29?

Eli, WDYT?




Forcibly Merged 64310 65509. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 01 Sep 2023 18:44:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Fri, 01 Sep 2023 19:06:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: luangruo <at> yahoo.com, dm <at> mssdvd.com, 65509 <at> debbugs.gnu.org
Subject: Re: bug#65509: [PATCH] Use correct env var when opening frames with
 freedesktop menu entries
Date: Fri, 01 Sep 2023 22:04:56 +0300
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Fri, 1 Sep 2023 20:43:03 +0200
> Cc: Eli Zaretskii <eliz <at> gnu.org>, Davide Masserut <dm <at> mssdvd.com>, 65509 <at> debbugs.gnu.org
> 
> forcemerge 64310 65509
> thanks
> 
> Po Lu writes:
> 
> > I think this is the fix for the bug I couldn't reproduce earlier,
> > bug#64310.  The patch seems appropriate, thanks.
> 
> >From the previous discussion, it seems like we wanted to get this
> fixed on emacs-29?
> 
> Eli, WDYT?

I don't know enough about these Freedesktop shortcuts to have an
opinion.  If this is installed only for the PGTK build, and you think
it solves the problem, feel free to install on emacs-29.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sat, 02 Sep 2023 16:55:02 GMT) Full text and rfc822 format available.

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

From: Davide Masserut <dm <at> mssdvd.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: luangruo <at> yahoo.com, 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: Sat, 02 Sep 2023 18:24:43 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Stefan Kangas <stefankangas <at> gmail.com>
>> Date: Fri, 1 Sep 2023 20:43:03 +0200
>> Cc: Eli Zaretskii <eliz <at> gnu.org>, Davide Masserut 
>> <dm <at> mssdvd.com>, 65509 <at> debbugs.gnu.org
>>
>> forcemerge 64310 65509
>> thanks
>>
>> Po Lu writes:
>>
>> > I think this is the fix for the bug I couldn't reproduce 
>> > earlier,
>> > bug#64310.  The patch seems appropriate, thanks.
>>
>> >From the previous discussion, it seems like we wanted to get 
>> >this
>> fixed on emacs-29?
>>
>> Eli, WDYT?
>
> I don't know enough about these Freedesktop shortcuts to have an
> opinion.  If this is installed only for the PGTK build, and you 
> think
> it solves the problem, feel free to install on emacs-29.

For the same reason that the current emacsclient.desktop doesn't 
work with Wayland, installing the patch would break PGTK builds 
under Xorg because they would look for an environment variable 
that is not set by Xorg DEs.  Sorry, I've just noticed it.

We could choose to always open a new frame instead of reusing 
exiting ones. How does Emacs behave on other operating systems?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sat, 02 Sep 2023 17:00:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Davide Masserut <dm <at> mssdvd.com>
Cc: luangruo <at> yahoo.com, 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: Sat, 02 Sep 2023 19:58:57 +0300
> From: Davide Masserut <dm <at> mssdvd.com>
> Cc: Stefan Kangas <stefankangas <at> gmail.com>, luangruo <at> yahoo.com,
>  65509 <at> debbugs.gnu.org
> Date: Sat, 02 Sep 2023 18:24:43 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> Po Lu writes:
> >>
> >> > I think this is the fix for the bug I couldn't reproduce
> >> > earlier, bug#64310.  The patch seems appropriate, thanks.
> >>
> >> >From the previous discussion, it seems like we wanted to get
> >> >this fixed on emacs-29?
> >>
> >> Eli, WDYT?
> >
> > I don't know enough about these Freedesktop shortcuts to have an
> > opinion.  If this is installed only for the PGTK build, and you 
> > think
> > it solves the problem, feel free to install on emacs-29.
> 
> For the same reason that the current emacsclient.desktop doesn't 
> work with Wayland, installing the patch would break PGTK builds 
> under Xorg because they would look for an environment variable 
> that is not set by Xorg DEs.  Sorry, I've just noticed it.

Can you describe the issue in more detail?  In particular, would it
work to try several variables one after another?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 01:00:02 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Davide Masserut <dm <at> mssdvd.com>, 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: Sun, 03 Sep 2023 08:59:04 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> For the same reason that the current emacsclient.desktop doesn't 
>> work with Wayland, installing the patch would break PGTK builds 
>> under Xorg because they would look for an environment variable 
>> that is not set by Xorg DEs.  Sorry, I've just noticed it.
>
> Can you describe the issue in more detail?  In particular, would it
> work to try several variables one after another?

PGTK builds don't support X anyway, so this is a nonproblem.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 05:35:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: dm <at> mssdvd.com, 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: Sun, 03 Sep 2023 08:34:21 +0300
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: Davide Masserut <dm <at> mssdvd.com>,  stefankangas <at> gmail.com,
>   65509 <at> debbugs.gnu.org
> Date: Sun, 03 Sep 2023 08:59:04 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> For the same reason that the current emacsclient.desktop doesn't 
> >> work with Wayland, installing the patch would break PGTK builds 
> >> under Xorg because they would look for an environment variable 
> >> that is not set by Xorg DEs.  Sorry, I've just noticed it.
> >
> > Can you describe the issue in more detail?  In particular, would it
> > work to try several variables one after another?
> 
> PGTK builds don't support X anyway, so this is a nonproblem.

Not sure I understand: you are saying we should install the patch and
stop worrying about breaking some other configuration?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 06:08:01 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dm <at> mssdvd.com, 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: Sun, 03 Sep 2023 14:07:28 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> Not sure I understand: you are saying we should install the patch and
> stop worrying about breaking some other configuration?

Yes, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 12:31:01 GMT) Full text and rfc822 format available.

Message #37 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>, 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: Sun, 03 Sep 2023 14:13:02 +0200
Po Lu <luangruo <at> yahoo.com> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> Not sure I understand: you are saying we should install the 
>> patch and
>> stop worrying about breaking some other configuration?
>
> Yes, thanks.

I think we should print to stderr the warning that appears when a 
PGTK frame is opened in X.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 12:43:02 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Davide Masserut <dm <at> mssdvd.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 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: Sun, 03 Sep 2023 20:41:52 +0800
Davide Masserut <dm <at> mssdvd.com> writes:

> I think we should print to stderr the warning that appears when a PGTK
> frame is opened in X.

Why?  It's not as intrusive as displaying the warning in a window, and
we want it to be as effective as possible at deterring people from that
configuration.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 12:51:02 GMT) Full text and rfc822 format available.

Message #43 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>, 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: Sun, 03 Sep 2023 14:48:16 +0200
Po Lu <luangruo <at> yahoo.com> writes:

> Davide Masserut <dm <at> mssdvd.com> writes:
>
>> I think we should print to stderr the warning that appears when 
>> a PGTK
>> frame is opened in X.
>
> Why?  It's not as intrusive as displaying the warning in a 
> window, and
> we want it to be as effective as possible at deterring people 
> from that
> configuration.

Sorry, I meant we should *also* print the warning to stderr.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 12:52:02 GMT) Full text and rfc822 format available.

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

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

> Davide Masserut <dm <at> mssdvd.com> writes:
>
>> I think we should print to stderr the warning that appears when a PGTK
>> frame is opened in X.
>
> Why?  It's not as intrusive as displaying the warning in a window, and
> we want it to be as effective as possible at deterring people from that
> configuration.

Not sure it's worth doing, but one option is to do both.  Users that
miss one would see the other.

BTW, if it's unsupported, should we even show a PGTK frame on X?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 13:02:02 GMT) Full text and rfc822 format available.

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

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

> Not sure it's worth doing, but one option is to do both.  Users that
> miss one would see the other.

I won't object to such a change, though I cannot claim to understand the
rationale behind it.  (Who would see the message printed to stderr, but
not the dialog displayed, during connection setup?)

> BTW, if it's unsupported, should we even show a PGTK frame on X?

It's still useful for testing purposes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 13:33:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Davide Masserut <dm <at> mssdvd.com>,
 65509 <at> debbugs.gnu.org
Subject: Re: bug#65509: [PATCH] Use correct env var when opening frames with
 freedesktop menu entries
Date: Sun, 3 Sep 2023 06:31:42 -0700
Po Lu <luangruo <at> yahoo.com> writes:

>> BTW, if it's unsupported, should we even show a PGTK frame on X?
>
> It's still useful for testing purposes.

Aha, right.  I believe you already said so in the past.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Sun, 03 Sep 2023 14:10:02 GMT) Full text and rfc822 format available.

Message #55 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: Sun, 03 Sep 2023 15:42:44 +0200
Po Lu <luangruo <at> yahoo.com> writes:

> Stefan Kangas <stefankangas <at> gmail.com> writes:
>
>> Not sure it's worth doing, but one option is to do both.  Users 
>> that
>> miss one would see the other.
>
> I won't object to such a change, though I cannot claim to 
> understand the
> rationale behind it.  (Who would see the message printed to 
> stderr, but
> not the dialog displayed, during connection setup?)

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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Mon, 04 Sep 2023 00:39:02 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Davide Masserut <dm <at> mssdvd.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: Mon, 04 Sep 2023 08:38:31 +0800
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.  We do support TTY
frames under PGTK, so such a warning would be purposeless.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Tue, 05 Sep 2023 15:13:02 GMT) Full text and rfc822 format available.

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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Wed, 06 Sep 2023 00:08:02 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Davide Masserut <dm <at> mssdvd.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: Wed, 06 Sep 2023 08:07:22 +0800
Davide Masserut <dm <at> mssdvd.com> writes:

> 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.

Display selection is GTK's territory, and we basically give it carte
blanche to judge which displays are suitable, since we can't account for
every present and future GDK backend.

Only subsequent to the establishment of the display connection are we
capable of taking display-specific action, such as displaying a warning
message.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Wed, 06 Sep 2023 14:14:01 GMT) Full text and rfc822 format available.

Message #67 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: Wed, 06 Sep 2023 16:01:58 +0200
[Message part 1 (text/plain, inline)]
Po Lu <luangruo <at> yahoo.com> writes:

> Davide Masserut <dm <at> mssdvd.com> writes:
>
>> 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.
>
> Display selection is GTK's territory, and we basically give it carte
> blanche to judge which displays are suitable, since we can't account
> for every present and future GDK backend.
>
> Only subsequent to the establishment of the display connection are we
> capable of taking display-specific action, such as displaying a
> warning message.

It turns out that Emacs 29 has new CLI option that solves exactly these problems.

The attached patch replaces the usage of --display=$DISPLAY with --reuse-frame.

[0001-Avoid-using-display-to-reuse-frames.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Thu, 07 Sep 2023 08:28:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: luangruo <at> yahoo.com, Davide Masserut <dm <at> mssdvd.com>
Cc: 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: Thu, 07 Sep 2023 11:26:38 +0300
> From: Davide Masserut <dm <at> mssdvd.com>
> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
>  65509 <at> debbugs.gnu.org
> Date: Wed, 06 Sep 2023 16:01:58 +0200
> 
> It turns out that Emacs 29 has new CLI option that solves exactly these problems.
> 
> The attached patch replaces the usage of --display=$DISPLAY with --reuse-frame.

Po Lu, any objections to installing this on emacs-29?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Thu, 07 Sep 2023 09:28:02 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Davide Masserut <dm <at> mssdvd.com>, 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: Thu, 07 Sep 2023 17:26:47 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Davide Masserut <dm <at> mssdvd.com>
>> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
>>  65509 <at> debbugs.gnu.org
>> Date: Wed, 06 Sep 2023 16:01:58 +0200
>> 
>> It turns out that Emacs 29 has new CLI option that solves exactly these problems.
>> 
>> The attached patch replaces the usage of --display=$DISPLAY with --reuse-frame.
>
> Po Lu, any objections to installing this on emacs-29?

Yes.  Davide, would you please rewrite the patch so that your change is
only applied to the PGTK port?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Thu, 07 Sep 2023 09:41:01 GMT) Full text and rfc822 format available.

Message #76 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>, 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: Thu, 07 Sep 2023 11:37:02 +0200
Po Lu <luangruo <at> yahoo.com> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Davide Masserut <dm <at> mssdvd.com> Cc: Stefan Kangas
>>> <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
>>>  65509 <at> debbugs.gnu.org Date: Wed, 06 Sep 2023 16:01:58 +0200
>>>
>>> It turns out that Emacs 29 has new CLI option that solves exactly
>>> these problems.
>>>
>>> The attached patch replaces the usage of --display=$DISPLAY with
>>> --reuse-frame.
>>
>> Po Lu, any objections to installing this on emacs-29?
>
> Yes.  Davide, would you please rewrite the patch so that your change
> is only applied to the PGTK port?

Sure.  Is there any risk regarding multi-user setups or something like that?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Fri, 08 Sep 2023 15:51:02 GMT) Full text and rfc822 format available.

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

From: Davide Masserut <dm <at> mssdvd.com>
To: Po Lu <luangruo <at> yahoo.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 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: Fri, 08 Sep 2023 17:49:43 +0200
[Message part 1 (text/plain, inline)]
Po Lu <luangruo <at> yahoo.com> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> From: Davide Masserut <dm <at> mssdvd.com>
>>> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
>>>  65509 <at> debbugs.gnu.org
>>> Date: Wed, 06 Sep 2023 16:01:58 +0200
>>> 
>>> It turns out that Emacs 29 has new CLI option that solves exactly these problems.
>>> 
>>> The attached patch replaces the usage of --display=$DISPLAY with --reuse-frame.
>>
>> Po Lu, any objections to installing this on emacs-29?
>
> Yes.  Davide, would you please rewrite the patch so that your change is
> only applied to the PGTK port?

Done.  Po, why can't we use --reuse-frame in X builds?

[0001-Avoid-using-display-to-reuse-frames-in-PGTK.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Fri, 15 Sep 2023 07:06:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: luangruo <at> yahoo.com, Davide Masserut <dm <at> mssdvd.com>
Cc: 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: Fri, 15 Sep 2023 10:05:16 +0300
Ping!  Po Lu, could you please respond?

> From: Davide Masserut <dm <at> mssdvd.com>
> Cc: stefankangas <at> gmail.com, 65509 <at> debbugs.gnu.org
> Date: Fri, 08 Sep 2023 17:49:43 +0200
> 
> 
> Po Lu <luangruo <at> yahoo.com> writes:
> 
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >
> >>> From: Davide Masserut <dm <at> mssdvd.com>
> >>> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
> >>>  65509 <at> debbugs.gnu.org
> >>> Date: Wed, 06 Sep 2023 16:01:58 +0200
> >>> 
> >>> It turns out that Emacs 29 has new CLI option that solves exactly these problems.
> >>> 
> >>> The attached patch replaces the usage of --display=$DISPLAY with --reuse-frame.
> >>
> >> Po Lu, any objections to installing this on emacs-29?
> >
> > Yes.  Davide, would you please rewrite the patch so that your change is
> > only applied to the PGTK port?
> 
> Done.  Po, why can't we use --reuse-frame in X builds?
> 
> 
> >From 43085522a08b94ef594bd270d61a38d7bb26e036 Mon Sep 17 00:00:00 2001
> From: Davide Masserut <dm <at> mssdvd.com>
> Date: Thu, 24 Aug 2023 18:33:39 +0200
> Subject: [PATCH] Avoid using --display to reuse frames in PGTK
> 
> Using hard-coded display values can cause PGTK graphical frames to
> open using the wrong backend or not open at all.
> 
> * Makefile.in (install-etc): Use --reuse-frame instead of
> --display=$DISPLAY.
> ---
>  Makefile.in | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Makefile.in b/Makefile.in
> index fdd9353e254..c82aad1af60 100644
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -843,6 +843,9 @@ EMACS_ICON=
>  ifeq (${USE_STARTUP_NOTIFICATION},no)
>  USE_STARTUP_NOTIFICATION_SED_CMD=-e "/^StartupNotify=true$$/d"
>  endif
> +ifeq ($(HAVE_PGTK),yes)
> +USE_WAYLAND_DISPLAY_SED_CMD=-e "s/display=[^ ]*/reuse-frame/"
> +endif
>  install-etc:
>  	umask 022; ${MKDIR_P} "$(DESTDIR)${desktopdir}"
>  	tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \
> @@ -857,6 +860,7 @@ install-etc:
>  	sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \
>  	  -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
>  	  $(USE_STARTUP_NOTIFICATION_SED_CMD) \
> +	  $(USE_WAYLAND_DISPLAY_SED_CMD) \
>  	  ${srcdir}/etc/emacsclient.desktop > $${tmp}; \
>  	${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}.desktop"; \
>  	rm -f $${tmp}
> @@ -870,6 +874,7 @@ install-etc:
>  	client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
>  	sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \
>  	  -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
> +	  $(USE_WAYLAND_DISPLAY_SED_CMD) \
>  	  ${srcdir}/etc/emacsclient-mail.desktop > $${tmp}; \
>  	${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}-mail.desktop"; \
>  	rm -f $${tmp}
> -- 
> 2.42.0
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Fri, 15 Sep 2023 07:13:02 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Davide Masserut <dm <at> mssdvd.com>, 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: Fri, 15 Sep 2023 15:12:16 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> Ping!  Po Lu, could you please respond?
>
>> From: Davide Masserut <dm <at> mssdvd.com>
>> Cc: stefankangas <at> gmail.com, 65509 <at> debbugs.gnu.org
>> Date: Fri, 08 Sep 2023 17:49:43 +0200
>> 
>> 
>> Po Lu <luangruo <at> yahoo.com> writes:
>> 
>> > Eli Zaretskii <eliz <at> gnu.org> writes:
>> >
>> >>> From: Davide Masserut <dm <at> mssdvd.com>
>> >>> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
>> >>>  65509 <at> debbugs.gnu.org
>> >>> Date: Wed, 06 Sep 2023 16:01:58 +0200
>> >>> 
>> >>> It turns out that Emacs 29 has new CLI option that solves exactly these problems.
>> >>> 
>> >>> The attached patch replaces the usage of --display=$DISPLAY with --reuse-frame.
>> >>
>> >> Po Lu, any objections to installing this on emacs-29?
>> >
>> > Yes.  Davide, would you please rewrite the patch so that your change is
>> > only applied to the PGTK port?
>> 
>> Done.  Po, why can't we use --reuse-frame in X builds?
>> 
>> 
>> >From 43085522a08b94ef594bd270d61a38d7bb26e036 Mon Sep 17 00:00:00 2001
>> From: Davide Masserut <dm <at> mssdvd.com>
>> Date: Thu, 24 Aug 2023 18:33:39 +0200
>> Subject: [PATCH] Avoid using --display to reuse frames in PGTK
>> 
>> Using hard-coded display values can cause PGTK graphical frames to
>> open using the wrong backend or not open at all.
>> 
>> * Makefile.in (install-etc): Use --reuse-frame instead of
>> --display=$DISPLAY.
>> ---
>>  Makefile.in | 5 +++++
>>  1 file changed, 5 insertions(+)
>> 
>> diff --git a/Makefile.in b/Makefile.in
>> index fdd9353e254..c82aad1af60 100644
>> --- a/Makefile.in
>> +++ b/Makefile.in
>> @@ -843,6 +843,9 @@ EMACS_ICON=
>>  ifeq (${USE_STARTUP_NOTIFICATION},no)
>>  USE_STARTUP_NOTIFICATION_SED_CMD=-e "/^StartupNotify=true$$/d"
>>  endif
>> +ifeq ($(HAVE_PGTK),yes)
>> +USE_WAYLAND_DISPLAY_SED_CMD=-e "s/display=[^ ]*/reuse-frame/"
>> +endif
>>  install-etc:
>>  	umask 022; ${MKDIR_P} "$(DESTDIR)${desktopdir}"
>>  	tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \
>> @@ -857,6 +860,7 @@ install-etc:
>>  	sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \
>>  	  -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
>>  	  $(USE_STARTUP_NOTIFICATION_SED_CMD) \
>> +	  $(USE_WAYLAND_DISPLAY_SED_CMD) \
>>  	  ${srcdir}/etc/emacsclient.desktop > $${tmp}; \
>>  	${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}.desktop"; \
>>  	rm -f $${tmp}
>> @@ -870,6 +874,7 @@ install-etc:
>>  	client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
>>  	sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \
>>  	  -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
>> +	  $(USE_WAYLAND_DISPLAY_SED_CMD) \
>>  	  ${srcdir}/etc/emacsclient-mail.desktop > $${tmp}; \
>>  	${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}-mail.desktop"; \
>>  	rm -f $${tmp}
>> -- 
>> 2.42.0
>> 

That was lost in the spam filter.  I'd rather not use --reuse-frame
under the X build, because that's not safe for Emacs 29.

This LGTM now.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Fri, 15 Sep 2023 07:33:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: dm <at> mssdvd.com, 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: Fri, 15 Sep 2023 10:32:29 +0300
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: Davide Masserut <dm <at> mssdvd.com>,  stefankangas <at> gmail.com,
>   65509 <at> debbugs.gnu.org
> Date: Fri, 15 Sep 2023 15:12:16 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Ping!  Po Lu, could you please respond?
> >
> >> From: Davide Masserut <dm <at> mssdvd.com>
> >> Cc: stefankangas <at> gmail.com, 65509 <at> debbugs.gnu.org
> >> Date: Fri, 08 Sep 2023 17:49:43 +0200
> >> 
> >> 
> >> Po Lu <luangruo <at> yahoo.com> writes:
> >> 
> >> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >> >
> >> >>> From: Davide Masserut <dm <at> mssdvd.com>
> >> >>> Cc: Stefan Kangas <stefankangas <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
> >> >>>  65509 <at> debbugs.gnu.org
> >> >>> Date: Wed, 06 Sep 2023 16:01:58 +0200
> >> >>> 
> >> >>> It turns out that Emacs 29 has new CLI option that solves exactly these problems.
> >> >>> 
> >> >>> The attached patch replaces the usage of --display=$DISPLAY with --reuse-frame.
> >> >>
> >> >> Po Lu, any objections to installing this on emacs-29?
> >> >
> >> > Yes.  Davide, would you please rewrite the patch so that your change is
> >> > only applied to the PGTK port?
> >> 
> >> Done.  Po, why can't we use --reuse-frame in X builds?
> >> 
> >> 
> >> >From 43085522a08b94ef594bd270d61a38d7bb26e036 Mon Sep 17 00:00:00 2001
> >> From: Davide Masserut <dm <at> mssdvd.com>
> >> Date: Thu, 24 Aug 2023 18:33:39 +0200
> >> Subject: [PATCH] Avoid using --display to reuse frames in PGTK
> >> 
> >> Using hard-coded display values can cause PGTK graphical frames to
> >> open using the wrong backend or not open at all.
> >> 
> >> * Makefile.in (install-etc): Use --reuse-frame instead of
> >> --display=$DISPLAY.
> >> ---
> >>  Makefile.in | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >> 
> >> diff --git a/Makefile.in b/Makefile.in
> >> index fdd9353e254..c82aad1af60 100644
> >> --- a/Makefile.in
> >> +++ b/Makefile.in
> >> @@ -843,6 +843,9 @@ EMACS_ICON=
> >>  ifeq (${USE_STARTUP_NOTIFICATION},no)
> >>  USE_STARTUP_NOTIFICATION_SED_CMD=-e "/^StartupNotify=true$$/d"
> >>  endif
> >> +ifeq ($(HAVE_PGTK),yes)
> >> +USE_WAYLAND_DISPLAY_SED_CMD=-e "s/display=[^ ]*/reuse-frame/"
> >> +endif
> >>  install-etc:
> >>  	umask 022; ${MKDIR_P} "$(DESTDIR)${desktopdir}"
> >>  	tmp=etc/emacs.tmpdesktop; rm -f $${tmp}; \
> >> @@ -857,6 +860,7 @@ install-etc:
> >>  	sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \
> >>  	  -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
> >>  	  $(USE_STARTUP_NOTIFICATION_SED_CMD) \
> >> +	  $(USE_WAYLAND_DISPLAY_SED_CMD) \
> >>  	  ${srcdir}/etc/emacsclient.desktop > $${tmp}; \
> >>  	${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}.desktop"; \
> >>  	rm -f $${tmp}
> >> @@ -870,6 +874,7 @@ install-etc:
> >>  	client_name=`echo emacsclient | sed '$(TRANSFORM)'`${EXEEXT}; \
> >>  	sed -e "/^Exec=/ s|emacsclient|${bindir}/$${client_name}|" \
> >>  	  -e "/^Icon=emacs/ s/emacs/${EMACS_NAME}/" \
> >> +	  $(USE_WAYLAND_DISPLAY_SED_CMD) \
> >>  	  ${srcdir}/etc/emacsclient-mail.desktop > $${tmp}; \
> >>  	${INSTALL_DATA} $${tmp} "$(DESTDIR)${desktopdir}/$${client_name}-mail.desktop"; \
> >>  	rm -f $${tmp}
> >> -- 
> >> 2.42.0
> >> 
> 
> That was lost in the spam filter.  I'd rather not use --reuse-frame
> under the X build, because that's not safe for Emacs 29.

Why is it not safe?

> This LGTM now.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65509; Package emacs. (Fri, 15 Sep 2023 07:45:01 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dm <at> mssdvd.com, 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: Fri, 15 Sep 2023 15:44:02 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

> Why is it not safe?

Because there was previously no problem with the X build under Emacs 29,
and using --reuse-frame there would chance introducing one.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 15 Sep 2023 11:35:02 GMT) Full text and rfc822 format available.

Notification sent to Davide Masserut <dm <at> mssdvd.com>:
bug acknowledged by developer. (Fri, 15 Sep 2023 11:35:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: dm <at> mssdvd.com, stefankangas <at> gmail.com, 65509-done <at> debbugs.gnu.org
Subject: Re: bug#65509: [PATCH] Use correct env var when opening frames with
 freedesktop menu entries
Date: Fri, 15 Sep 2023 14:34:29 +0300
> From: Po Lu <luangruo <at> yahoo.com>
> Cc: dm <at> mssdvd.com,  stefankangas <at> gmail.com,  65509 <at> debbugs.gnu.org
> Date: Fri, 15 Sep 2023 15:44:02 +0800
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Why is it not safe?
> 
> Because there was previously no problem with the X build under Emacs 29,
> and using --reuse-frame there would chance introducing one.

OK, installed on emacs-29 and closing the bug.

Thanks.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 15 Sep 2023 11:35:02 GMT) Full text and rfc822 format available.

Notification sent to Pankaj Jangid <pankaj <at> codeisgreat.org>:
bug acknowledged by developer. (Fri, 15 Sep 2023 11:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 14 Oct 2023 11:24:07 GMT) Full text and rfc822 format available.

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

Previous Next


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