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 QI2ZGxdUBWKxxAAAgWs5BA (envelope-from ) for ; Thu, 10 Feb 2022 19:06:15 +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 yO1OFBdUBWJFtgAAG6o9tA (envelope-from ) for ; Thu, 10 Feb 2022 19:06:15 +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 0EF802AC5E for ; Thu, 10 Feb 2022 19:06:15 +0100 (CET) Received: from localhost ([::1]:60260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIDpe-0001R1-86 for larch@yhetil.org; Thu, 10 Feb 2022 13:06:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIAgt-00075B-Na for emacs-orgmode@gnu.org; Thu, 10 Feb 2022 09:44:59 -0500 Received: from ciao.gmane.io ([116.202.254.214]:38082) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIAgs-0002NX-3E for emacs-orgmode@gnu.org; Thu, 10 Feb 2022 09:44:59 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nIAgh-0002QA-9v for emacs-orgmode@gnu.org; Thu, 10 Feb 2022 15:44:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: Lazy load of org-protocol Date: Thu, 10 Feb 2022 21:44:40 +0700 Message-ID: References: <9b140f0a-c75e-cf00-0f83-67e5a660935c@gmail.com> <62519b3f-d1fa-4497-e32f-2a0960c4d1fe@gmail.com> <450a25ba-e1f5-16db-c953-92fef0bfdc1a@gmail.com> <1dd55e54-7677-2764-1b6d-eda0a278bc3f@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US In-Reply-To: <1dd55e54-7677-2764-1b6d-eda0a278bc3f@gmail.com> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, 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=1644516375; 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; bh=BdrLQTfpi7dtuRMlA7bZreAJ7KVPF8UFRHIIeB5WtTo=; b=KX43kh4pDeQ8lgSfs49V4xZhwmGxWxAnz/BzQV5sQOglEf4asEr8AvLRqhkd7eYDhmw5T0 hB8iFNSV2qkwin91eD6tcFVhJ6jpH5slq9r/+2cnbvTDaRR0pIDNt1SEyCx5w11NchiqhC WmW9KxpERTSMzV73jeu22/HIQmuzkIUDzYfMITzLuw+tDlcArszDw0gf6lwTfTe5Yhue2d Znnce9H3uA1Jb6e0YrQ56H15yTuOML0s2pvfz4cQNTXPlQgxyq87lNDnUnGqe0bHx5W1ow xrBYk9bGPJHS8o6ojUqfZN/b8OK5BbOGjcIG3igTNKitWZbra241C+0RLJ5p3A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644516375; a=rsa-sha256; cv=none; b=nlRnX19KJA08IQh6+i0N6Tvdt9Wu9YWeeME9t6ZsxByllNPamfZlMUU+Byto45fJRQgVc4 oxlgYe3iaZrTfnlv1JgrVZvy+fPKZdKmz3q1lEgGfQfqYyjZ1raycurackvUZFyFzPzjzZ bYTP+s/pgMhXjdCcg9eYlfv5BFqnhXrfHg818lpSAsrfRb8uIXUfSlym64gjWbzU+O817C ZEX1rygXR9od4d1RN0uASWXe59GY5mxPvilAaWxs+mO/8oIxFUZoFwRC6ahsicSSU2+hml eWTHm/9u6ZHakOywaq0CdaKETSn6zv2DQGczyhe8wR3l9WwIc4+xMeLIDC1RzA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: -3.63 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: 0EF802AC5E X-Spam-Score: -3.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: cMfelZHo3bhg On 10/02/2022 02:22, Jim Porter wrote: > On 2/9/2022 8:46 AM, Max Nikulin wrote: > >>> 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). >> >>      emacsclient --alternate-editor '' --eval '(message "hi")' >> >> But it makes it harder to use it during debugging when -Q -L >> ~/src/org-mode/lisp options are required. > > Right, invoking the main Emacs instance as a daemon (i.e. when > --alternate-editor is the empty string) works pretty differently from > invoking the main Emacs instance directly (i.e. when --alternate-editor > is "emacs" or somesuch). In the former case, emacsclient starts "emacs > --daemon" and then tries to reconnect to the daemon; in the latter, it > just takes the arguments passed to emacsclient and forwards them (well, > some of them) to emacs. The end result is that it runs "emacs '(message > "hi")'", which isn't correct. It looks like a bug. I believed that other application may be specified as --alternate-editor, so --eval arguments should not be passed to it. Actually I do not like --alternate-editor option at all. It is a single string, not an array of executable and options. It allows quotes but does not support escaping. On linux a solution is to start emacs daemon from systemd session as a socket-activated application.