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




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.