Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inactive timestamps in calfw-org #135

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions calfw-org.el
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@
:type
'(list string string symbol (list symbol (choice file (const nil))) string))

(defcustom cfw:org-agenda-inactive-timestamps nil
"Non-nil means show inactive timestamps events."
:group 'cfw-org
:type 'boolean)

(defsubst cfw:org-tp (text prop)
"[internal] Return text property at position 0."
(get-text-property 0 prop text))
Expand Down Expand Up @@ -90,19 +95,24 @@ For example,
(defun cfw:org-collect-schedules-period (begin end)
"[internal] Return org schedule items between BEGIN and END."
(let ((org-agenda-prefix-format " ")
(org-agenda-include-inactive-timestamps
cfw:org-agenda-inactive-timestamps)
(span 'day))
(setq org-agenda-buffer
(when (buffer-live-p org-agenda-buffer)
org-agenda-buffer))
(when (buffer-live-p org-agenda-buffer)
org-agenda-buffer))
(org-compile-prefix-format nil)
(loop for date in (cfw:enumerate-days begin end) append
(loop for file in (or cfw:org-icalendars (org-agenda-files nil 'ifmode))
append
(progn
(org-check-agenda-file file)
(apply 'org-agenda-get-day-entries
file date
cfw:org-agenda-schedule-args))))))
(delete-duplicates
(loop for date in (cfw:enumerate-days begin end) append
(loop for file in (or cfw:org-icalendars (org-agenda-files nil 'ifmode))
append
(progn
(org-check-agenda-file file)
(apply 'org-agenda-get-day-entries
file date
cfw:org-agenda-schedule-args))))
:from-end t
:test (lambda (x y) (equal (cfw:org-tp x 'txt) (cfw:org-tp y 'txt))))))

(defun cfw:org-onclick ()
"Jump to the clicked org item."
Expand Down
Loading