[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Highlight ANSI sequences in the whole buffer (was [PATCH] A
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH] Highlight ANSI sequences in the whole buffer (was [PATCH] ANSI color on example blocks and fixed width elements) |
Date: |
Mon, 16 Dec 2024 17:27:21 +0000 |
Nathaniel Nicandro <nathanielnicandro@gmail.com> writes:
> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> I will need some time to review the patch. It would be helpful for the
>> review if all the functions had a docstring and the data structure for
>> CONTEXT were described in commentary.
>
> Attached is an updated patch with all functions documented and more
> comments about the CONTEXT.
Thanks!
This is getting really complicated.
Looking at your code, I can see that you are basically re-implementing
what I have done in
https://git.sr.ht/~yantar92/org-mode/tree/feature/org-font-lock-element/item/lisp/org-font-lock-core.el#L220
and in
https://git.sr.ht/~yantar92/org-mode/tree/feature/org-font-lock-element/item/lisp/org-element.el#L4580
There are also problems I do see, like unnecessary special cases
handling fixed width - affiliated keywords may be present in many more
elements, which your code may fail with. There may be more.
I feel that the right approach would be implementing generic
parser-based fontification first, and then using its APIs for ANSI
fontification. But I have no idea when I can have more hours in the day
to actually work on that feature branch.
What about the following idea:
1. To make use of the working code you provided, let's split it up into
an ELPA package. It seems to be possible.
2. When we get the parser-based fontification with finalized APIs, we
can come back to merging your code upstream.
WDYT?
--
Ihor Radchenko // yantar92,
Org mode maintainer,
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>