summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-05-11 21:55:58 -0400
committerKyle Meyer <kyle@kyleam.com>2020-05-12 22:44:57 -0400
commit7684b59c78cbd6d1deb92f94bb96fc18c1eeb95a (patch)
tree30387061023becb0ef7f32da2289781df4340bd7
parent75902a47324c1edfe72e5a5c5adca85f06f5b4a5 (diff)
downloadorg-mode-7684b59c78cbd6d1deb92f94bb96fc18c1eeb95a.tar.gz
colview: Display active time stamps as inactive
* lisp/org-colview.el (org-columns--displayed-value): Convert active time stamp values to inactive time stamps to avoid duplicate entries in the agenda. * testing/lisp/test-org-colview.el (test-org-colview/dblock): Add tests.
-rw-r--r--lisp/org-colview.el2
-rw-r--r--testing/lisp/test-org-colview.el19
2 files changed, 20 insertions, 1 deletions
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 3569b23..3e5920c 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -257,6 +257,8 @@ value for ITEM property."
(if org-hide-leading-stars ?\s ?*))
"* "))))
(concat stars (org-link-display-format value))))
+ (`(,(or "DEADLINE" "SCHEDULED" "TIMESTAMP") . ,_)
+ (replace-regexp-in-string org-ts-regexp "[\\1]" value))
(`(,_ ,_ ,_ ,_ nil) value)
;; If PRINTF is set, assume we are displaying a number and
;; obey to the format string.
diff --git a/testing/lisp/test-org-colview.el b/testing/lisp/test-org-colview.el
index ed75090..7612074 100644
--- a/testing/lisp/test-org-colview.el
+++ b/testing/lisp/test-org-colview.el
@@ -1519,7 +1519,24 @@
(org-test-with-temp-text
"* H src_emacs-lisp{(+ 1 1)} 1\n<point>#+BEGIN: columnview\n#+END:"
(let ((org-columns-default-format "%ITEM")) (org-update-dblock))
- (buffer-substring-no-properties (point) (point-max))))))
+ (buffer-substring-no-properties (point) (point-max)))))
+ ;; Active time stamps are displayed as inactive.
+ (should
+ (equal
+ "#+BEGIN: columnview
+| ITEM | d | s | t |
+|------+------------------+------------------+------------------|
+| H | [2020-05-14 Thu] | [2020-05-11 Mon] | [2020-06-10 Wed] |
+#+END:"
+ (org-test-with-temp-text
+ "* H
+SCHEDULED: <2020-05-11 Mon> DEADLINE: <2020-05-14 Thu>
+<2020-06-10 Wed>
+<point>#+BEGIN: columnview\n#+END:"
+ (let ((org-columns-default-format
+ "%ITEM %DEADLINE(d) %SCHEDULED(s) %TIMESTAMP(t)"))
+ (org-update-dblock))
+ (buffer-substring-no-properties (point) (point-max))))))
(provide 'test-org-colview)
;;; test-org-colview.el ends here