org-todo: Fix tag alignment when title contains a folded link

* lisp/org.el (org-todo): When title contains link, we cannot use
`org-fold-region' to unfold everything - this may cause unexpected tag
alignment when the link is revealed and font-locking is not yet
triggered.  Instead of unfolding everything, just remove outline folds.

Reported-by: Peter Solodov <solodov@gmail.com>
Link: https://orgmode.org/list/413C89C3-25DB-425B-A367-FA683E7ADD05@gmail.com
This commit is contained in:
Ihor Radchenko 2024-01-30 15:22:45 +01:00
parent de060c36d4
commit 7de8b3917c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -9335,7 +9335,7 @@ When called through ELisp, arg is also interpreted in the following way:
(unless (org-invisible-p (line-beginning-position)) (unless (org-invisible-p (line-beginning-position))
(org-fold-region (line-beginning-position) (org-fold-region (line-beginning-position)
(line-end-position) (line-end-position)
nil))) nil 'outline)))
(cond ((and org-state (equal this org-state)) (cond ((and org-state (equal this org-state))
(message "TODO state was already %s" (org-trim next))) (message "TODO state was already %s" (org-trim next)))
((not (pos-visible-in-window-p hl-pos)) ((not (pos-visible-in-window-p hl-pos))