emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: Add option to fontify latex blocks [9.1.9 (release_9.1.9-65


From: Carlos Pita
Subject: Re: [O] Bug: Add option to fontify latex blocks [9.1.9 (release_9.1.9-65-g5e4542 @ /home/carlos/local/stow/emacs-26/share/emacs/26.1.50/lisp/org/)]
Date: Sat, 22 Dec 2018 12:07:08 -0300

Here is a patch on top of latest revision. It just adds an extension
function while initializing font locking, as documented in [1]. It
indeed reduces lines of code to some extent by moving the dirty stuff
out of the fontification function (but I tried to keep the code
formatting of your last commit, since it was rather different than the
one shipped with emacs). The approach is more robust AFAICS since the
font locking framework is correctly informed of which blocks should be
refontified before fontification itself happens. It covers all types
of blocks: #+BEGIN/#+END, \begin\end, \[\]. It's not a full parser but
at least it matches corresponding delimiters by type by using a simple
heuristic.

Of course, I cannot ensure that it's bug free but I was *really* using
and improving this for a couple of weeks now and I can say it does the
job. If you want me to change anything just let me know, I will have
some time for this for the next few days.

Best regards
--
Carlos

---

[1] 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Multiline-Font-Lock.html

Attachment: region-extend.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]