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

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Mon, 12 Sep 2022 18:32:01 UTC

Severity: normal

Merged with 59743

Found in version 28.1.91

Full log


Message #125 received at 57752 <at> debbugs.gnu.org (full text, mbox):

From: Max Nikulin <manikulin <at> gmail.com>
To: Damien Cassou <damien <at> cassou.me>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Jim Porter <jporterbugs <at> gmail.com>, Peter Oliver <git <at> mavit.org.uk>,
 57752 <at> debbugs.gnu.org
Subject: Re: bug#57752: 28.1.91; emacsclient-mail.desktop doesn't work for me
Date: Fri, 2 Dec 2022 21:52:39 +0700
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




This bug report was last modified 1 year and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.