From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.bugs Subject: bug#67736: 30.0.50; emacsclient.desktop fails with quoting-related error Date: Mon, 18 Dec 2023 11:17:25 +0100 Message-ID: References: <87a5qiswvy.fsf@posteo.de> <83cyvewpha.fsf@gnu.org> <875y16s3i2.fsf@posteo.de> <871qbus35s.fsf@posteo.de> <83y1e2uv81.fsf@gnu.org> <87plz5ptbd.fsf@posteo.de> <5f44b482-109e-f592-4e7a-8429e56bfa6e@mavit.org.uk> <87jzpc5ska.fsf@posteo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6374"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67736@debbugs.gnu.org, Eli Zaretskii , Peter Oliver , carlosjosepita@gmail.com To: Mekeor Melire Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 18 11:18:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rFAhV-0001TW-BM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Dec 2023 11:18:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rFAhI-0004yV-2p; Mon, 18 Dec 2023 05:18:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rFAhE-0004x5-9c for bug-gnu-emacs@gnu.org; Mon, 18 Dec 2023 05:18:01 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rFAhE-00051z-1a for bug-gnu-emacs@gnu.org; Mon, 18 Dec 2023 05:18:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rFAhF-0001A2-Q7 for bug-gnu-emacs@gnu.org; Mon, 18 Dec 2023 05:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ulrich Mueller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Dec 2023 10:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67736 X-GNU-PR-Package: emacs Original-Received: via spool by 67736-submit@debbugs.gnu.org id=B67736.17028946634411 (code B ref 67736); Mon, 18 Dec 2023 10:18:01 +0000 Original-Received: (at 67736) by debbugs.gnu.org; 18 Dec 2023 10:17:43 +0000 Original-Received: from localhost ([127.0.0.1]:59489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFAgw-000194-RT for submit@debbugs.gnu.org; Mon, 18 Dec 2023 05:17:43 -0500 Original-Received: from woodpecker.gentoo.org ([2001:470:ea4a:1:5054:ff:fec7:86e4]:58989 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFAgt-00018X-PA for 67736@debbugs.gnu.org; Mon, 18 Dec 2023 05:17:40 -0500 In-Reply-To: <87jzpc5ska.fsf@posteo.de> (Mekeor Melire's message of "Sun, 17 Dec 2023 23:06:55 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276455 Archived-At: >>>>> On Mon, 18 Dec 2023, Mekeor Melire wrote: > So, when testing, do not use graphical file-managers. Instead, use the > xdg-open executable from xdg-utils package in a shell. Edit the file at > ~/.config/mimeapps.list (or similar) yourself rather than letting some > GUI do it. And check the content of your emacsclient.desktop since it > might be altered by your distro. > When sharing results, please also share which version your xdg-utils > package has, and which patches had been applied on its source code > before it was built. Sure. My /usr/share/applications/emacsclient.desktop is identical to the one from Emacs master (as of today). Also, it is what is used for plain text files: $ xdg-mime query default text/plain emacsclient.desktop I've now also tested with xdg-utils-1.2.0-beta1 and with 1.1.3, manually installed from the tarball available at: https://gitlab.freedesktop.org/xdg/xdg-utils/-/tags/v1.1.3 I cannot reproduce the problem with either of them: $ xdg-open --version xdg-open 1.1.3 $ echo hello >foo.txt && xdg-open foo.txt Waiting for Emacs... This correctly visits the file in my running Emacs. However, I also see that xdg-open delegates handling of the file to exo-open from XFCE (and similar for GNOME, KDE, etc.). So maybe xdg-open sometimes doesn't parse the desktop file by itself? Which would explain why I don't see the problem. > [...] > The problem is that xdg-utils does not adhere to its own specification. > It seems like some distros patched it to be better at that though. > I think a prior version of emacsclient-mail.desktop is bad reference for > comparison. Compared to other .desktop-files in the FOSS-world, > emacsclient.desktop has a very complicated, maybe the most complicated > Exec-entry. I can't prove this by representative statistics but only > refer to my own experience, and quote the reaction of the person, who by > far made the most commits on xdg-utils recently, when seeing the > emacsclient.desktop-files Exec-entry: "That is =E2=80=A6 one hell of an e= xec > line." [3] The line conforms to the spec, so xdg-open should be able to handle it. Then again, the line is "one hell" only because (IMHO) their own specification sucks and requires complicated quoting plus multiple telnet-song-esque backslash-escaping. (Also I'm a little shocked by the reaction of the upstream person. It's their specification and their reference implementation, so why don't they have unit tests for all intricacies of the Exec line?) > Honestly, I don't know how to handle this tricky situation: > freedesktop.org has specification for Exec entries in .desktop-files. > xdg-utils itself does implement this specification correctly. Is a "not" missing there? Otherwise I don't understand the sentence. > Fixing the bug will probably take its developers a long time because > they want to rewrite it (in Python). Meanwhile, xdg-utils is less/not > buggy for most users because their distro patches it. *sigh* Standards exist for a reason, namely that developers can program against them, instead of second-guessing other implementations. I think we have established that the bug is in xdg-utils, so that's where it should be ultimately fixed. Not sure if it's worth having a short-term workaround using a wrapper script.