From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id OEqTJm8PSmbBBQAAe85BDQ:P1 (envelope-from ) for ; Sun, 19 May 2024 16:40:47 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id OEqTJm8PSmbBBQAAe85BDQ (envelope-from ) for ; Sun, 19 May 2024 16:40:47 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b=TNXe+TeN; dmarc=pass (policy=quarantine) header.from=iro.umontreal.ca; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716129647; a=rsa-sha256; cv=none; b=qaNK8A+bvRxvFH7YnxBaJ2xOUup6h/taI6p+VGedTY3Djcpn0j70WHf0cPXSgqD/CUyepj DlmvKLscLatGCj2YinTm5pDPgoDv3YBMBbnSVysDJz+OFJXUaO3eZ7EAXtczsZgeMpDi2t 7yyTF9CibPNp3by9Qbjj3/qLcrjmiQFuIKtVUSlc5fKDQtVjV/4y4VU9jgxxhHybZAVwqI Cs2XxDPC9HS2bOy8/UNwfjUR6h2MZIxxmZiu4OpinaTHk9zGJJ/KjqKnJlBmqaOYWHv3Zv PDnjHENY94YHsfMw7VcQgZNBSmzdu1IkzRC3nWIEcUEIcWAh5MJvA5ngq61LIw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=iro.umontreal.ca header.s=mail header.b=TNXe+TeN; dmarc=pass (policy=quarantine) header.from=iro.umontreal.ca; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716129647; 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=a5ONmhY6KVGfqD3WEnkctbHixaUKVBIXn0sO4J+gIDw=; b=LrI+60g3/UsDE3qh0MlmBGp823qu2/JDNIghjagmTkwpNDd8pMGgj005X/dSm1YwEt/Jxf pz7WIt2IYabMWo9TaIbfFL4o3n46G5Ps6a/pvp4qLIEBmCJ/KImpb2wuqtHDB+AwDu9eYt oYXbpGTuykZ0k94irPXLD5CQ0vNIjeYCzuq6Q2ScU34kV3baZ0JC1u4sVPEu9ArNaEcTao DPiR5hHoHzuRIa2aQFOW0sryXWojpyGJFiDhrPPeUkgybXsbt/vdSqes5Ev+sRuO/jd8kE y7o0c0ELQEaj3zvlDMKlSlk2kk8YkY35nSy3ualxoRSZkpwVAKpl9rolE43VsA== 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 E75AC22F3F for ; Sun, 19 May 2024 16:40:46 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8hht-0004DR-In; Sun, 19 May 2024 10:40:13 -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 1s8hhn-0004DE-3V for emacs-orgmode@gnu.org; Sun, 19 May 2024 10:40:08 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8hhl-0002ao-AT for emacs-orgmode@gnu.org; Sun, 19 May 2024 10:40:06 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5AFE280AA7; Sun, 19 May 2024 10:40:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1716129602; bh=n5xFR97PGWnOreX2kp6nSri6A9/1an3EnEiF4tR5Lx8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TNXe+TeNbYF1dvZBuN3IIbATW4CRKzPELCPa+7He2H1f7Vm5G3UQxS20RLngMLdpH UXnlFUwdD8+fXnU8lgCnm67BmiqYvgQZO0HBH6rrOlOVZ6Le/KU+yZcFbn3IinRSqg iuBsCy+r2nza/yQBixjZelqaBanujDleWnfJiL+4Ad132eNOeUq21jqy3ujF7uoDiy 2O1C/orvIjkZiRwsYyswZVV+iXEL7dV/xG7f+m6sXEGx1MUzaIDj/W0WWtzwAYGB3F Skg8ARB9HGhNj2vRrht0EDo8lVphoSd/UPHlmwGZZACYT3mxADWP59A9cNTb9QKKyB f1A7pmYTtPGaw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2880A8091C; Sun, 19 May 2024 10:40:02 -0400 (EDT) Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 02800120611; Sun, 19 May 2024 10:40:01 -0400 (EDT) From: Stefan Monnier To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: Saving some kitten, plus some questions along the way In-Reply-To: <87ikza3thi.fsf@localhost> (Ihor Radchenko's message of "Sun, 19 May 2024 11:56:41 +0000") Message-ID: References: <87ikza3thi.fsf@localhost> Date: Sun, 19 May 2024 10:40:01 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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-Migadu-Queue-Id: E75AC22F3F X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -12.08 X-Spam-Score: -12.08 X-TUID: WW5JSTnvdSI3 >> - (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. I understand it's important in general, but the question is for this specific use of `org-funcall-in-calendar` where all we do (apparently) is to set `cursor-type` which shouldn't require any change to the overlay (nor does it require to `select-window`), or should it? Along the same lines, maybe: (progn (calendar-forward-day (- (time-to-days org-def) (calendar-absolute-from-gregorian (calendar-current-date)))) (org-funcall-in-calendar #'ignore t) (let* ((old-map (current-local-map)) (map (copy-keymap calendar-mode-map)) (minibuffer-local-map should turn into something like: (let ((days (- (time-to-days org-def) (calendar-absolute-from-gregorian (calendar-current-date))))) (org-funcall-in-calendar #'calendar-forward-day t days) (let* ((old-map (current-local-map)) (map (copy-keymap calendar-mode-map)) (minibuffer-local-map so it's clear why we need to use `org-funcall-in-calendar`? >> -(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. [ Hmm... in my book, writing `lambda` should not be considered awkward. ] So far there are only two uses of `org-funcall-in-calendar` which go through `lambda`, one of them is quoted and discussed above and the other is the backward compatibility wrapper `org-eval-in-calendar`, so I'm not sure it's worth the trouble. But if you want, I can include a macro for it, of course. Stefan