From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MHpOIEdTPF/ebAAA0tVLHw (envelope-from ) for ; Tue, 18 Aug 2020 22:16:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uKc4HEdTPF/fEgAA1q6Kng (envelope-from ) for ; Tue, 18 Aug 2020 22:16:39 +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 EE9219404E0 for ; Tue, 18 Aug 2020 22:16:38 +0000 (UTC) Received: from localhost ([::1]:35156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k89uG-0000iG-7C for larch@yhetil.org; Tue, 18 Aug 2020 18:16:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k89ts-0000i9-83 for emacs-orgmode@gnu.org; Tue, 18 Aug 2020 18:16:12 -0400 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]:46298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k89tp-00021n-Vv for emacs-orgmode@gnu.org; Tue, 18 Aug 2020 18:16:11 -0400 Received: by mail-qt1-x82f.google.com with SMTP id o22so16363029qtt.13 for ; Tue, 18 Aug 2020 15:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=fXi/Cx+OuORB1lw5N6qLQ9Zq1NI//msXRlEgJEeLA5E=; b=hDPqGzABFqJEAGc4KbhfVu2V9lhcr+MC6eYqJPb0WxTETKq/UtG0XkCKPp9H95s3fm xKxT/DOB6stzQvcBNWzB9Eop1SU+MzogL2/svV7D5JsNgCn57xxYfg9haIVlN5oy9Wsc twXoFNpcXOvPaJD7hA3GsV8cc2XPMIFhr2XrgMuRwW3tLiTd884iP6esG47ualae+xX7 /q50bfx7E4HNv6sYxhVIKbXoX3t8vRyLN5ElXEjADIydx9q4OvCdAxm8v1zhe+AffIk7 ki4JiJ7e4iW3Df1x48buI4pwLP+kWC1sc5RUPWvrdPURUDOpJorpQvLejljzlJB+vvp0 NilQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=fXi/Cx+OuORB1lw5N6qLQ9Zq1NI//msXRlEgJEeLA5E=; b=pVOc6iXlzuBJvwPcHx/oe19PpcSdb8w9Rb4jgA/CJf8TuG1D/UUiiJ2ywfwhDl9gzz XMj2XajALcLPG2zabdtkLzJ601gIlyV2V/aHl5ex9KQ6eCH5CvmCIQvtsTN2m6tTjR+e KZkV3AFxZEbQorcxRbO6UqdNTAYpX6dlbuYZOq+vBw2loG00GNEQ6pC1DLu90Gy/3iLs 5eAS9Vs9QxZPcP/rTkI7kJKX4wT9kLI4u4tj7eiyTxhPuqdgnhbb3F4klMu/ijShRuVt zuPjYmSGausz/a05Us9mh2NIF9GlxZnh4PDjyWzWdxNOV8LI04rlWUqza4XIWSaVbx75 flSw== X-Gm-Message-State: AOAM5330SDbUDhGG6bWZ6RUPDTqRtNK0o1Bgiklnc/+8piXzmMv+0f7U 1uBaiJ2jxt7Rb6gpbPJbSMOwvRGWy6KNmQ== X-Google-Smtp-Source: ABdhPJwFc+EG4XnzWl/RcBEz+ER5NMUJ3nv7kGEdCUle8hPkKijI9pR2ccp0fdxUtOUvHauyj1DX6A== X-Received: by 2002:ac8:454f:: with SMTP id z15mr19188990qtn.351.1597788967437; Tue, 18 Aug 2020 15:16:07 -0700 (PDT) Received: from arch ([2601:8b:c300:1024:1266:d0ff:1635:f964]) by smtp.gmail.com with ESMTPSA id k1sm22029094qkf.12.2020.08.18.15.16.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 15:16:06 -0700 (PDT) User-agent: mu4e 1.5.5; emacs 28.0.50 From: No Wayman To: emacs-orgmode@gnu.org Subject: [PATCH] org-add-planning-info: respect caller's given time [9.3.7 (release_9.3.7-716-g3d4876 @ /home/n/.emacs.d/straight/build/org/)] Date: Tue, 18 Aug 2020 18:16:05 -0400 Message-ID: <87zh6rfvmi.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::82f; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qt1-x82f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=hDPqGzAB; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -1.71 X-TUID: DJYH5Ttn3caB --=-=-= Content-Type: text/plain; format=flowed The current behavior of `org-add-planning-info' does not include the time of day when it is passed the TIME argument. This is because `org-time-was-given' is initially let-bound to nil during the scope of the function. The attached patch removes that binding and allows the caller to pass the time of day in the above case. An example use case I use with org-capture templates: (defun +org-schedule-relative-to-deadline () "Prompt for optional deadline, then an optional schedule time. The scheduled default time is the deadline." (interactive) (condition-case nil (org-deadline nil) (quit nil)) (let ((org-overriding-default-time (or (org-get-deadline-time (point)) org-overriding-default-time))) ;; works with patch, but without it the time of day is not included in timestamp. (org-schedule nil (org-read-date 'with-time 'to-time nil "SCHEDULE: " org-overriding-default-time)))) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-add-planning-info-caller-time.patch Content-Description: org-add-planning-programmatic-time-of-day >From 2b0840a3963a16b4b92bfdad794a1327aa6f8bd4 Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Tue, 18 Aug 2020 17:09:50 -0400 Subject: [PATCH] org: (org-add-planning-info): Respect caller's `org-time-was-given' value * lisp/org.el (org-add-planning-info): Respect caller's `org-time-was-given' value Allows programmatically passing a time of day to `org-schedule'. e.g. if one wanted to schedule a task relative to its DEADLINE time of day: (org-schedule nil (org-read-date t t nil "SCHEDULE: " (org-get-deadline-time (point)))) --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index fb95590fc..aabdaebb9 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10605,7 +10605,7 @@ among `closed', `deadline', `scheduled' and nil. TIME indicates the time to use. If none is given, the user is prompted for a date. REMOVE indicates what kind of entries to remove. An old WHAT entry will also be removed." - (let (org-time-was-given org-end-time-was-given default-time default-input) + (let (org-end-time-was-given default-time default-input) (when (and (memq what '(scheduled deadline)) (or (not time) (and (stringp time) -- 2.28.0 --=-=-=--