From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id CGDTFMXoSWaq5AAAe85BDQ:P1 (envelope-from ) for ; Sun, 19 May 2024 13:55:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id CGDTFMXoSWaq5AAAe85BDQ (envelope-from ) for ; Sun, 19 May 2024 13:55:49 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=OwsACsPy; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716119749; 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=Ava9FTdNf0W5SZB9nwrjCIrj4GP293YVaJy0nCEzaFE=; b=sSOuiqLJ8yHuB2y2U0nXnQneX5R/Kd3MXxaJ2O0J3PsL8Y400RcCEdr2hEj31Se+QLGfDi rmm6QvZP8gX3et3YuMhLTl3/PUSEfHWiuBUWNpW2MkW7VR5QSaGiq1/IV9Qzqv81Jneviv PUlCEIooEjen3O1Srq3sHRNgzXHN5aE5QLbEJ0RN8bMVCUEuj2gFmszAAAm0V4mTmtUTpR QNm/2cze0tK9CL/8aCrTxQ0ov1tRsnjM+TazYzGP+A2wSyUWjCaVc/rYXon02YnbiNOYSb jMwMepnlPy3fWKt4fIA+R4nIXDvMPvLbkeN7x85lwVATH5VRwk2TZbQmtqw8/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=OwsACsPy; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716119749; a=rsa-sha256; cv=none; b=QcNG2Gac3NVg/u7UdF2oxfJi/F8C+7XMLQKqsfPEximEQueQSdhITZR2+MqUraYkf4LC+C UpF6DrfcPuRzSz43+CZeWREvs09RnkNDrLsJRcG0uc0Y0YLA+z32j5KQEmHEOq/WFNSOOs 1kS1E9q5j2gDzHZbJBHkq9wwWdyIbINhSgammjO33PC4LLDTKxHV8qw+zOkP00BsrCWf0q Qmjakkm7tOmjCv969N/Df3f5eRlmrXbaErKVF6mzNhyCLy0HwFE0kOLSg6SliBotz3QRB6 pryjhX9EU31Eo5Q95JV3/JlUhJPy47j5/QsXAuEKNFTlG/Ol7jEiAMTSQ94U8w== 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 1AE5ADDD1 for ; Sun, 19 May 2024 13:55:48 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8f84-0006ix-Gi; Sun, 19 May 2024 07:55:04 -0400 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 1s8f83-0006ip-AE for emacs-orgmode@gnu.org; Sun, 19 May 2024 07:55:03 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8f81-0003l4-A9 for emacs-orgmode@gnu.org; Sun, 19 May 2024 07:55:03 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id EE714240101 for ; Sun, 19 May 2024 13:54:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1716119699; bh=PtVTwraqwA5zcHfc43dv4/6SfvL8990jEkiwZdwpjlk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=OwsACsPyv7IoCrzLsv9xYlfYbsjqwlSQDnacnAXdTP88PIUaNt4scVnoZ8YVxu2JA 3JyK4lGkPAUmmpPzAQwFlADu9+nuDCJvPMiUnJL6U+MVahc6TAwwn631PIOgZ7Vppm aS1+OdQRvrp4yCJTN19T5A3z3KhqHx9vtUmpmlAs7OU4ZD8P2W1bzdbV9vGVZsDPow yTfi8t1PzBZhgBr9q1nnBaXdgK/RGk/J0ILySU1WBBO9v8hF+h7TwugIhebYzDxMdA HFpo/E//JuuPvYlNAdILudF7AstmpS6Bu/zZFtO/vqXWquoxX07G/PKAa2F14Dp0bu AlhGGqD8TvpNQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Vhzdt36Tlz6tyY; Sun, 19 May 2024 13:54:57 +0200 (CEST) From: Ihor Radchenko To: Stefan Monnier Cc: emacs-orgmode@gnu.org Subject: Re: Saving some kitten, plus some questions along the way In-Reply-To: References: Date: Sun, 19 May 2024 11:56:41 +0000 Message-ID: <87ikza3thi.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -8.84 X-Migadu-Queue-Id: 1AE5ADDD1 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -8.84 X-TUID: mPyIxBIkZLmT Stefan Monnier writes: > The patch below replaces a use of `eval` with `apply`, but along the way > I wondered about some of the details of `org-eval-in-calendar` (see the > FIXMEs), the most important of them being: why doesn't it use > `with-selected-window`? Thanks! I do not see any clear reason. Just old code from early days of Org mode. > - (org-eval-in-calendar '(setq cursor-type nil) t) > + ;; FIXME: Could we use `with-current-buffer' or do we really > + ;; need the `move-overlay' that's in `org-funcall-in-calendar'? > + (org-funcall-in-calendar (lambda () (setq cursor-type nil)) t) `move-overlay' is important - this is additional decoration that Org mode uses to indicate "current" date in the calendar while the focus is on other window and the cursor may not be clearly visible. > -(defun org-eval-in-calendar (form &optional keepdate) > - "Eval FORM in the calendar window and return to current window. > +(defun org-funcall-in-calendar (func &optional keepdate &rest args) > + "Call FUNC in the calendar window and return to current window. Why not a macro? Having to write lambda may be awkward. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at