GNU bug report logs - #74467
31.0.50; org-protocol emacsclient.desktop change is not fully functional

Previous Next

Package: emacs;

Reported by: Alexey Lebedeff <binarin <at> binarin.info>

Date: Fri, 22 Nov 2024 03:57:02 UTC

Severity: normal

Merged with 79068

Found in versions 30.1, 31.0.50

Full log


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

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Björn Bidar <bjorn.bidar <at> thaodan.de>
Cc: 74467 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, binarin <at> binarin.info
Subject: Re: bug#74467: 31.0.50; org-protocol emacsclient.desktop change is
 not fully functional
Date: Sun, 05 Jan 2025 18:36:45 +0000
Björn Bidar <bjorn.bidar <at> thaodan.de> writes:

>> -Exec=sh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %F
>> +Exec=sh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %U
>
> Do we need the shell code here? if DISPLAY is defined emacsclient could
> shurely forward it to Emacs.

I think that reasons why sh is there have nothing to do with the issue
at hand.

> Shellcode is part of the issue.

How so?
The first message in this thread described exactly why the old version
stopped working:

    On 2023-10-03 there was a change introduced in xdg-utils
    https://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=b9d3ecf8180c57dbb5ca47253898ba0553e81c60
    to more strictly follow xdg specification, and only pass URL-like
    arguments to programs that explicitly requested this by using '%u' or
    '%U' parameters.

After the above change, %F in our .desktop file prevents xdg-open from
using it for opening URIs. Any URIs, not just org-protocol and co.

So, %U should fix it, except that it will also signal to xdg-open that
Emacs can handle file:// URI as well; so we need to make sure that
file:// URIs can be opened just fine.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 5 days ago.

Previous Next


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