From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 03FB915802F for ; Tue, 7 Mar 2023 17:28:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4045EE07D8; Tue, 7 Mar 2023 17:28:24 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 229B0E07D8 for ; Tue, 7 Mar 2023 17:28:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 13D8834128F for ; Tue, 7 Mar 2023 17:28:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 51112888 for ; Tue, 7 Mar 2023 17:28:21 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1678210008.0f29d9f2912573e696b9cb6019cb036246d7d21e.ulm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: x11-misc/emacs-desktop-mail/ X-VCS-Repository: repo/gentoo X-VCS-Files: x11-misc/emacs-desktop-mail/emacs-desktop-mail-1.1.ebuild x11-misc/emacs-desktop-mail/emacs-desktop-mail-1.2.ebuild X-VCS-Directories: x11-misc/emacs-desktop-mail/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 0f29d9f2912573e696b9cb6019cb036246d7d21e X-VCS-Branch: master Date: Tue, 7 Mar 2023 17:28:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f8e39921-1bef-439e-a5de-6f1469368add X-Archives-Hash: 4731dfc86b8709d5024eb278ba8b249f commit: 0f29d9f2912573e696b9cb6019cb036246d7d21e Author: Ulrich Müller gentoo org> AuthorDate: Tue Mar 7 17:26:48 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Tue Mar 7 17:26:48 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f29d9f2 x11-misc/emacs-desktop-mail: Backslash-escape '\' and '"' Escape any backslash and double quote characters, before passing the URI to emacsclient. Signed-off-by: Ulrich Müller gentoo.org> ...op-mail-1.1.ebuild => emacs-desktop-mail-1.2.ebuild} | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/x11-misc/emacs-desktop-mail/emacs-desktop-mail-1.1.ebuild b/x11-misc/emacs-desktop-mail/emacs-desktop-mail-1.2.ebuild similarity index 65% rename from x11-misc/emacs-desktop-mail/emacs-desktop-mail-1.1.ebuild rename to x11-misc/emacs-desktop-mail/emacs-desktop-mail-1.2.ebuild index 92d93860fb2f..aa83394f2032 100644 --- a/x11-misc/emacs-desktop-mail/emacs-desktop-mail-1.1.ebuild +++ b/x11-misc/emacs-desktop-mail/emacs-desktop-mail-1.2.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -29,8 +29,12 @@ src_install() { # The Desktop Entry Specification does not allow field codes like %u # inside a quoted argument, therefore we need a shell wrapper. - # We want to pass a literal '"(message-mailto \"$1\")"' in the -c - # command, but in the desktop entry '"', '\', and '$' must be escaped + # We pass the following commands to it, in order to backslash-escape + # any special characters '\' and '"' that occur in %u: + # u=${1//\\/\\\\} + # u=${u//\"/\\\"} + # exec emacsclient --eval "(message-mailto \"$u\")" + # However, in the desktop entry '"', '\', and '$' must be escaped # as '\\"', '\\\\', and '\\$', respectively. Yet another level of # backslash escapes is needed for '\' and '$' in the here-document. newmenu - emacsclient-mail.desktop <<-EOF @@ -38,8 +42,11 @@ src_install() { Type=Application Name=Emacsclient (mail) NoDisplay=true - Exec=${EPREFIX}/bin/bash -c "exec ${EPREFIX}/usr/bin/emacsclient \ ---eval \\\\"(message-mailto \\\\\\\\\\\\"\\\\\$1\\\\\\\\\\\\")\\\\"" bash %u + Exec=${EPREFIX}/bin/bash -c \ +"u=\\\\\${1//\\\\\\\\\\\\\\\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}; \ +u=\\\\\${u//\\\\\\\\\\\\"/\\\\\\\\\\\\\\\\\\\\\\\\\\\\"}; \ +exec ${EPREFIX}/usr/bin/emacsclient \ +--eval \\\\"(message-mailto \\\\\\\\\\\\"\\\\\$u\\\\\\\\\\\\")\\\\"" bash %u Terminal=false MimeType=x-scheme-handler/mailto; EOF