emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] Agenda no longer works for timestamps inside properties drawer


From: Ignacio Casso
Subject: Re: [BUG] Agenda no longer works for timestamps inside properties drawer [9.5.2 (release_9.5.2-24-g668205 @ /home/ignacio/repos/emacs/lisp/org/)]
Date: Tue, 22 Mar 2022 00:21:10 +0100
User-agent: mu4e 1.6.10; emacs 27.2

>> What you see in the new Org version is not a bug. Property values are
>> treated as plain text by Org.
>>
>> I was unable to find a place in manual describing that timestamps cannot
>> be placed inside property values:

>> I personally see allowing timestamps (and links) inside property values as a 
>> useful feature.
>> Would it be of interest for other users?
>
> Yes, it's a quite useful feature. For years, via my Capture templates, I've 
> been adding a property named :Created: to the properties drawer as follows:
>
> :PROPERTIES:
> :Created:  <2022-03-06 Sun 22:42>
> :END:
>
> Now, in 9.5.2, literally hundreds of entries that formerly appeared on the 
> built-in Agenda views cannot be easily found.


It seems that I'm not the only one using this unintended feature in
previous versions of org, and probably there will be many others who
don't use the latest version of org and have not noticed yet but will
have the same problem when they upgrade.

I think that even if timestamps were never intended to be used inside
property drawers before, the fact that it worked for a long time and
nothing in the documentation suggested otherwise makes it a de facto
feature, even if unintended, and should be preserved.

I've located the line in org-agenda.el responsible of the new behavior,
and the following patch seems to fix it. I suggest it is incorporated
into the repository, maybe with a variable
org-agenda-skip-timestamps-in-properties-drawer defaulting to t if not
everyone agrees.

>From 7a27ecd65aa6fea4240756d773c8efe8c4d506fd Mon Sep 17 00:00:00 2001
From: Ignacio <ignacio.decasso@imdea.org>
Date: Tue, 22 Mar 2022 00:18:05 +0100
Subject: [PATCH] fixed

---
 lisp/org/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org/org-agenda.el b/lisp/org/org-agenda.el
index ae0058e037..796b98201d 100644
--- a/lisp/org/org-agenda.el
+++ b/lisp/org/org-agenda.el
@@ -5732,7 +5732,7 @@ org-agenda-get-timestamps
                    (org-before-first-heading-p)
                    (and org-agenda-include-inactive-timestamps
                         (org-at-clock-log-p))
-                    (not (eq 'timestamp (org-element-type 
(org-element-context)))))
+                    (not (memq (org-element-type (org-element-context)) 
'(timestamp node-property))))
            (throw :skip nil))
          (org-agenda-skip))
        (let* ((pos (match-beginning 0))
-- 
2.25.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]