diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-05-14 10:25:13 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-05-14 10:25:13 +0200 |
commit | cbbe00e30eb0b911b14e45d7cea9e972c5e76b28 (patch) | |
tree | 7e8c83ce11cec936f2fb0d9dc4119a045b87a123 | |
parent | de2a8b31e4ec61de5806421d6d4eec299a78d2a5 (diff) | |
download | org-mode-cbbe00e30eb0b911b14e45d7cea9e972c5e76b28.tar.gz |
org-element: Do not parse timestamps within planning line
* lisp/org-element.el (org-element-context): Do not parse timestamps
within planning line.
* testing/lisp/test-org-element.el (test-org-element/context): Remove test.
Strictly speaking, timestamps within planning lines are parameters
values that use timestamp syntax, not real timestamps belonging to the
document contents.
-rw-r--r-- | lisp/org-element.el | 11 | ||||
-rw-r--r-- | testing/lisp/test-org-element.el | 9 |
2 files changed, 0 insertions, 20 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el index 12a4bc6..bbe430b 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -5867,17 +5867,6 @@ Providing it allows for quicker computation." (or (< pos cend) (and (= pos cend) (eobp)))) (narrow-to-region cbeg cend) (throw 'objects-forbidden element)))) - ;; At a planning line, if point is at a timestamp, return it, - ;; otherwise, return element. - ((eq type 'planning) - (dolist (p '(:closed :deadline :scheduled)) - (let ((timestamp (org-element-property p element))) - (when (and timestamp - (<= (org-element-property :begin timestamp) pos) - (> (org-element-property :end timestamp) pos)) - (throw 'objects-forbidden timestamp)))) - ;; All other locations cannot contain objects: bail out. - (throw 'objects-forbidden element)) (t (throw 'objects-forbidden element))) (goto-char (point-min)) (let ((restriction (org-element-restriction type)) diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index 3e43938..a96d35a 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -3417,15 +3417,6 @@ Text (eq 'table-cell (org-test-with-temp-text "| a | b<point> {{{macro}}} |" (org-element-type (org-element-context))))) - ;; Find objects in planning lines. - (should - (eq 'timestamp - (org-test-with-temp-text "* H\n SCHEDULED: <2012<point>-03-29 thu.>" - (org-element-type (org-element-context))))) - (should-not - (eq 'timestamp - (org-test-with-temp-text "* H\n SCHEDULED<point>: <2012-03-29 thu.>" - (org-element-type (org-element-context))))) ;; Find objects in item tags. (should (eq 'bold |