0

When I use org-sort (Ctrl-^) all the to be sorted subtrees are expanded including their properties. I kind of loose orientation. I have to collapse them manually again or use overview (Shift-Tab) and expand manually from there.

  • Is this a standard behavior?
    I tried a fresh emacs install on a new machine and this behaves the same. So I asume the anser here is "yes".
  • Can I change this behavior somehow? The focus on a subtree should not change when sorting or archiving.
  • You can close everything automatically cycling visibility with S-TAB / backtab. Not an answer, but less of a PITA on consequences :) – Muihlinn May 2 at 16:45
0

I have not found a way to disable that behaviour, but I found a way to not loose orientation while sorting.

I modified this answer and added a hook to run after every sorting of headings. This basically automates the folding I had to do manually every time after sorting.

(defun ess/org-show-just-me (&rest _)
"Fold all other trees, then show direct children of current org-heading."
  (interactive)
  (org-overview)
  (org-reveal)
  (org-show-children))

(add-hook 'org-after-sorting-entries-or-items-hook 'ess/org-show-just-me)

I don't understand the code fully ( eg. &rest_), but for now it works.

| improve this answer | |

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.