Changeset main,13
- Timestamp:
- 05/04/2020 01:16:18 AM (5 years ago)
- branch-nick:
- org-autofocus
- revision id:
- dsowen@fugue88.ws-20200504011618-08dkgem5x2dqkbsb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/org-autofocus.el
r12 r13 10 10 11 11 ;;; Code: 12 13 (require 'calendar)14 (require 'eieio)15 (require 'ewoc)16 12 17 13 (require 'org-agenda) … … 106 102 107 103 108 (defun org-af-defer ( &optional no-redisplay)104 (defun org-af-defer () 109 105 "Defer the current task and update the display, unless NO-REDISPLAY." 110 106 (interactive) … … 139 135 140 136 (defun org-af-complete () 137 "Complete to current task. 138 The task is unmarked (if marked), completed by Org, touched, then 139 sorted to the end of the list." 141 140 (interactive) 142 141 (org-af--beg-of-task) … … 144 143 (org-af-mark)) 145 144 (org-agenda-todo) 146 (org-af-defer t))145 (org-af-defer)) 147 146 148 147 … … 155 154 156 155 (defun org-af--touched (entry) 156 "Touch ENTRY by setting its ``TOUCHED'' property to the current time." 157 157 (let* ((marker (get-text-property 0 'org-hd-marker entry)) 158 158 (touched (org-entry-get marker "TOUCHED"))) … … 176 176 177 177 178 (define-minor-mode org-autofocus-mode nil nil " AF" org-autofocus-mode-map 179 ;;(setq org-agenda-redo-command '(org-autofocus)) 180 ) 178 (define-minor-mode org-autofocus-mode nil nil " AF" org-autofocus-mode-map) 181 179 182 180 183 181 (defun org-autofocus () 182 "Display the Org Agenda Todo list in AutoFocus mode." 184 183 (interactive) 185 184 (let ((org-agenda-cmp-user-defined 'org-af--cmp) … … 189 188 190 189 191 (add-hook 'org-agenda-mode-hook 'org-autofocus-mode)192 (remove-hook 'org-agenda-mode-hook 'org-autofocus-mode)193 194 195 ;; (defvar-local org-af--ewoc nil)196 197 198 ;; (defclass org-af--task ()199 ;; ((org :initarg :org)200 ;; (marked :initform nil)201 ;; (passed :initform nil)))202 203 204 ;; (defun org-af--pp (obj)205 ;; "Print the task OBJ in the current buffer at point."206 ;; (with-slots (org marked passed) obj207 ;; (when (or marked (not passed))208 ;; (insert (if marked "*" " ")209 ;; " "210 ;; (if passed211 ;; (propertize org 'face 'org-agenda-dimmed-todo-face)212 ;; org)213 ;; "\n"))))214 215 216 ;; (define-derived-mode org-autofocus-mode special-mode "Org AF" nil217 ;; (let ((inhibit-read-only t)218 ;; (date (calendar-current-date))219 ;; tasks)220 ;; (setq buffer-undo-list t)221 222 ;; (dolist (f (org-agenda-files))223 ;; (catch 'nextfile224 ;; (org-check-agenda-file f)225 ;; (setq tasks (nconc (org-agenda-get-day-entries f date :todo) tasks))))226 227 ;; (setq org-af--ewoc (ewoc-create 'org-af--pp "header\n" "footer\n" t))228 ;; (dolist (task tasks)229 ;; (ewoc-enter-last org-af--ewoc (make-instance 'org-af--task :org task)))))230 231 232 ;; (defun org-af--mark ()233 ;; "Toggle whether the task at point is marked."234 ;; (interactive)235 ;; (let* ((node (ewoc-locate org-af--ewoc))236 ;; (obj (ewoc-data node))237 ;; changed)238 ;; (unless (slot-value obj 'passed)239 ;; (let ((marked (not (slot-value obj 'marked))))240 ;; (setf (slot-value obj 'marked) marked)241 ;; (push node changed)242 ;; (let ((node node))243 ;; (while (and (setf node (ewoc-prev org-af--ewoc node))244 ;; (setf obj (ewoc-data node))245 ;; (not (slot-value obj 'marked)))246 ;; (setf (slot-value obj 'passed) marked)247 ;; (push node changed))248 ;; (when node249 ;; (setf (slot-value obj 'passed) marked)250 ;; (push node changed))))251 ;; (apply 'ewoc-invalidate org-af--ewoc changed)252 ;; (ewoc-goto-node org-af--ewoc node))))253 254 255 ;; (defun org-af--complete ()256 ;; "Complete the task at point, if it's marked and not passed over."257 ;; (interactive)258 ;; (let* ((node (ewoc-locate org-af--ewoc))259 ;; (obj (ewoc-data node)))260 ;; (unless (and nil (or (slot-value obj 'passed)261 ;; (not (slot-value obj 'marked))))262 ;; (org-agenda-todo)263 ;; (org-autofocus-mode))))264 265 266 ;; (define-key org-autofocus-mode-map "." 'org-af--mark)267 ;; (define-key org-autofocus-mode-map "c" 'org-af--complete)268 269 270 ;; ;;;###autoload271 ;; (defun org-autofocus ()272 ;; "Show the AutoFocus buffer; create it if necessary."273 ;; (interactive)274 ;; (pop-to-buffer (get-buffer-create "*Org AutoFocus*"))275 ;; (org-autofocus-mode))276 277 278 190 (provide 'org-autofocus) 279 191 ;;; org-autofocus.el ends here
Note: See TracChangeset
for help on using the changeset viewer.