emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Re: org-src-fontify-natively makes things very, very slow


From: Matt Lundin
Subject: [O] Re: org-src-fontify-natively makes things very, very slow
Date: Tue, 29 Mar 2011 10:49:45 -0400
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux)

Sébastien Vauban <address@hidden>
writes:

>>> Maybe this is (partly?) due to the overlay I added:
>>>
>>> #+begin_src emacs-lisp
>>>                 (overlay-put (make-overlay beg1 block-end)
>>>                              'face 'org-block-background))
>>> #+end_src
>
> See http://patchwork.newartisans.com/patch/581/ for a full diff. You can see I
> only add *one* overlay: for the background face.
>
>> (well, commenting out the whole condition that includes this code) makes no
>> difference at all.
>
> I'm surprised. Good to hear, but as some were finger pointing the overlays,
> and as I added one for every block... But, OK, better like that!
>
> For the sake of completeness, know that I first tried to add the background
> fontification as a text property, but that made the other properties disappear
> (annihilating the native fontification in fact). No a solution, or I did not
> try the right way -- which is entirely possible, seen my poor knowledge on
> this subject (I have to admit I succeeded by trials and errors).

I believe there is a bug here. I'm not sure if it is related to the
performance issues, but when org-src-fontify-natively is t, new overlays
keep getting added to the source block with each keypress in the source
block.

For instance, just typing this line of perl...

#+begin_src perl
  my @apples = ("golden delicious", "braeburn");
#+end_src

...resulted in 54 identical overlays being added to the buffer.

,----[ M-x describe-text-properties
| There are 54 overlays here:
|  From 39 to 88
|   face                 org-block-background
|  From 39 to 88
|   face                 org-block-background
|  From 39 to 88
|   face                 org-block-background
|  From 39 to 88
|   face                 org-block-background
| ....[and so on]
`----

The number keeps growing with more typing, since make-overlay is called
without a test to see if an overlay already exists. 

Best,
Matt 



reply via email to

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