diff --git a/lisp/org.el b/lisp/org.el index bf330d6b6..cbbaed333 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15887,12 +15887,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 180f216da..0c1caa8f1 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -4469,7 +4469,12 @@ Paragraph" (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"