Changeset main,3
- Timestamp:
- 04/28/2020 11:05:09 PM (5 years ago)
- branch-nick:
- org-autofocus
- revision id:
- dsowen@fugue88.ws-20200428230509-z1y5x5lnzqwi1yso
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/org-autofocus.el
r2 r3 23 23 (defclass org-af--task () 24 24 ((org :initarg :org) 25 (marked :initform nil))) 25 (marked :initform nil) 26 (passed :initform nil))) 26 27 27 28 28 29 (defun org-af--pp (obj) 29 30 "Print the task OBJ in the current buffer at point." 30 (with-slots (org marked) obj 31 (insert (if marked "*" " ") " " org))) 31 (with-slots (org marked passed) obj 32 (unless passed 33 (insert (if marked "*" " ") " " org "\n")))) 32 34 33 35 … … 43 45 (setq tasks (nconc (org-agenda-get-day-entries f date :todo) tasks)))) 44 46 45 (setq org-af--ewoc (ewoc-create 'org-af--pp "header " "footer"))47 (setq org-af--ewoc (ewoc-create 'org-af--pp "header\n" "footer\n" t)) 46 48 (dolist (task tasks) 47 49 (ewoc-enter-last org-af--ewoc (make-instance 'org-af--task :org task))))) … … 52 54 (interactive) 53 55 (let* ((node (ewoc-locate org-af--ewoc)) 54 (obj (ewoc-data node))) 55 (with-slots (marked) obj 56 (setf marked (not marked)) 57 (ewoc-invalidate org-af--ewoc node)))) 56 (obj (ewoc-data node)) 57 changed) 58 (let ((marked (not (slot-value obj 'marked)))) 59 (setf (slot-value obj 'marked) marked) 60 (push node changed) 61 (let ((node node)) 62 (while (and (setq node (ewoc-prev org-af--ewoc node)) 63 (setq obj (ewoc-data node)) 64 (not (slot-value obj 'marked))) 65 (setf (slot-value obj 'passed) marked) 66 (push node changed)))) 67 (apply 'ewoc-invalidate org-af--ewoc changed) 68 (ewoc-goto-node org-af--ewoc node))) 58 69 59 70
Note: See TracChangeset
for help on using the changeset viewer.