On 24.01.2023 12:34, Ihor Radchenko wrote:
Philipp Kiefer <phil.kiefer@gmail.com> writes:

Org mode version 9.6.1, GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)

Please see the two screenshots here for illustration:

https://imgur.com/a/7EuUi0J <https://imgur.com/a/7EuUi0J>

(I'm assuming it's not a good idea - or not even possible - to send 
e-mail attachments to the list?)
Quite the opposite - attachments are preferred when they do not have
large size. With attachments, the thread can be understood by the
readers years later, when whichever image hosting you use dwindles.

Great, attaching the screenshots in question. Also attaching an .org file illustrating the previously reported bug plus another related (and more serious as it impedes org functionality) one.


This is the relevant code from my init.el that seems to be causing this 
issue:

(require 'org-habit nil t) ; relevant?
(defun org-add-my-extra-fonts ()
   "Add alert and overdue fonts."
   (add-to-list 'org-font-lock-extra-keywords 
'("\\(³\\)\\([^\n\r\t]+\\)\\(³\\)" (1 '(face org-habit-alert-face 
invisible nil)) (2 'org-habit-alert-face t) (3 '(face 
org-habit-alert-face invisible nil))) t)
You set 'invisible text property to nil, which tells Emacs - make the
text visible. Emacs obeys.

Well, with Orgmode version 9.5, Emacs was never *this* obedient, i. e. this problem only began after I updated Orgmode to 9.6, which is why I considered it a bug in the first place. I am aware I have set the keywords to be visible but would not expect them to appear at the end of the parent heading for a folded subtree! (see the screenshots and the explanatory .org file). Showing them there does not make any sense in my opinion. I would expect Orgmode to hide these keywords when they are in a collapsed subtree, regardless of the 'invisible text' setting, which is how it was handled pre 9.6 unless I'm much mistaken.

The other bug illustrated in the .org file (also requiring specific settings, see the init.el section in the file) breaks 'org-previous-visible-heading' and probably some other upwards motion commands in connection with parent items having  emphasis markers as well as subitems.