DEBRY.Edouard <edouard.de...@mbda-systems.com> writes: > Here is something working, probably not yet all cases proof > > (defun local/set-priority1 () > (org-with-wide-buffer > (when (org-goto-first-child) > (let ((ls (remove nil (cl-loop collect (local/set-priority1) while > (org-goto-sibling))))) > (outline-up-heading 1)
I recommend using org-* functions, when you can. outline-* functions are not always compatible with Org. > (defun local/set-priority2 () > (save-excursion > (outline-up-heading (- (org-element-property :level > (org-element-at-point)) 1)) Note that parent heading may or may not be just one level lower. Consider * heading 1 ****** child -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>