[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible bug with columnview and active dates
From: |
Kyle Meyer |
Subject: |
Re: Possible bug with columnview and active dates |
Date: |
Sun, 10 May 2020 20:11:46 +0000 |
Kyle Meyer writes:
>> According to the docs:
>> https://orgmode.org/manual/Special-Properties.html#Special-Properties
>> Using DEADLINE or SCHEDULED should not include the angular brackets.
>
> Thanks for the report. There is certainly a document/code mismatch.
> Digging a bit, it seems that brackets started being included quite a
> while ago: 8d8ad9838 (Rewrite `org-entry-properties', 2014-09-30). I
> didn't spot anything in that commit that suggests that it was an
> intended change.
While I think it's be fair to consider this a regression, I'm leery of
restoring the original behavior of stripping the brackets given how long
the current behavior has been around. Instead I think it'd be better to
update the documentation and tweak the output on colview's end.
However, for the record, when I restored this behavior locally, here
were the adjustments needed to make the tests pass. (Of course,
restoring the behavior likely introduces other issues that are not
caught be the tests, not to mention third-party code that relies on
brackets being included.)
diff --git a/lisp/org.el b/lisp/org.el
index 4d1a6a6b4..18a358c85 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10817,7 +10817,7 @@ (defun org-auto-repeat-maybe (done-word)
;; a SCHEDULED time-stamp without one is removed, as they are no
;; longer relevant.
(save-excursion
- (let ((scheduled (org-entry-get (point) "SCHEDULED")))
+ (let ((scheduled (format "<%s>" (org-entry-get (point) "SCHEDULED"))))
(when (and scheduled (not (string-match-p org-repeat-re scheduled)))
(org-remove-timestamp-with-keyword org-scheduled-string))))
;; Update every time-stamp with a repeater in the entry.
@@ -13145,7 +13145,8 @@ (defun org-entry-properties (&optional pom which)
(skip-chars-forward " \t")
(and (looking-at org-ts-regexp-both)
(push (cons (car pair)
- (match-string-no-properties 0))
+ (match-string-no-properties
+ (if (equal (car pair) "CLOSED") 0 1)))
props)))))))
(when specific (throw 'exit props)))
(when (or (not specific)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 29ac0a8f9..fe07ea7e3 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -5201,12 +5201,12 @@ (ert-deftest test-org/entry-properties ()
(cdr (assoc "CLOSED" (org-entry-properties nil "CLOSED")))))
(should
(equal
- "<2014-03-04 tue.>"
+ "2014-03-04 tue."
(org-test-with-temp-text "* H\nDEADLINE: <2014-03-04 tue.>"
(cdr (assoc "DEADLINE" (org-entry-properties nil "DEADLINE"))))))
(should
(equal
- "<2014-03-04 tue.>"
+ "2014-03-04 tue."
(org-test-with-temp-text "* H\nDEADLINE: <2014-03-04 tue.>"
(cdr (assoc "DEADLINE" (org-entry-properties))))))
(should-not
@@ -5214,12 +5214,12 @@ (ert-deftest test-org/entry-properties ()
(cdr (assoc "DEADLINE" (org-entry-properties nil "DEADLINE")))))
(should
(equal
- "<2014-03-04 tue.>"
+ "2014-03-04 tue."
(org-test-with-temp-text "* H\nSCHEDULED: <2014-03-04 tue.>"
(cdr (assoc "SCHEDULED" (org-entry-properties nil "SCHEDULED"))))))
(should
(equal
- "<2014-03-04 tue.>"
+ "2014-03-04 tue."
(org-test-with-temp-text "* H\nSCHEDULED: <2014-03-04 tue.>"
(cdr (assoc "SCHEDULED" (org-entry-properties))))))
(should-not
- Possible bug with columnview and active dates, Org Mode, 2020/05/10
- Re: Possible bug with columnview and active dates, Kyle Meyer, 2020/05/10
- Re: Possible bug with columnview and active dates,
Kyle Meyer <=
- Re: Possible bug with columnview and active dates, Kyle Meyer, 2020/05/10
- Re: Possible bug with columnview and active dates, Nicolas Goaziou, 2020/05/11
- Re: Possible bug with columnview and active dates, Kyle Meyer, 2020/05/11
- [PATCH] colview: Display active time stamps as inactive, Kyle Meyer, 2020/05/11
- Re: [PATCH] colview: Display active time stamps as inactive, Kyle Meyer, 2020/05/12
- Re: [PATCH] colview: Display active time stamps as inactive, Nicolas Goaziou, 2020/05/13
- [PATCH] manual: Fix special property descriptions for DEADLINE/SCHEDULED, Kyle Meyer, 2020/05/10