From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: long code blocks making Org Mode very slow Date: Tue, 21 Jul 2015 20:20:09 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHiiS-0004ND-72 for emacs-orgmode@gnu.org; Tue, 21 Jul 2015 21:21:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZHiiN-00043O-N4 for emacs-orgmode@gnu.org; Tue, 21 Jul 2015 21:21:00 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:37352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZHiiN-00042c-H6 for emacs-orgmode@gnu.org; Tue, 21 Jul 2015 21:20:55 -0400 Received: by wibud3 with SMTP id ud3so149522042wib.0 for ; Tue, 21 Jul 2015 18:20:10 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Angus M Cc: "emacs-orgmode@gnu.org" When I have the cursor inside of the code block for the code, moving up or done one line or one page takes 2-3 seconds. Grant Rettke -- gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/ =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates =E2=80=9CAll creativity is an extended form of a joke.=E2=80=9D --Kay ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) =E2=80=9CLife has become immeasurably better since I have been forced to st= op taking it seriously.=E2=80=9D --Thompson On Tue, Jul 21, 2015 at 6:09 AM, Angus M wrote: >> Post a Gist of your file so I can try it out. >> >> What is you value of `org-src-fontify-natively'? > >> Grant Rettke >> -- >> gcr wisdomandwonder.com | http://www.wisdomandwonder.com/ >> =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates >> =E2=80=9CAll creativity is an extended form of a joke.=E2=80=9D --Kay >> ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) >> =E2=80=9CLife has become immeasurably better since I have been forced to= stop >> taking it seriously.=E2=80=9D --Thompson >> >> On Wed, Jul 15, 2015 at 7:22 AM, Angus M gmail.com> > wrote: >> > I've just discovered that the slow-response is definitely related to f= ont >> > locking. If I type M-x font-lock-mode to toggle it off then the typin= g lag >> > problem is solved. >> > >> > According to the Emacs documentation: >> > 'In Emacs 21 and later, turning on font-lock-mode automatically activa= tes >> > the new Just-In-Time fontification provided by jit-lock-mode.' >> > >> > It would appear, therefore, that just-in-time fontification is not tak= ing >> > place in the code block with the whole code block being fontified at o= nce - >> > and hence the delay. >> > >> > Any help to confirm this hypothesis and how to enable just-in-time >> > fontification in the code block would be appreciated. >> > >> > Angus M > > Thanks for your help. > > Any script of a significant length sandwiched as a snippet in org mode be= tween: > #+begin_src python > [code] > #+end_src > > causes the slow-down. > > For example the (arbitrarily chosen) file argparse.py found at > https://code.google.com/p/argparse > /downloads/detail?name=3Dargparse-1.2.1.tar.gz&can=3D2&q=3D > is 2400 lines long, and causes a lag of about 1 or 2 seconds for a charac= ter > to appear on the screen after a key press. > > The issue is not to do with running the script, (which I haven't tried wi= th > this example). > > My value for org-src-fontify-natively: > (setq org-src-fontify-natively t) > > This issue is of less importance to me now as I think it probably makes > sense to run any script of significant length as a stand-alone 'python mo= de' > file, which I'm now doing - rather than as a snippet in 'org mode'. > Therefore unless you're curious to solve this problem for its own sake, > please don't invest any significant time on trying to sort it out on my > behalf. Thanks!