From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mB4VIKMII2Pm2QAAbAwnHQ (envelope-from ) for ; Thu, 15 Sep 2022 13:12:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cBMRIKMII2N3egEAauVa8A (envelope-from ) for ; Thu, 15 Sep 2022 13:12:35 +0200 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 F37CE38CD9 for ; Thu, 15 Sep 2022 13:12:34 +0200 (CEST) Received: from localhost ([::1]:45414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYmnJ-0007bc-Oh for larch@yhetil.org; Thu, 15 Sep 2022 07:12:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYmmS-0007bR-Qr for emacs-orgmode@gnu.org; Thu, 15 Sep 2022 07:11:40 -0400 Received: from ciao.gmane.io ([116.202.254.214]:46582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYmmQ-0004QW-MY for emacs-orgmode@gnu.org; Thu, 15 Sep 2022 07:11:40 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oYmmN-0002ax-Gf for emacs-orgmode@gnu.org; Thu, 15 Sep 2022 13:11:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Angel de Vicente Subject: Re: Do not show a TODO item in the global TODO list until certain date? Date: Thu, 15 Sep 2022 12:11:28 +0100 Message-ID: <87sfksq4db.fsf@gmail.com> References: <87a672gv9y.fsf@gmail.com> <59454a70-bf7f-40e3-a3d8-d9e7fc66da4d@www.fastmail.com> <87wna66xr4.fsf@gmail.com> <87fsguxhco.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) Cancel-Lock: sha1:w3p6Jisp+OuD2/R+GOmKmmFUI78= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663240355; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=nle7NW6ZF0cO/9e50jzShTdqzFyH8NI8bG2Bd4Reiz0=; b=jzY4pPvP3HBze+KT7cQIc0Py68ZMcSCV4rNBv41Sm9NFJmHo27UGiOYq+QN+rlrwXBbu7i L51xz2CIkOKv6UgENsizg0KOOx7yJuocrlvhfdr6kfCCZiFXhG2y242EpZFrZsc1GhVXFw mOalRUW6D5hfPD2yheQwizB8KLJz3L8NhyCx5/oyZkHwPttUTMQnrrISs29KvvU/PGU0T3 A+ZM2YQhIreE6LtnbVsQ8863O0DuglJ6eNWwKlxhjgCQYnaPMHJLqeeawA9X77CTiTk47R FBgyAmQj+xM3SOyg3wq3qz2eO2lXOQoYLG7/ok62F3GDb38wltXiNq/l4Ie+HA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663240355; a=rsa-sha256; cv=none; b=dzE8HAmxYmIg5UHvOqSiEUsVDn1rjKzgMwTDyg0OPUPByDzWjeQ7oVDdsBkrSxEYxTdGR3 ASZx0JrY9oaYdIspoTfBLGl6dic+o0fB99V+BNfNZW7NeY1HORKUG350kxzLFRg7O3rlTz /sGr9unEac9ebUWgVGudsGD262mRwEW25AZxPRidHpmklTIo4XnxFN/EMdoovIxczP0wwh aKZad8l2CxYrTSc+IVjxXhpFFAzHdi4QWAGinc4Ve8Lw/DEi5SmI9aHXQARDQkCCKrO2ev /79LSbXzDUoqIUT4e9i56IkL0SGrQCQdzH36NLWFJ0oSOukNEmXyjMkzxGhHVA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 3.87 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: F37CE38CD9 X-Spam-Score: 3.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: DSG0RALGKJdk Hello, Ihor Radchenko writes: > Also, I am doing something similar in my personal config using > SHOWFROMDATE property. See > https://github.com/yantar92/emacs-config/blob/master/config.org#properties > for inspiration. I tried the following but without success... my Emacs Lisp lack of knowledge is showing here... I copied your code from https://github.com/yantar92/emacs-config/blob/master/config.org#properties into my .emacs and eval-ed it. ,---- | (add-to-list 'org-default-properties "SHOWFROMDATE") | (bind-key "C-c C-f" #'org-command-set-SHOWFROMDATE-property org-mode-map) | (bind-key "C-c C-f" #'org-command-set-SHOWFROMDATE-property org-agenda-mode-map) | (add-to-list 'org-agenda-bulk-custom-functions '(?F org-command-set-SHOWFROMDATE-property)) | | (defun org-command-set-SHOWFROMDATE-property (&optional arg) | "Command to set :SHOWFROMDATE property for the org entry at point. | If NOT-IN-AGENDA is not nil, do not check whether we are in agenda now." | (interactive "P") | (if (equal major-mode 'org-agenda-mode) | (progn | (org-agenda-check-no-diary) | (let* ((marker (or (org-get-at-bol 'org-marker) | (org-agenda-error))) | (buffer (marker-buffer marker)) | (pos (marker-position marker)) | (inhibit-read-only t) | ts) | (org-with-remote-undo buffer | (with-current-buffer buffer | (widen) | (goto-char pos) | ;; (org-fold-show-context 'agenda) | (funcall-interactively 'org-command-set-SHOWFROMDATE-property arg) | (setq ts (org-entry-get (point) "SHOWFROMDATE"))) | (org-agenda-show-new-time marker ts " P")))) | (let ((property "SHOWFROMDATE")) | (if (equal arg '(4)) | (org-entry-delete (point) property) | (let ((value (org-read-property-value property)) | (fn (cdr (assoc-string property org-properties-postprocess-alist t)))) | (setq org-last-set-property property) | (setq org-last-set-property-value (concat property ": " value)) | ;; Possibly postprocess the inserted value: | (when fn (setq value (funcall fn value))) | (unless (equal (org-entry-get nil property) value) | (org-entry-put nil property value))))))) | | (defun org-set-SHOWFROMDATE-property (PROMPT &rest args) | "Read :SHOWFROMDATE: property." | (org-read-date nil nil nil PROMPT)) | | (add-to-list 'org-property-set-functions-alist '("SHOWFROMDATE" . org-set-SHOWFROMDATE-property)) | | (defun org-agenda-skip-before-SHOWFROMDATE-property () | "Skip agenda item if :SHOWFROMDATE: property is set and the day is before it" | (when-let* ((showfromdate (if (bound-and-true-p org-ql--current-element) | (org-element-property :SHOWFROMDATE (org-element-lineage org-ql--current-element '(headline) t)) | (org-entry-get (point) "SHOWFROMDATE"))) | (showfromdate (unless (seq-empty-p showfromdate) (ts-parse-org showfromdate))) | (currenttime (ts-now))) | (ts< currenttime showfromdate))) `---- Then, I defined a test custom command: ,---- | (setq org-agenda-custom-commands | '(("h" "Agenda and tasks" | ((agenda "" ((org-agenda-skip-function 'org-agenda-skip-before-SHOWFROMDATE-property))) | (alltodo "" ((org-agenda-skip-function 'org-agenda-skip-before-SHOWFROMDATE-property))))))) `---- together with a test TODO item: ,---- | ** TODO test :personal: | | :PROPERTIES: | :SHOWFROMDATE: 2022-10-16 | :END: `---- But the "test" still shows in the TODO list. Am I missing something basic here? Thanks for your help. Cheers, -- Ángel de Vicente Research Software Engineer (Supercomputing and BigData) Instituto de Astrofísica de Canarias (https://www.iac.es/en)