From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: org-src-fontify-natively makes things very, very slow Date: Sat, 19 Mar 2011 10:20:00 +0100 Message-ID: <80fwqjqxfj.fsf@somewhere.org> References: <87ipvhiou8.fsf@ucl.ac.uk> <804o71triy.fsf@somewhere.org> <87bp18su1a.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric, Eric S Fraga wrote: > S=C3=A9bastien Vauban 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 > > This could indeed be one cause, especially depending on what this does wh= en > there is no block-end line, or at least not anywhere near in the buffer. I > seem to get a slowdown when I have a situation like this: > > #+begin_example > > [... some text ...] > #+begin_src somelanguage > [... text which is part of the source block...] > > > [... lots of other text ...] > [... including other source blocks] > > #+end_example > > where there is no matching #+end_src or, more precisely, the next #+end_s= rc > line is one that does not belong to this current source block. Your search > (in org.el) for the end of the block assumes that it does have the end > statement in place already. I'm not sure how to fix this because it's an > ill-defined situation. You say "your search..." but I only added the overlay-put command... and I must admit this whole block is difficult to follow (so many cases). > It may be worthwhile making the overlay optional? Although I must admit t= hat > I like it! I simply can't live without it, either. > My solution, by the way, is to insert the #+end_src line immediately upon > writing a #+begin_src line and then back up a line to start writing the > code. "My" solution is even simpler: just use a yasnippet template, that prompts = you for the language and puts the begin/end upfront: --8<---------------cut here---------------start------------->8--- #name : #+begin_src...#+end_src # -- #+srcname: ${1:name} #+begin_src ${2:language} $3 $0 #+end_src --8<---------------cut here---------------end--------------->8--- Best regards, Seb --=20 S=C3=A9bastien Vauban