summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-01-24 22:01:19 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-01-24 22:01:19 +0100
commitc77b658b39236a45cb9e10e0e44ddfe18e06ee81 (patch)
tree71757520e68eee801d61f22c249681758a5de7cf
parent9f4c77cb6c76b75f76f64f438a1da059bb9b7244 (diff)
downloadorg-mode-c77b658b39236a45cb9e10e0e44ddfe18e06ee81.tar.gz
Fix `org-entry-get' with "TIMESTAMP" or "TIMESTAMP_IA"release_9.0.4
* lisp/org.el (org-entry-properties): Fix special property value in current entry, do not leak into next entry. * testing/lisp/test-org.el (test-org/entry-properties): Add test. Reported-by: Samuel Wales <samologist@gmail.com> <http://permalink.gmane.org/gmane.emacs.orgmode/111648>
-rw-r--r--lisp/org.el5
-rw-r--r--testing/lisp/test-org.el7
2 files changed, 8 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el
index cf3a889..27f68eb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15975,12 +15975,11 @@ strings."
;; First look for timestamps within headline.
(let ((ts (funcall find-ts (line-end-position) nil)))
(if (= (length ts) 2) (setq props (nconc ts props))
- (forward-line)
;; Then find timestamps in the section, skipping
;; planning line.
- (when (looking-at-p org-planning-line-re)
- (forward-line))
(let ((end (save-excursion (outline-next-heading))))
+ (forward-line)
+ (when (looking-at-p org-planning-line-re) (forward-line))
(setq props (nconc (funcall find-ts end ts) props))))))))
;; Get the standard properties, like :PROP:.
(when (memq which '(nil all standard))
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 32cd441..113114f 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -4392,7 +4392,12 @@ Paragraph<point>"
(should
(equal "[2014-03-04 tue.]"
(org-test-with-temp-text "* Entry\n<2012-03-29 thu.>[2014-03-04 tue.]"
- (cdr (assoc "TIMESTAMP_IA" (org-entry-properties nil "TIMESTAMP_IA"))))))
+ (cdr (assoc "TIMESTAMP_IA"
+ (org-entry-properties nil "TIMESTAMP_IA"))))))
+ (should-not
+ (equal "<2012-03-29 thu.>"
+ (org-test-with-temp-text "* Current\n* Next\n<2012-03-29 thu.>"
+ (cdr (assoc "TIMESTAMP" (org-entry-properties))))))
;; Get standard properties.
(should
(equal "1"