WIP
This commit is contained in:
parent
5a4422079a
commit
fdbff54ebd
2 changed files with 32 additions and 5 deletions
|
|
@ -43,6 +43,12 @@ Used in `org-ql-view-string'.")
|
||||||
"Map for `org-ql-view' maps."
|
"Map for `org-ql-view' maps."
|
||||||
[tab] org-ql-view-section-toggle)
|
[tab] org-ql-view-section-toggle)
|
||||||
|
|
||||||
|
;;;; Faces
|
||||||
|
|
||||||
|
(defface org-ql-view-heading
|
||||||
|
`((t (:height 1.2 :weight bold)))
|
||||||
|
"Face for headings in `org-ql-view' buffers.")
|
||||||
|
|
||||||
;;;; Classes
|
;;;; Classes
|
||||||
|
|
||||||
(org-ql-defclass org-ql-view-section ()
|
(org-ql-defclass org-ql-view-section ()
|
||||||
|
|
@ -75,7 +81,7 @@ Used in `org-ql-view-string'.")
|
||||||
"String used to indent individual items."
|
"String used to indent individual items."
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
(defcustom org-ql-view-item-indent-per-level 2
|
(defcustom org-ql-view-item-indent-per-level 3
|
||||||
"Number of spaces used to indent items at each level."
|
"Number of spaces used to indent items at each level."
|
||||||
:type 'integer)
|
:type 'integer)
|
||||||
|
|
||||||
|
|
@ -179,7 +185,7 @@ Does not include newline."
|
||||||
(with-slots (header items) section
|
(with-slots (header items) section
|
||||||
(concat (propertize (format "%s"
|
(concat (propertize (format "%s"
|
||||||
(or header "None"))
|
(or header "None"))
|
||||||
'face 'magit-section-heading)
|
'face 'org-ql-view-heading)
|
||||||
" (" (number-to-string (num-items items)) ")"))))
|
" (" (number-to-string (num-items items)) ")"))))
|
||||||
|
|
||||||
(cl-defmethod org-ql-view-insert ((item org-ql-item))
|
(cl-defmethod org-ql-view-insert ((item org-ql-item))
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,8 @@
|
||||||
'(todo)
|
'(todo)
|
||||||
:action #'org-ql-item-at)
|
:action #'org-ql-item-at)
|
||||||
(-sort (-on #'string< #'org-ql-item-priority))
|
(-sort (-on #'string< #'org-ql-item-priority))
|
||||||
(org-ql-view-sort-planning)))
|
(org-ql-view-sort-planning)
|
||||||
|
(org-ql-view-sort-todo)))
|
||||||
(top-section (org-ql-view-section
|
(top-section (org-ql-view-section
|
||||||
:header "To-Do by Planning Date"
|
:header "To-Do by Planning Date"
|
||||||
:items items))
|
:items items))
|
||||||
|
|
@ -129,8 +130,7 @@
|
||||||
(ts-format "%B %Y" it)))
|
(ts-format "%B %Y" it)))
|
||||||
(lambda (item)
|
(lambda (item)
|
||||||
(awhen (or (org-ql-item-deadline-ts item) (org-ql-item-scheduled-ts item))
|
(awhen (or (org-ql-item-deadline-ts item) (org-ql-item-scheduled-ts item))
|
||||||
(ts-format "%d %B" it)))
|
(ts-format "%d %A" it)))
|
||||||
'org-ql-item-todo
|
|
||||||
))
|
))
|
||||||
(pop-to-buffer buffer)))
|
(pop-to-buffer buffer)))
|
||||||
(let* ((buffer (get-buffer-create "test-org-ql-view-section"))
|
(let* ((buffer (get-buffer-create "test-org-ql-view-section"))
|
||||||
|
|
@ -151,6 +151,27 @@
|
||||||
(lambda (item)
|
(lambda (item)
|
||||||
(awhen (or (org-ql-item-deadline-ts item) (org-ql-item-scheduled-ts item))
|
(awhen (or (org-ql-item-deadline-ts item) (org-ql-item-scheduled-ts item))
|
||||||
(ts-format "%B %Y" it)))
|
(ts-format "%B %Y" it)))
|
||||||
|
'org-ql-item-priority
|
||||||
|
|
||||||
|
))
|
||||||
|
(pop-to-buffer buffer)))
|
||||||
|
|
||||||
|
(let* ((buffer (get-buffer-create "test-org-ql-view-section"))
|
||||||
|
(items (->> (org-ql-select "~/src/emacs/org-ql/tests/data.org"
|
||||||
|
'(todo)
|
||||||
|
:action #'org-ql-item-at)
|
||||||
|
(-sort (-on #'string< #'org-ql-item-priority))
|
||||||
|
(org-ql-view-sort-planning)))
|
||||||
|
(top-section (org-ql-view-section
|
||||||
|
:header "To-Do by Planning Date"
|
||||||
|
:items items))
|
||||||
|
(inhibit-read-only t))
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(read-only-mode 1)
|
||||||
|
(erase-buffer)
|
||||||
|
(org-ql-view-insert top-section
|
||||||
|
:group-by (list 'org-ql-item-priority
|
||||||
|
'org-ql-item-todo
|
||||||
|
|
||||||
))
|
))
|
||||||
(pop-to-buffer buffer)))
|
(pop-to-buffer buffer)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue