Changeset main,2
- Timestamp:
- 04/28/2020 01:37:19 PM (5 years ago)
- branch-nick:
- org-autofocus
- revision id:
- dsowen@fugue88.ws-20200428133719-pk0i1k9ri2dnyfzl
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/org-autofocus.el
r1 r2 12 12 13 13 (require 'calendar) 14 (require 'eieio) 15 (require 'ewoc) 14 16 15 17 (require 'org-agenda) 18 19 20 (defvar-local org-af--ewoc nil) 21 22 23 (defclass org-af--task () 24 ((org :initarg :org) 25 (marked :initform nil))) 26 27 28 (defun org-af--pp (obj) 29 "Print the task OBJ in the current buffer at point." 30 (with-slots (org marked) obj 31 (insert (if marked "*" " ") " " org))) 32 16 33 17 34 (define-derived-mode org-autofocus-mode special-mode "Org AF" nil … … 20 37 tasks) 21 38 (setq buffer-undo-list t) 39 22 40 (dolist (f (org-agenda-files)) 23 41 (catch 'nextfile 24 42 (org-check-agenda-file f) 25 43 (setq tasks (nconc (org-agenda-get-day-entries f date :todo) tasks)))) 44 45 (setq org-af--ewoc (ewoc-create 'org-af--pp "header" "footer")) 26 46 (dolist (task tasks) 27 (insert task "\n")))) 47 (ewoc-enter-last org-af--ewoc (make-instance 'org-af--task :org task))))) 48 49 50 (defun org-af--mark () 51 "Toggle whether the task at point is marked." 52 (interactive) 53 (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)))) 58 59 60 (define-key org-autofocus-mode-map "." 'org-af--mark) 61 28 62 29 63 ;;;###autoload … … 34 68 (org-autofocus-mode)) 35 69 70 36 71 (provide 'org-autofocus) 37 72 ;;; org-autofocus.el ends here
Note: See TracChangeset
for help on using the changeset viewer.