Ihor Radchenko <yanta...@posteo.net> writes:
> It runs fine on my side, although I am not sure if things are working as > expected for all the cases. For example, headlines never got fontified > on my side when I tried your patch on top of the latest main branch. Yes, the headlines are currently not fontified since, with this patch, I was mainly looking to satisfy the initial set of rules you laid out which didn't mention headlines as being a fontifiable element for ANSI sequences, or at least I didn't get that from my reading of them. It does make sense, however, to be able to add headlines to the `org-ansi-highlightable-elements` variable so that they are fontified if the user wishes. Although doing so with this patch wouldn't work. > Also, it looks like you simply made the ASCII sequences invisible, which > causes funky behaviour when trying to edit the text around. What we may > need instead is something similar to hidden parts of the links that get > revealed when we try to edit the invisible text. See > `org-catch-invisible-edits' variable and the functions that examine it. I agree that we should reveal the invisible sequence when trying to edit it. Thanks for the tip about `org-catch-invisible-edits', it led me to `org-fold-show-set-visibility' which I think is the appropriate place to reveal a hidden sequence. > You may use `org-fontify-extend-region' to handle such scenarios if you > mark the ANSI highlights with a special text property. Thanks for the tip, I'll look into it. -- Nathaniel