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#57752: 28.1.91; emacsclient-mail.desktop doesn't work for me Date: Fri, 16 Sep 2022 12:33:05 -0700 Message-ID: <318de412-3612-0584-074f-8da4fd2b43e1@gmail.com> References: <87r10gcum8.fsf@cassou.me> <87bkrj31r0.fsf@gnus.org> <87y1unxv15.fsf@cassou.me> <83leqn4cji.fsf@gnu.org> <87v8prxtox.fsf@cassou.me> <878rmjy78x.fsf@gnus.org> <87bkrfiqbg.fsf@gmail.com> <878rmjqysp.fsf@cassou.me> <84acc36e7e9328ef2f76@heytings.org> <87zgezpebo.fsf@cassou.me> <84acc36e7e47f3fe9562@heytings.org> <7069638a-21b3-9777-215c-3ce4ec18ca37@froglet.home.mavit.org.uk> <84acc36e7e2d900b70c0@heytings.org> <4712c3c2-dfca-c6a4-2840-13d20cffb7b8@gmail.com> <84acc36e7e3accb7055f@heytings.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="39399"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Damien Cassou , Robert Pluim , Peter Oliver , 57752@debbugs.gnu.org, git@mavit.org.uk, Lars Ingebrigtsen , Eli Zaretskii To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 16 21:34:15 2022 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 1oZH6N-000A0Q-03 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 21:34:15 +0200 Original-Received: from localhost ([::1]:59746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oZH6L-0005sO-81 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Sep 2022 15:34:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZH6A-0005rx-SO for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 15:34:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZH6A-0006GZ-Ac for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 15:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oZH6A-0004d0-48 for bug-gnu-emacs@gnu.org; Fri, 16 Sep 2022 15:34: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: Fri, 16 Sep 2022 19:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57752 X-GNU-PR-Package: emacs Original-Received: via spool by 57752-submit@debbugs.gnu.org id=B57752.166335679817739 (code B ref 57752); Fri, 16 Sep 2022 19:34:02 +0000 Original-Received: (at 57752) by debbugs.gnu.org; 16 Sep 2022 19:33:18 +0000 Original-Received: from localhost ([127.0.0.1]:44390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZH5R-0004c3-Tp for submit@debbugs.gnu.org; Fri, 16 Sep 2022 15:33:18 -0400 Original-Received: from mail-pj1-f49.google.com ([209.85.216.49]:45998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZH5O-0004bq-3b for 57752@debbugs.gnu.org; Fri, 16 Sep 2022 15:33:16 -0400 Original-Received: by mail-pj1-f49.google.com with SMTP id p1-20020a17090a2d8100b0020040a3f75eso557582pjd.4 for <57752@debbugs.gnu.org>; Fri, 16 Sep 2022 12:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:from:to:cc:subject :date; bh=m2EuTga8EhcwnzDDktAAMEgfgW/AKTHz+AF+s6hvaso=; b=ZkRyvG4HYhomFVcUwFUXjJa41Kb+ZEbCj3MF75pzZeM4vHeRX9pKhS8aZuaqNSSUn2 RxVTTV0e/9Ncu2T7NaVvAM0O4FDVWklpi5LUdPIz4oELqO1go3ki7ki5v1DkOorHiGic nKBG4JqDpI/kXDKJa3E56zn0EGyo3czGuurg/GJy8WFllRDmCe3p4t70p/phx0myK8H/ psBnZsnptGP93aW1diklXe2w+EpdrRlxEBNicWpsjKvQwZqGRQ9nyPE4ESX7vlknozvK 5S1uSAVkQkmNnoCfHitjDyZQd2RHF83I7UBezpbpt76RQe+uRzI2CO40FbAmtFszk8rk mO1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:x-gm-message-state :from:to:cc:subject:date; bh=m2EuTga8EhcwnzDDktAAMEgfgW/AKTHz+AF+s6hvaso=; b=oLqYqMoNNqvvI2HSsihsIHCSnrVqI+DQpJqU/rEWu9G1IyLuZN1eIwHNaxrRnE4thC JaxpCFLfx8yX4/w11X2xtHrUR5/nDehwjjogBWANERx5AHvf1brhkc//GLqcK6qrEupA KeClRpQ0L07Z9OEwyc8AAOKTob3YkqRUXgTDBIsh1PExWm7qes/V0EB+WmOata1bFhWq Wg79qX4ZYlsVgDPqQKWiDjh35TPdfDK4nKqa0izBv60Apl0T4dueD3x3rZKysuf7elJ3 uhNNnl5sCyYTVrlrU96ow66bJkMkB2LMY+6YmPpW7SBhQ7nWM1e4ZIUFsfHhUlks8wjm 9ixA== X-Gm-Message-State: ACrzQf0isjg/1Lfgp2aq7a2Wc8WS3S0HJ1X7PpUOO863S4AEFKrC96zF WJSAWJtA/0bAqts3DoBAAd8= X-Google-Smtp-Source: AMsMyM7CfwG97mord+MJM92XtT84ov9vFW/vyE9jpix8lXwOja99sRyA4lYDyAwo6pWdI2Hc65pnLA== X-Received: by 2002:a17:90b:3c83:b0:202:9e3e:8f01 with SMTP id pv3-20020a17090b3c8300b002029e3e8f01mr18100602pjb.116.1663356788116; Fri, 16 Sep 2022 12:33:08 -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 b13-20020a170903228d00b001753654d9c5sm15375719plh.95.2022.09.16.12.33.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Sep 2022 12:33:07 -0700 (PDT) In-Reply-To: <84acc36e7e3accb7055f@heytings.org> Content-Language: en-US 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" Xref: news.gmane.io gmane.emacs.bugs:242804 Archived-At: On 9/16/2022 11:26 AM, Gregory Heytings wrote: >> That would allow both of the following in .desktop files: >> >> emacsclient --function my-function-taking-one-url %u >> emacsclient --function my-function-taking-many-urls %U >> > > Sure, and how would you use it say in shell scripts, in which these > %u/%U/%f/%F constructs do not exist? That depends on the script. However, as an example, maybe you want a 'browse' alias that you can use from the shell (or a shell script) like this: browse https://gnu.org https://fsf.org You might define that alias one of these ways (assuming 'eww-browse-url' were enhanced to use 'command-line-args-left' like 'message-mailto'): alias browse='firefox' alias browse='emacs -f eww-browse-url' alias browse='emacsclient --funcall eww-browse-url' >> '--setq' has the disadvantage that you'd need some way to prepend >> *each* URL/filename with it in the %U/%F cases. >> > > What about --setq args "(list %U)"? That wouldn't work, since .desktop files forbid %-expansions inside quotes[1]. Even working around that, the expansion would look something like this: (list mailto:foo@bar.com ...) Since want each argument to be a string (and wrapping quotes around each element won't work for the same reason I previously mentioned), we'd probably want a different syntax than the above. I wouldn't expect that syntax to make a list of strings. >> Adding '--function' to emacsclient also has the advantage that it's >> already available for emacs, >> > > No, emacs only has --funcall: call Emacs Lisp function FUNC with no > arguments. Sorry, yes. I meant --funcall. This would likely necessitate some changes to how emacsclient talks to the main emacs process though, since I believe positional arguments to emacsclient are currently always treated as file names to visit. For "emacsclient --funcall" to work like "emacs --funcall", emacsclient would have to let the main emacs process process at least some of the arguments in the same manner as command-line arguments to "emacs" (i.e. allow reading them via '(pop command-line-args-left)' or something similar). (I also have an alternate strategy for addressing the original bug, which I'll describe in a separate message so that this subthread doesn't get too unwieldy.) [1] https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html