GNU bug report logs -
#65902
29.0.92; emacsclient-mail.desktop fails due to complicated escaping
Previous Next
Reported by: sbaugh <at> catern.com
Date: Wed, 13 Sep 2023 02:25:01 UTC
Severity: normal
Tags: patch
Found in version 29.0.92
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 9/14/2023 6:36 AM, Eli Zaretskii wrote:
>> From: sbaugh <at> catern.com
>> Date: Thu, 14 Sep 2023 11:03:44 +0000 (UTC)
>> Cc: Jim Porter <jporterbugs <at> gmail.com>, 65902 <at> debbugs.gnu.org,
>> sbaugh <at> janestreet.com
>>
>> The issue is not really with the desktop file. It's a generic problem:
>
> No, it isn't. If it were, we'd have heard about it much sooner, and
> not because of the desktop files.
This actually *has* come up before, but in Org. "org-protocol.el" tries
to solves a similar use case (use emacsclient to open an "org-protocol:"
URL, which calls some Org-mode function). The code for this integration
is quite complex though, and relies on advising 'server-visit-files'
(see the code around 'org--protocol-detect-protocol-server' in
lisp/org/org-protocol.el).
Overall, the Org solution works, though it's hacky, and hooks into
things a bit too late, so Org has to do extra work to clean up the
arguments it receives. For example, on MS-Windows[1], instead of seeing
the original "org-protocol:/..." string that gets passed to emacsclient,
Org sees something like "c:/WINDOWS/system32/org-protocol:/...". Org
works around this problem, but it would be nice if there were a way to
hook into things earlier before the input arguments had been munged.
There have been a few reports/complaints about how this works on the Org
list in the past, too.
I'm not married to any particular implementation for this problem, but
given how this has come up for multiple cases (admittedly both for
handling URLs of some form), I think there's value in considering a
common way to handle this that's more straightforward than shell
scripting or org-protocol's advice hacks.
[1] This is also an example of how the problem isn't *just* with desktop
files, since MS-Windows doesn't use those; instead, you have to set some
registry keys. Otherwise, the problems are pretty similar to desktop
files though.
This bug report was last modified 1 year and 204 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.