bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57752: 28.1.91; emacsclient-mail.desktop doesn't work for me


From: Max Nikulin
Subject: bug#57752: 28.1.91; emacsclient-mail.desktop doesn't work for me
Date: Fri, 2 Dec 2022 21:52:39 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 13/09/2022 20:29, Damien Cassou wrote:
Lars Ingebrigtsen writes:
I'd prefer to have a .desktop file that works without any helper
scripts.   Can't the emacsclient-mail.desktop file be rewritten to not
use quoting here?

This is maybe possible but I haven't found a way. Moreover, the
constraints that "Field codes must not be used inside a quoted argument"
makes things more complex.

It is possible to pass %u to shell using positional parameters:

    sh -c 'echo "$1"' demo ARGUMENT

However POSIX shell is not enough to escape double quote and backslash inside %u for elisp. BASH allows to perform substitutions during variable expansion. The idea is the following (it needs more backslashes to conform XDG spec):

bash -c 'e=${1//\\/\\\\}; e=${e///\"/\\\"}; emacsclient --alternate-editor= --display="$DISPLAY" --eval=\(message-mailto\ "\"$e\""\)' emacsclient-mailto %u





reply via email to

[Prev in Thread] Current Thread [Next in Thread]