about summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-09-28 16:22:24 -0500
committerCase Duckworth2021-09-28 16:22:24 -0500
commit0124957b18d900080bc420512ff55adb4ed391dd (patch)
tree906cd6b30a8bb9ba180da045b6d8b8690c67d0fe /lisp
parentFix loading (diff)
downloademacs-0124957b18d900080bc420512ff55adb4ed391dd.tar.gz
emacs-0124957b18d900080bc420512ff55adb4ed391dd.zip
Add org-narrow-to-task
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-org.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index 96f3f69..8821b28 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el
@@ -451,6 +451,19 @@ probably abandon it at some point for a better solution (see:
451 (nth day-of-week '("Sun" "Mon" "Tue" "Wed" "Thu" 451 (nth day-of-week '("Sun" "Mon" "Tue" "Wed" "Thu"
452 "Fri" "Sat")) 452 "Fri" "Sat"))
453 "]"))))))) 453 "]")))))))
454
455;;; Org task stuff
456
457(defun org-narrow-to-task ()
458 "Narrow buffer to the nearest task and its subtree."
459 (interactive)
460 (save-excursion
461 (save-match-data
462 (widen)
463 (while (not (org-entry-is-todo-p))
464 ;; TODO: need a better error message
465 (org-previous-visible-heading 1))
466 (org-narrow-to-subtree))))
454 467
455 468
456(provide 'acdw-org) 469(provide 'acdw-org)