From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oOLAKjOVLGC0AQAA0tVLHw (envelope-from ) for ; Wed, 17 Feb 2021 04:01:55 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qN6TJjOVLGCJbgAA1q6Kng (envelope-from ) for ; Wed, 17 Feb 2021 04:01:55 +0000 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 EEC441A2A1 for ; Wed, 17 Feb 2021 05:01:54 +0100 (CET) Received: from localhost ([::1]:60120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCE2D-0005qb-3l for larch@yhetil.org; Tue, 16 Feb 2021 23:01:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCE1b-0005q6-6q for emacs-orgmode@gnu.org; Tue, 16 Feb 2021 23:01:15 -0500 Received: from out0.migadu.com ([94.23.1.103]:40211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCE1X-0000i4-6e for emacs-orgmode@gnu.org; Tue, 16 Feb 2021 23:01:14 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1613534465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XIGpKO5Cnxkj7tCT1yWZzGUBmBpK43DoasU/kBkhmlo=; b=aY2v350iUWpj32+q+eoioX2t3Yy3PPnKIPMc7QoQPPzC7tSTr2BYlR0IPiYVz9ZEs1n+cs ns/CRtTFPbDx7xUY2q9yoThdYIwDhTz+DrUukp6mrnZOjnKe5bFwN/0XvMTXbRjFPRpoRR ddkE7lj+ytnNAIoCwR1CW8/WH+qs1zrPYLiTUpH0kKeuPcxpBywFb8DA9eW0MhMfNnd3TF aQ1lPCDQKxCGLfYZpRTPF42cmV/p/Rmv0RdWt+Ix+3hJoCdWenKWQd31oJGhcPmSEVCr4g lOfx9V8ONB1kHqFaMMjlznhLCvNlV5+GQj8wgdPXFLLn3t96Dh9xsRjBGZod4A== From: Kyle Meyer To: Alan Schmitt Subject: Re: org-agenda for a day different than today In-Reply-To: <87pn10t83u.fsf@m4x.org> References: <87pn10t83u.fsf@m4x.org> Date: Tue, 16 Feb 2021 23:01:03 -0500 Message-ID: <87pn0ztkao.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Auth-User: kyle@kyleam.com Received-SPF: pass client-ip=94.23.1.103; envelope-from=kyle@kyleam.com; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=aY2v350i; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: EEC441A2A1 X-Spam-Score: -2.56 X-Migadu-Scanner: scn1.migadu.com X-TUID: VRPfuX/pvjbL Alan Schmitt writes: > I=E2=80=99ve been reading the documentation around org-agenda, and I cann= ot find > a way to call it to get an agenda for a day different than today. I=E2=80= =99ve > found org-agenda-goto-date, but I don=E2=80=99t know how to call it from > emacs-lisp with the target date. > > By the way, I=E2=80=99m surprised by the code of this function, as it is = defined > as: > > (defun org-agenda-goto-date (span) > "Jump to DATE in agenda." > =E2=80=A6 > ) > > and "span" is never mentioned in the function. Am I missing something? That does look wrong. Among other changes, 93fcfe4d3 (org-agenda.el: Fix org-agenda-goto-date' again, 2012-08-30) switched the DATE argument to SPAN, moving the org-read-date call out of the interactive form. >From that commit alone, I don't have a good guess at why and am wondering if the above change was an unfinished thought that came along with the other changes. Here are two threads from around that time that may be related, though I haven't reviewed either of them: https://orgmode.org/list/BLU0-SMTP912FC379760EE431D3D68EBBBC0@phx.gbl/T/#u https://orgmode.org/list/BLU0-SMTP950E9387B34FA390C4FD9CBBBD0@phx.gbl/T/#u Moving org-read-date back to the interactive form would allow lisp callers to pass in the date, though perhaps it'd bring back some misbehavior discussed in the above threads. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 9b2009fdb..aef642037 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8238,13 +8238,13 @@ (defun org-agenda-manipulate-query (char) (defun org-add-to-string (var string) (set var (concat (symbol-value var) string))) =20 -(defun org-agenda-goto-date (span) +(defun org-agenda-goto-date (date) "Jump to DATE in agenda." - (interactive "P") - (let* ((org-read-date-prefer-future - (eval org-agenda-jump-prefer-future)) - (date (org-read-date)) - (day (time-to-days (org-time-string-to-time date))) + (interactive + (list + (let ((org-read-date-prefer-future org-agenda-jump-prefer-future)) + (org-read-date)))) + (let* ((day (time-to-days (org-time-string-to-time date))) (org-agenda-sticky-orig org-agenda-sticky) (org-agenda-buffer-tmp-name (buffer-name)) (args (get-text-property (min (1- (point-max)) (point)) 'org-last-args))