4

I want child org items to inherit priority from their parent.

I tried setting org-use-property-inheritance '("PRIORITY"), but it did not have any apparent effect.

Use case: I often have high priority projects whose tasks are mostly equally important. I don't want to waste time setting priorities for each individual child task unless it differs from the parent (e.g., an optional subtask may have lower priority).

Update: I e-mailed the org mailing list. Will report back if I get a useful response.

  • The mailing-list thread referenced: lists.gnu.org/archive/html/emacs-orgmode/2018-01/msg00075.html Unresolved as of 12-03-2018. – Matthew Piziak Mar 13 '18 at 0:18
  • FWIW, I wrote a semi-working implementation in org-mode. Need to finish it and submit a patch. – holocronweaver Mar 13 '18 at 18:17
  • Wow, looking forward do it! – Matthew Piziak Mar 13 '18 at 21:36
  • 1
    Update: went back and fleshed out my implementation of priority inheritance so it both sorts correctly in various agenda views and is visible in both agenda and colview. Preparing to submit a patch. – holocronweaver Apr 22 '18 at 20:46
  • That's exciting! Thanks for the updates. :D – Matthew Piziak Apr 23 '18 at 17:29
1

In the absence of a genuine answer to this at the moment, I'm going to post this partial solution to the problem, if not to the literal question. The second pair of functions here raise and lower the priority of all items in the selected region:

(defun my/org-priority-up ()
  (org-priority 'up))

(defun my/org-priority-down ()
  (org-priority 'down))

(defun my/org-priority-up-region ()
  (interactive)
  (org-map-entries #'my/org-priority-up nil 'region)
  (setq deactivate-mark nil))

(defun my/org-priority-down-region ()
  (interactive)
  (org-map-entries #'my/org-priority-down nil 'region)
  (setq deactivate-mark nil))

You can just bind those last two to keys in the normal way.

For spacemacs users, here's a fancier way (,r. puts you in a transient state which lets you raise and lower the priorities on all items in the selected region using just the up and down arrow keys -- q to escape the transient state):

(spacemacs|define-transient-state my/org-region
  :title "Org region transient state"
  :bindings
  ("<up>" my/org-priority-up-region "up")
  ("<down>" my/org-priority-down-region "down")
  ("q" (lambda () (interactive) (setq deactivate-mark t)) "quit" :exit t))

(with-eval-after-load 'org
  (spacemacs/set-leader-keys-for-major-mode 'org-mode
    "r." 'spacemacs/my/org-region-transient-state/body))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.