Edouard Debry <edouard.de...@gmail.com> writes:

> But this involves org skills a bit beyond my understanding, I wonder if you 
> could give
> me some piece of advices on how to do that :
> - is there a suitable hook for this function ?

No hook, but you can advice `org-priority' using :after advice.

> - when in a given tree, how can I select the top level heading ?

(while (org-up-heading-safe))

Try to play with this using M-: with point at different headings.

> - when at a given heading, how can I change programmatically the priority ?

(org-priority 1), for example.

> For this latter question, I tried (org-entry-put nil "PRIORITY" "2"), but it 
> replied that
>
>  org-priority: Priority must be between ‘0’ and ‘5’

That's because `org-entry-put' converts the argument into number,
assuming a single-character string like "A". This is probably a bug.

-- 
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