emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: *** BULK *** Re: How to set priority of a heading with the highest o


From: Ihor Radchenko
Subject: Re: *** BULK *** Re: How to set priority of a heading with the highest one among its children
Date: Mon, 24 Apr 2023 12:31:46 +0000

DEBRY.Edouard <edouard.debry@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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]