GNU bug report logs - #67736
30.0.50; emacsclient.desktop fails with quoting-related error

Previous Next

Package: emacs;

Reported by: Mekeor Melire <mekeor <at> posteo.de>

Date: Sun, 10 Dec 2023 00:57:01 UTC

Severity: normal

Found in version 30.0.50

Done: Mekeor Melire <mekeor <at> posteo.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ulrich Mueller <ulm <at> gentoo.org>
To: Peter Oliver <p.d.oliver <at> mavit.org.uk>
Cc: Mekeor Melire <mekeor <at> posteo.de>, 67736 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, carlosjosepita <at> gmail.com
Subject: bug#67736: 30.0.50; emacsclient.desktop fails with quoting-related error
Date: Sun, 17 Dec 2023 16:35:19 +0100
>>>>> On Sun, 17 Dec 2023, Peter Oliver wrote:

> Mekeor Melire wrote:

>> $ xdg-open example.txt
>> egrep: warning: egrep is obsolescent; using grep -E
>> [: -c: line 1: unexpected EOF while looking for matching `"'
>> [: -c: line 2: syntax error: unexpected end of file
>> [: -c: line 1: unexpected EOF while looking for matching `"'
>> [: -c: line 2: syntax error: unexpected end of file
>> [: -c: line 1: unexpected EOF while looking for matching `"'
>> [: -c: line 2: syntax error: unexpected end of file
>> Does anyone else experience this problem?

> I don’t experience it on Fedora, but I notice that the Fedora version
> of xdg-utils carries an awful lot of patches
> (https://src.fedoraproject.org/rpms/xdg-utils/tree/f38).

I cannot reproduce the problem on Gentoo either. The Gentoo package uses
a snapshot of xdg-utils from 2021 because the 1.1.3 release is very old:
https://gitlab.freedesktop.org/xdg/xdg-utils/-/commits/1a58bc28f6844898532daf9ee1bf6da7764955a9/

(Also, xdg-utils-1.2.0 seems to be on its way; upstream has released a
1.2.0-beta1 version.)

> I agree that the quoting is too complex, and would be better
> eliminated.

I've double checked: The quoting in the desktop file is definitely
according to the specification. IMHO it isn't particularly complex in
emacsclient.desktop, at least compared to what we previously had in
emacsclient-mail.desktop.

> A wrapper script could achieve the same functionality.

All previous committers have avoided a wrapper script, because inlining
the shell command gets the work done.

Plus, wouldn't it be better to integrate the functionality of any
wrapper script in the emacsclient binary directly?


[Restoring some of the quoted context]

>>     Commit: d32091199ae5de590a83f1542a01d75fba000467
>>     Author: Ulrich Müller <ulm <at> gentoo.org>
>>     Date:   Mon Dec 19 16:51:20 2022 +0100
>>     Message:
>>         Use `sh` rather than `placeholder` as the command name of the
>>         shell wrapper. (Bug#60204)
>>     Code:
>>         Exec=sh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient
>>         --alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\";
>>         else exec emacsclient --alternate-editor= --create-frame; fi"
>>         sh %F

This commit didn't do anything significant for emacsclient.desktop, it
only changed the command name (which is shown e.g. in "ps" output) from
"placeholder" to "sh".




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

Previous Next


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