Browse Source

Fix recent bug with timestamp properties

Matt Lundin writes

> I believe that commit b8e0d6fdb41f2165d675e89fcb54b741c971f6f4 broke
> accessing timestamps with the org-entry-get.
>
> With that commit, several functions I use to check whether an entry has
> a timestamp stopped working.
>
> In other words,
>
> (org-entry-get nil "TIMESTAMP_IA")
>
> or
>
> (org-entry-get nil "TIMESTAMP")
>
> always return nil, even if a timestamp exists.
>
> Strangely, the org-entry-properties alist includes values for TIMESTAMP
> and TIMESTAMP_IA.
>
> I tested this by evaluating the expressions in the sample entry below:
>
> --8<---------------cut here---------------start------------->8---
> * TODO Test							   :computer:
>  <2009-12-19 Sat>
>  [2009-12-19 Sat 17:47]
>
> (org-entry-get nil "TIMESTAMP_IA")
> (org-entry-get nil "TIMESTAMP")
> (org-entry-properties)
> --8<---------------cut here---------------end--------------->8---
Carsten Dominik 15 years ago
parent
commit
feb269826a
2 changed files with 8 additions and 1 deletions
  1. 5 0
      lisp/ChangeLog
  2. 3 1
      lisp/org.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2009-12-20  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-entry-properties): Add TIMESTAMP properties back
+	in.
+
 2009-12-18  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-all-time-keywords): New variable.

+ 3 - 1
lisp/org.el

@@ -12497,7 +12497,9 @@ things up because then unnecessary parsing is avoided."
 		    props))
 	    (when (or (not specific) (string= specific "TAGS"))
 	      (push (cons "BLOCKED" (if (org-entry-blocked-p) "t" "")) props))
-	    (when (or (not specific) (member specific org-all-time-keywords)) 
+	    (when (or (not specific)
+		      (member specific org-all-time-keywords)
+		      (member specific '("TIMESTAMP" "TIMESTAMP_IA")))
 	      (while (re-search-forward org-maybe-keyword-time-regexp end t)
 		(setq key (if (match-end 1) (substring (org-match-string-no-properties 1) 0 -1))
 		      string (if (equal key clockstr)