summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-03-08 19:37:27 +0100
committerUlrich Müller <ulm@gentoo.org>2023-03-08 19:37:27 +0100
commitc8ec0017cb96d4ac98be21e1fe9a95e1aa723e99 (patch)
treed0ee1bb086c2bd534f1c1774d01b1b9541c8c7c7 /etc
parenta588937094f7beb7c716c1badff681afa8c4d5ae (diff)
downloademacs-c8ec0017cb96d4ac98be21e1fe9a95e1aa723e99.tar.gz
Avoid using bash in the emacsclient desktop file
* etc/emacsclient-mail.desktop (Exec): Use sh and sed instead of bash, because the latter may not be available everywhere.
Diffstat (limited to 'etc')
-rw-r--r--etc/emacsclient-mail.desktop6
1 files changed, 3 insertions, 3 deletions
diff --git a/etc/emacsclient-mail.desktop b/etc/emacsclient-mail.desktop
index 49c6f99f317..0a2420ddead 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=${1//\\/\\\\}; u=${u//\"/\\\"}; exec emacsclient --alternate-editor= --display="$DISPLAY" --eval "(message-mailto \"$u\")"
+# u=$(echo "$1" | sed 's/[\"]/\\&/g'); exec emacsclient --alternate-editor= --display="$DISPLAY" --eval "(message-mailto \"$u\")"
# Special chars '"', '$', and '\' must be escaped as '\\"', '\\$', and '\\\\'.
-Exec=bash -c "u=\\${1//\\\\\\\\/\\\\\\\\\\\\\\\\}; u=\\${u//\\\\\\"/\\\\\\\\\\\\\\"}; exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" bash %u
+Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh %u
Icon=emacs
Name=Emacs (Mail, Client)
MimeType=x-scheme-handler/mailto;
@@ -16,7 +16,7 @@ Actions=new-window;new-instance;
[Desktop Action new-window]
Name=New Window
-Exec=bash -c "u=\\${1//\\\\\\\\/\\\\\\\\\\\\\\\\}; u=\\${u//\\\\\\"/\\\\\\\\\\\\\\"}; exec emacsclient --alternate-editor= --create-frame --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" bash %u
+Exec=sh -c "u=\\$(echo \\"\\$1\\" | sed 's/[\\\\\\"]/\\\\\\\\&/g'); exec emacsclient --alternate-editor= --create-frame --eval \\"(message-mailto \\\\\\"\\$u\\\\\\")\\"" sh %u
[Desktop Action new-instance]
Name=New Instance