From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sBf2BYpxAWIwrQAAgWs5BA (envelope-from ) for ; Mon, 07 Feb 2022 20:22:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aOBUOolxAWI6hgEAG6o9tA (envelope-from ) for ; Mon, 07 Feb 2022 20:22:49 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A2ED52CEE1 for ; Mon, 7 Feb 2022 20:22:49 +0100 (CET) Received: from localhost ([::1]:36490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nH9b6-0005Ot-SG for larch@yhetil.org; Mon, 07 Feb 2022 14:22:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nH9Lp-0000Fu-9w for emacs-orgmode@gnu.org; Mon, 07 Feb 2022 14:07:01 -0500 Received: from [2607:f8b0:4864:20::432] (port=37458 helo=mail-pf1-x432.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nH9Lm-0006gH-J5 for emacs-orgmode@gnu.org; Mon, 07 Feb 2022 14:07:01 -0500 Received: by mail-pf1-x432.google.com with SMTP id y5so13694050pfe.4 for ; Mon, 07 Feb 2022 11:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=HJUBTFptOilwsEdr9Qd4APXPxJVCOV09/qQ4yB59xsw=; b=Z3KQ1IcDTR+8NdmFqAbklbenOVniOx1xUUlHoxkZP9ghwBAu3RFAV2LSTrueR+xrri w77QbXgU/YJt8WR/y0dKR8riRhgTMeEvUzvOnrbGsRuc44BLIw7tH2UeiMIuP/Sfqbrx xtZe4riOUY8GAPAnCyU3mtNbLmbfnSFoM/C8zEl929h/SKe4gzrFFmQb6x05TzGJ7un4 AptzK2H1UNZRg3YGPhHqp13C+nyEFX9VRzbZZ1SqSadxc6dHieiOELkU1HHGFvt/LZQN NiQF5LkGyRwnOtGTBXS1xBMIDiC+DogLVqgEIsYf5t47gTxrDhpfk4eTpo6tpIilXu57 u/FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=HJUBTFptOilwsEdr9Qd4APXPxJVCOV09/qQ4yB59xsw=; b=HE67MfE+Y/wAptlYcguhzJflh5EgvC1qx4ealfNhrU77C/t3mpKJ8nSogUasM7EJer syqAbJxfUg20C0jnX+65VXo1ItlOYdLy7KhjGY/HOBghEti9c5w2mwUYyj1dJWvXfrE4 U27DlpBNFfAp5kQuAaCqnZN6q8ZuqQdQwesuCaAPfFhIBs5gLyBRfCePIAhOJvleyjSX VCKhlkrc0xbhbj8m/E1aCEnPQyxNRGdqQ0sXwsP1Pc1WbWNN3lafMuK06m+UcAnTVFIv teXtI34eXGxIFIMFIqA6KNcjSnGew/J6Vg3smgkDmfOywkYnyBRM/N74p5ik1rOQ3zU5 a3iA== X-Gm-Message-State: AOAM531VcJKe+VV0FYLskChYKCbTyjxu1plup6qyLd9sn9EIPp/JsG1I 9QdbXnYl4zxKHGiHhMNv1UBoqLFiTAmAnQ== X-Google-Smtp-Source: ABdhPJyplf0fvpWfTb8/LJIRIrwW4/HTIflO1RWNJVVBTw1spqM6fBTCbqUAxCsPPaWYSwg18cCZzQ== X-Received: by 2002:a62:1dcc:: with SMTP id d195mr799375pfd.4.1644260809922; Mon, 07 Feb 2022 11:06:49 -0800 (PST) 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 v2sm99931pjt.55.2022.02.07.11.06.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Feb 2022 11:06:49 -0800 (PST) Subject: Re: Lazy load of org-protocol To: emacs-orgmode@gnu.org References: <9b140f0a-c75e-cf00-0f83-67e5a660935c@gmail.com> <62519b3f-d1fa-4497-e32f-2a0960c4d1fe@gmail.com> From: Jim Porter Message-ID: <450a25ba-e1f5-16db-c953-92fef0bfdc1a@gmail.com> Date: Mon, 7 Feb 2022 11:06:48 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::432 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=jporterbugs@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644261769; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=HJUBTFptOilwsEdr9Qd4APXPxJVCOV09/qQ4yB59xsw=; b=oIDf+0BgLuckNZv6sv9RR8H0whfA6iFj+8Si80ynrwlwQXpl8qZjzhaKxOPKyZ5DEj2Xn9 1FtQZUDDXE+074SEMizNm0Rbxo8GK99HqS1C5nxKHDZHpCXTpv2pXiE4OUpvZd76ibvicA uufJXMy8k3xPHkwQLm6q/5a9cto0JEuFoBvJZdol4f94Z+q/jgsS7INWfuSyC3elSi0Ieo 7K3JTYeuXp+dc8fmRVAMGEVfDWeE1uk8X9exN5IYeqYfM/NN3xvG2pjE/0U87LiR3En5hc DQO1F1NRk1q1evRVapQQLFXxP5pT9eZgdUhwtN2YociBlZ4s4IzWSsrfgPSEIQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644261769; a=rsa-sha256; cv=none; b=GLoaq9LFc6j3l8pULNOWG7glwVmbv9GeVMVtROxrFtnX0nyf+7sGmtOIXBzmUEFYLxtV/E EYsiODGudhkLSpu4IHLnTe69oYWiBxwsUBSyub4nWgNnRx55sGIhWkRADLjMfBEP8uwQw3 KQ/bkdkoLNf4b60FNmRnpoYEoTKQYUGbp43sgCsXdUZOnwu/b27fVW2wAHJnhHtxgRAYjd mMiFyfofPuFZzxCCaP3c33BCSKovt4BRqB4qj3WQluHcV5feRvjcHBVu8uXUTMvIXPypsa +5V+FkJ2OY8lFCE9K8i6Q9fNamXTM+D5iR/3+hj9JwZQql+lLyFBTDc/XseXAQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z3KQ1IcD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.33 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z3KQ1IcD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A2ED52CEE1 X-Spam-Score: -4.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: x3T0bEX8nWUI On 2/7/2022 6:57 AM, Max Nikulin wrote: >> Maybe another option would be to add an --apply argument that really >> *does* consume the other command-line args and turns them into a >> properly-quoted function call. Roughly speaking, it would turn this: >> >>    emacs --apply func foo bar baz >> >> into this: >> >>    (apply #'func '(foo bar baz)) > > You have almost managed to sell this idea to me. However even --apply is > just sugar for > >     emacsclient --eval "(apply #'func command-line-args-left)" --arg 1 2 > > So it is --apply option that may require to write a dedicated function > if --arg is not implemented. Another limitation of --apply is that the > function must accept string arguments only, no lists or even integers or > boolean. Yeah, `--arg' does have greater flexibility in that regard, but it comes at the cost of verbosity and some slight behavioral differences with the equivalent in the main emacs executable. For emacs itself, any elements of `command-line-args-left' that aren't consumed by a function will get opened as files, but I don't think that would be the case with emacsclient. Does this difference matter? Probably not. However, avoiding `command-line-args-left' just feels intuitively "cleaner" to me. Still, I think `--arg' should work and be backwards-compatible, so I don't mind it, even if I prefer the simplicity of `--apply'. On a related note, there is still an issue with `--eval' in some cases. It fails to work with emacsclient when invoking an alternate editor: emacsclient --alternate-editor emacs --eval '(message "hi")' If Emacs isn't already running, that will open a new buffer named '(message "hi")'. I think that's just a bug in how emacsclient handles `--eval', though fixing it would make org-protocol links work more reliably (if they used `--eval' as proposed, that is). - Jim