From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#65902: 29.0.92; emacsclient-mail.desktop fails due to complicated escaping Date: Thu, 14 Sep 2023 12:16:17 -0700 Message-ID: <96efadce-beab-0908-8402-9429ff2bcc31@gmail.com> References: <83ttrym8jx.fsf@gnu.org> <83led9nay9.fsf@gnu.org> <66a6c09e-3b61-d913-5638-4c804fb826f6@gmail.com> <83edj1mja5.fsf@gnu.org> <87il8dt3sh.fsf@catern.com> <83pm2klvw9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14102"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@janestreet.com, 65902@debbugs.gnu.org To: Eli Zaretskii , sbaugh@catern.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 14 21:17:31 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 1qgrqF-0003Pw-GS for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Sep 2023 21:17:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgrpi-0003jZ-GV; Thu, 14 Sep 2023 15:16:58 -0400 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 1qgrph-0003jN-Jf for bug-gnu-emacs@gnu.org; Thu, 14 Sep 2023 15:16:57 -0400 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 1qgrph-0004g7-Am for bug-gnu-emacs@gnu.org; Thu, 14 Sep 2023 15:16:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qgrpm-0007ja-62 for bug-gnu-emacs@gnu.org; Thu, 14 Sep 2023 15:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Sep 2023 19:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65902 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65902-submit@debbugs.gnu.org id=B65902.169471899729692 (code B ref 65902); Thu, 14 Sep 2023 19:17:02 +0000 Original-Received: (at 65902) by debbugs.gnu.org; 14 Sep 2023 19:16:37 +0000 Original-Received: from localhost ([127.0.0.1]:41173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgrpN-0007ip-4n for submit@debbugs.gnu.org; Thu, 14 Sep 2023 15:16:37 -0400 Original-Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:42027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgrpH-0007iX-OU for 65902@debbugs.gnu.org; Thu, 14 Sep 2023 15:16:35 -0400 Original-Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-68fc292de9dso1035527b3a.0 for <65902@debbugs.gnu.org>; Thu, 14 Sep 2023 12:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694718980; x=1695323780; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=cvxqKibU0akGY81InuiZv/JrtdIv8PwPmMMprL50A2o=; b=F5OOM2pAYwOhTIb61lutxBLqSddGkezOIl4F0/zxTag/QJjafsFjt8lf31bY1o1JI+ S4qvRx3iptVaf7MiAqNHzQ5cj/j2LV1pPjjTgQVOpcJIXwpA4WYHlhI9D2BIQGskXfEk StG6EYfoMwfTx+RgoejdRuqAD55TAHos8RwV9ESUdst9T+IKKbJ7IwlT3lOetzPoD2rC lfQjuz+Ja16GypYRSmOVMHtU6h4OZfkmVoGKeVbIBu6afJY7vOhl4Q6WHIIVW8yzAHJw fQkRPnIHpd78waGYsf1Ip112L7BL+3xq/Y8m9l/IcdvNxhSmIb8SiRnQfPabQaN5e7P4 g1Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694718980; x=1695323780; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cvxqKibU0akGY81InuiZv/JrtdIv8PwPmMMprL50A2o=; b=dkUgLFRkQDbQlVoU+L0mIrwucx6RHv7IGAEBTxy/sBddCA4NuPbtumGLTeH5aJYJBa brpOuKVhjr9oC1CuF7HSjslYyfK5JNdp4hEMNmw3aU59rD4FsflozcGhe64mSvwW1AhA UL+m+WKb8KL2yxqdZNBJaMXwVdZg/eDyqeHeIRRKkV9A3ELy41vov4XoV4jRyzMuegGd SopY4HcAVpNkdTKR/uqTRl6XMHAEMbppvt9J/Ua80D+9XJp7uZilcTrxSXBkYKRNsge/ GhUphtzaBpKkMRpLLy3uMCk8IC/NXtBCz8Y43w8SIQ8uIMgFTN/wK74WLcPWi7kmuvq8 cdyQ== X-Gm-Message-State: AOJu0YytROsroElhpQEOZ5xPCbx2g0HkDtmqHZjDJE2krek1FqKE4EjK H8XtCPhzZobRjKpknRAffkk= X-Google-Smtp-Source: AGHT+IGL1CYAWUyDmyt+Y4a7NYW1vMyP1PaCOa7utBnaCKAN7lR8Z7YNIFrcMDo5omiBTJzEW3GUhQ== X-Received: by 2002:a05:6a00:d9e:b0:68f:c1e0:a2c4 with SMTP id bf30-20020a056a000d9e00b0068fc1e0a2c4mr3397585pfb.3.1694718979760; Thu, 14 Sep 2023 12:16:19 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id k2-20020aa790c2000000b006875df4773fsm1652848pfk.163.2023.09.14.12.16.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Sep 2023 12:16:18 -0700 (PDT) Content-Language: en-US In-Reply-To: <83pm2klvw9.fsf@gnu.org> 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:270458 Archived-At: On 9/14/2023 6:36 AM, Eli Zaretskii wrote: >> From: sbaugh@catern.com >> Date: Thu, 14 Sep 2023 11:03:44 +0000 (UTC) >> Cc: Jim Porter , 65902@debbugs.gnu.org, >> sbaugh@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.