JV <[email protected]> writes: > Ihor Radchenko wrote: > >> Well. org-context uses group 2. >> And who knows about third-party code. > > You're right. And this causes a bug. org-context does not return > :item-bullet for asterisk bullets. > > As best I can tell, the intent of the current design is for org-item-re > to quickly determine whether something is a list item, and > org-list-full-item-re to match its individual components. Any uses of > match groups other than 0 for org-item-re should likely be using > org-list-full-item-re instead.
You are right both about the bug in org-context (org-context is broken in general) and likely about the intent of org-item-re. However, our general rule is that breaking changes should be justified by something more than just making the intent more clear. In this particular case, I do not see a strong justification to introduce potentially breaking change. >>> This may be simpler than I thought. It seems checkbox fontification >>> already uses org-list-full-item-re. We can just add another subexp >>> highlighter to this. A faster regexp would be nice, but it only makes >>> sense if it could completely replace the slower one for font locking. >> >> +1 > > One thing to note is that org-list-full-item-re is static. It always > matches using the most expansive values of org-list-allow-alphabetical > and org-plain-list-ordered-item-terminator. Do you think this is > acceptable for fontifying list bullets? We can confirm with org-element-at-point, but I would not see using slightly inaccurate regexp as a huge problem here. Simply because fontification is already approximate and regexp-based. Adding yet another approximate regexp-based keyword is ok-ish. Eventually (I hope), we should switch the fontification to be parser-based. Before that, we just accept the inaccuracies. -- 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>
