From bb7ba852c9add6ed5b3c1edd783aaf07eca08a46 Mon Sep 17 00:00:00 2001 From: Davide Masserut Date: Wed, 6 Sep 2023 15:35:47 +0200 Subject: [PATCH] Avoid using --display to reuse frames Using hard-coded display values can cause graphical frames to open using the wrong backend or not open at all. * etc/emacsclient-mail.desktop, etc/emacsclient.desktop: Use --reuse-frame instead of --display. --- etc/emacsclient-mail.desktop | 4 ++-- etc/emacsclient.desktop | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/emacsclient-mail.desktop b/etc/emacsclient-mail.desktop index 0a2420ddead..819e3855567 100644 --- a/etc/emacsclient-mail.desktop +++ b/etc/emacsclient-mail.desktop @@ -2,9 +2,9 @@ Categories=Network;Email; Comment=GNU Emacs is an extensible, customizable text editor - and more # We want to pass the following commands to the shell wrapper: -# u=$(echo "$1" | sed 's/[\"]/\\&/g'); exec emacsclient --alternate-editor= --display="$DISPLAY" --eval "(message-mailto \"$u\")" +# u=$(echo "$1" | sed 's/[\"]/\\&/g'); exec emacsclient --alternate-editor= --reuse-frame --eval "(message-mailto \"$u\")" # Special chars '"', '$', and '\' must be escaped as '\\"', '\\$', and '\\\\'. -Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh %u +Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec emacsclient --alternate-editor= --reuse-frame --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh %u Icon=emacs Name=Emacs (Mail, Client) MimeType=x-scheme-handler/mailto; diff --git a/etc/emacsclient.desktop b/etc/emacsclient.desktop index 4395d3b02bc..cfbd4d97979 100644 --- a/etc/emacsclient.desktop +++ b/etc/emacsclient.desktop @@ -3,7 +3,7 @@ Name=Emacs (Client) GenericName=Text Editor Comment=Edit text MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;x-scheme-handler/org-protocol; -Exec=sh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %F +Exec=sh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient --alternate-editor= --reuse-frame \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %F Icon=emacs Type=Application Terminal=false -- 2.42.0