From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id aMkDG2ECi2UKJgEAkFu2QA (envelope-from ) for ; Tue, 26 Dec 2023 17:42:09 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 4FrUE2ECi2X7DgAAqHPOHw (envelope-from ) for ; Tue, 26 Dec 2023 17:42:09 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fastmail.com header.s=fm2 header.b=Trm7YQuh; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=ostT0rwf; 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"; dmarc=pass (policy=none) header.from=fastmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703608929; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0wVVtb+qy9hL8thW38lhroP6MQKOKBNtLrukUB5igRM=; b=ikn/XrMALycvjKYMl2k4/bgGUpfMnQRYMXSVe2zJPU3Mw4aQAh5VVMO26uvvnQhni9U1BX B2bkICBUY6Q8JQ2jJB6YMq1p2AU4Z8gwLnoj/K1OiCimtHHWuBzt3AAexWyVNXKSzWPv7g 4e55gGtdO780r3mm0j0uxFa0P9BqP9LmDvuuK9sPdxUKFcnHd715EXlUgW6I8mJbLYEJZu EijUHfrqK0Czr5iVufUi1+ERnl3DaPcR9yQ1bY6FwXLFjtJ8jKCHEEqNhHxAn/WaNmjlTn 0pZvAF66J7Ng1D0cWjUAyJP2kUechz/Mh9PV83YElxFTa79ZuXioQvnqfR1aXg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703608929; a=rsa-sha256; cv=none; b=Xgu7agDDEDWC2c6xHYxM4yUdNVFDuzauFcu+SPItD7dpew2hDiLmniSU1aRGYBBrnDUhIq nr5Ovz11Mw5rx418XKuejPsOnIhd+TUPxRu26I914nSDH54bkGwXgC7ogyVpGZe4FnrcuG p3pDJzW8e9rKzGYBAhr40p+teQ2PVeNdmvfoEZlpMYficQ35jZnRO0oTXcSm9V8C/RmQ4v aOYfXLtTkZg4Ci/82bZSayi+9TfDXB7Sk5Sz9HMKJRpvK4uq90W6A30JjrlEZfCxR/UDYd T8Hn5ot4GSUy5OsPIFsIWE33fah1aFv9nxJdR7MciAurjr1n9HB/hryz/dGbnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fastmail.com header.s=fm2 header.b=Trm7YQuh; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=ostT0rwf; 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"; dmarc=pass (policy=none) header.from=fastmail.com 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 0756A6759D for ; Tue, 26 Dec 2023 17:42:07 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIAPk-0004Pp-Bh; Tue, 26 Dec 2023 11:36:21 -0500 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 1rIAPe-0004PR-Up for emacs-orgmode@gnu.org; Tue, 26 Dec 2023 11:36:16 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rIAPc-0003va-GP for emacs-orgmode@gnu.org; Tue, 26 Dec 2023 11:36:14 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id CEB9B5C009E; Tue, 26 Dec 2023 11:36:08 -0500 (EST) Received: from imap43 ([10.202.2.93]) by compute4.internal (MEProxy); Tue, 26 Dec 2023 11:36:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1703608568; x=1703694968; bh=0wVVtb+qy9 hL8thW38lhroP6MQKOKBNtLrukUB5igRM=; b=Trm7YQuhRJGaqJgxH0dpU1W876 TdxzedcR2UPBUGCfOatP7RprWdfhswb/E3xqdR5IPRTIrX+wsJLTOfN2ycanZK7y XmF+hTWN8dzwiyTEhFMxcTNEs12RQx0n3Ui3q/Cxh19dbCIdJvFR1rXRvwefkQlu TO9OESV+tVWEmv84ZxuSEmFbIWbwhK3t2I2NzAnT8OuTbpd6T5JORbVyRSd0NIJN CQvtZTY4x9qWRbsolxOY8Dqe0pVE+7t3WHjAEvqRPakx+NHuFvn5tYV0k8/nNMyx FDRAVxXjYH8yMIV+xtFGOxNGcADWhRFDIPH/K7nM9EbUvbHbDaGJJ+R9uW+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1703608568; x=1703694968; bh=0wVVtb+qy9hL8thW38lhroP6MQKO KBNtLrukUB5igRM=; b=ostT0rwfwcxfFMYDKif43TdphkfMtXv6HUN3ttUge3c6 BsQMbO7ctw+IXSKNcjpUmsccE7PodfXggalVl9jyzMKvOeNrDJT6CEIfCMMk1pb2 l1L+DvEWFO8gDC1rZ/erFkU1Ihim93QBcRiPAGEljPIC1S9NU5AEVOIQNc6Ze+Yp /k1CviSBsJvoC7bYs2K7k21AZpBFlsJonjbl02cbGfOsWY9Izaumhw7fHrq3nOR+ Tw+/YoSNGpqFVy4hv90QD+DzX+QFVPLpGFaI+AKxRTdehzLzhmFjpaX5sa59U49s igJan3hFFvi+0n4mHE8ZzAV8B12yZ/YbccJsUnbknw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddvjedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvvefutgesth dtredtreertdenucfhrhhomhepvghquhgrlhdrmhhoohhntdefgeeisehfrghsthhmrghi lhdrtghomhenucggtffrrghtthgvrhhnpefhkedvheetteetgffhhedvtddvkeeludeiue fhieegkeeghfethfettdegieeujeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpegvqhhurghlrdhmohhonhdtfeegieesfhgrshhtmhgrihhlrd gtohhm X-ME-Proxy: Feedback-ID: i35d941ae:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 91F552D4007D; Tue, 26 Dec 2023 11:36:08 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1364-ga51d5fd3b7-fm-20231219.001-ga51d5fd3 MIME-Version: 1.0 Message-Id: In-Reply-To: <875y0mnydn.fsf@localhost> References: <7153af42-cfbe-45d6-bc77-7e6441484a08@app.fastmail.com> <875y0mnydn.fsf@localhost> Date: Tue, 26 Dec 2023 16:35:47 +0000 From: equal.moon0346@fastmail.com To: "Ihor Radchenko" Cc: emacs-orgmode@gnu.org Subject: Re: How can I use org-add-note with emacsclient? Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.26; envelope-from=equal.moon0346@fastmail.com; helo=out2-smtp.messagingengine.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.37 X-Spam-Score: -9.37 X-Migadu-Queue-Id: 0756A6759D X-Migadu-Scanner: mx12.migadu.com X-TUID: g7P9kU0bJfwX On Mon, Dec 25, 2023, at 14:35, Ihor Radchenko wrote: > equal.moon0346@fastmail.com writes: > >> I'm trying to figure out how to start a note (C-c C-z) on the currently clocked task from emacsclient. Here's what I have so far: >> ... >> emacsclient -s test -nw --eval '(progn (org-clock-goto) (org-add-note))' >> >> This seems to have no effect. Oddly, if I paste this into M-:, it works fine. I've tried a number of things with e.g. plain capture templates that run the above code :after-finalize, using call-interactively, etc. After a cursory reading through the info manual on interactivity I find I'm still a bit lost. Can anyone explain what I'm doing wrong and hopefully point me to the right manual page to read on this? > > `org-add-note' is implemented a bit awkwardly using post-command-hook, > which makes it work only interactively. > The hook does not trigger when you use --eval. That's why you are not > seeing the note buffer after running the above shell command. > > What you can do is manually call the function used to raise the note > buffer: > > emacsclient -nw --eval '(progn (org-clock-goto) (org-add-note) > (org-add-log-note))' Thanks, this works! I'm curious as to why though. Shouldn't something like call-interactively solve this problem too? I'm thinking it has something to do with how the command loop works that I don't understand.