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: Wed, 28 Nov 2018 12:02:24 -0300

Hi Nicolas, thank you for your detailed answer!

To be honest I was wrapping my head around this until late tonight when it all suddenly made sense and I more or less concluded the same you explained about the role of each block and was going to say that you could indeed dismiss this request.

Nevertheless there is one area I still believe that could be improved which is native fontification of inline code. I almost got it by advicing org-do-latex-and-related so that it does the equivalent of:

        (org-src-font-lock-fontify-block "latex"
                                         (+ offset (match-beginning 0))
                                         (match-end 0))        
        ;; (font-lock-prepend-text-property
        ;;  (+ offset (match-beginning 0)) (match-end 0)
        ;;  'face 'org-latex-and-related)

That correctly fontifies latex if org-highlight-latex-and-related includes 'latex. The problem is that once you break the beginning of the environment, say by adding a space so that "\begin" -> "\be gin" or whatever, all fontification is lost for the entire environment and never reapplied, no matter whether it became valid latex again afterwards or not. The next statement in org-do-latex-and-related is:

        (add-text-properties (+ offset (match-beginning 0)) (match-end 0)
                  '(font-lock-multiline t)))

But this doesn't seem to help keeping font locking in sync. I will dig deeper into emacs font locking mechanism until I get this working but, since I'm no expert, maybe you can point in the right direction and spare me some time.

A missing feature is still not a bug, i.e., feature requests are not bug
reports.

I understand this, I just followed the instructions in the manual and thought org-submit-bug-request was intended for everything feedback related, so sorry if I should have written directly to the list or maybe removed the Bug: prefix in the header.

Regards
--
Carlos


reply via email to

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