emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Thomas S. Dye" <tsd@tsdye.com>
To: Dan Davison <dandavison7@gmail.com>
Cc: Dan Davison <davison@stats.ox.ac.uk>,
	emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: Org now fontifies code blocks
Date: Thu, 28 Oct 2010 06:24:45 -1000	[thread overview]
Message-ID: <FA50754F-C08F-4F53-B988-074B9284C615@tsdye.com> (raw)
In-Reply-To: <87sjzqbmjm.fsf@gmail.com>


On Oct 28, 2010, at 1:10 AM, Dan Davison wrote:

> "Thomas S. Dye" <tsd@tsdye.com> writes:
>
>> On Sep 9, 2010, at 12:35 PM, Dan Davison wrote:
>>
>>> "Thomas S. Dye" <tsd@tsdye.com> writes:
>>>
>>>> Hi Dan,
>>>>
>>>> Glad to know that Darlan's slowdown is fixed.
>>>>
>>>> No change here that I can tell.  Now that I've had org-src-fontify-
>>>> natively set to t for a while, I can see that the slowdown is
>>>> proportional to the number and size of code blocks in the Org-mode
>>>> file.  It is most noticeable in a file with about 30 printed  
>>>> pages of
>>>> a manuscript held in several dozen LaTeX code blocks, quite a bit
>>>> less
>>>> so in a file where the several dozen code blocks are short R
>>>> routines.
>
> Hi Tom,
>
> I've used fontification in Org code blocks constantly for a couple of
> months now, and I do not agree that there are any editing or unfolding
> delays which should deter typical Org users from using fontified src
> blocks. In typical usage I do not experience any delays whatsoever (my
> blocks tend to be fewer than 100 lines in length).
>
> I have tested a file with 22000 lines containing two subtrees of 59
> latex blocks each of length 190 lines. Opening the file takes  
> perhaps 4
> seconds as opposed to 1. And unfolding one of the 11,000 line subtrees
> for the first time sometimes takes 1-2 seconds. However, once the file
> is open and being used, folding and unfolding of blocks is
> snappy. Editing and fontification is immediate in the 190 line
> blocks. When editing in a 2088 line block, there is an almost 1 second
> delay for a fontified character to appear, which is no good at all --
> but I think users of blocks of that size should be happy using C-c  
> '. I
> do not get any fontification messages in the minibuffer. This is on a
> slow machine (an Intel atom netbook), with emacs23 and emacs24 running
> under linux.
>
> So even in my 22000 line file containing 190 line blocks, the delays  
> are
> short and only occur when first opening and unfolding the file.  
> However,
> users of very large src blocks should definitely use C-c ' for  
> editing.
>
>>>> FWIW, I see the org-src-fontification message while unfolding,
>
> [...]
>
>> Could you post that message please (go to *Messages* buffer after
>>> unfolding and it should be there). I haven't put any messages in,
>>> but I
>>> think I know the message you mean and I think it is an Emacs  
>>> message.
>
> [...]
>
>> Yes, here is a portion of the message buffer:
>>
>> Searching for `makaainana.org'....
>> Automatic display of crossref information was turned on
>> Fontifying
>> org-src-fontification:latex-mode...  
>> (regexps.............................)
>> Automatic display of crossref information was turned on
>
> [...]
>
>> I believe the message comes from line 744 of org-src.el
>
> No, the message comes from core Emacs fontification code. I'm unsure  
> why
> you are seeing these messages and I am not.
>
> Do you still see the behaviour/problems you reported above?
>
> Dan
>

HI Dan,

No, the slowness that I had with this on OS X is gone now.  I think  
the key is this, as Jules Bean noted:

#+begin_src emacs-lisp :tangle yes
   (setq font-lock-verbose nil)
#+end_src

This was set to 0 previously.

Thanks for this improvement.  It is great to see semantic markup in  
code blocks in the Org-mode buffer.

Tom



>>
>> All the best,
>> Tom
>>>> even
>>>> when the unfolded result doesn't show a code block.  Later when a
>>>> sub-
>>>> tree is unfolded, the org-src-fontification message appears again,
>>>> which makes me wonder if there is unnecessary work going on.
>>>>
>>>> All the best,
>>>> Tom
>>>>
>>>> On Sep 9, 2010, at 3:02 AM, Darlan Cavalcante Moreira wrote:
>>>>
>>>>>
>>>>> Thank you Dan,
>>>>>
>>>>> It is perfect now. No perceivable slowdown
>>>>>
>>>>> At Wed, 08 Sep 2010 13:41:51 -0400,
>>>>> Dan Davison wrote:
>>>>>>
>>>>>> Darlan Cavalcante Moreira <darcamo@gmail.com> writes:
>>>>>>
>>>>>>> Maybe my problem is not related to slow folding/unfolding  
>>>>>>> behavior
>>>>>>> that you
>>>>>>> are getting, but if I set the org-src-tab-acts-natively variable
>>>>>>> to t the
>>>>>>> folding/unfolding of headlines becomes very slow for me.
>>>>>>
>>>>>> Thank you Darlan,
>>>>>>
>>>>>> I have just pushed a change that should make that better -- does
>>>>>> that
>>>>>> improve things?
>>>>>>
>>>>>> I did think there was something else going on (that was why I  
>>>>>> asked
>>>>>> Tom
>>>>>> for confirmation), but I didn't have time to investigate
>>>>>> properly. The
>>>>>> problem seems to be that, on a folded headline containing many
>>>>>> blocks,
>>>>>> `org-edit-src-find-region-and-lang' is actually quite slow to
>>>>>> come up
>>>>>> with the answer "No, there's nothing for me to edit here."  (try
>>>>>> issuing
>>>>>> M-x org-edit-src-code on a folded headline containing many
>>>>>> blocks; I
>>>>>> haven't understood this properly yet.)
>>>>>>
>>>>>> Dan
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> In fact, I was thinking that I had the problem described here,  
>>>>>>> but
>>>>>>> I just
>>>>>>> isolated the cause and in my case it was the org-src-tab-acts-
>>>>>>> natively
>>>>>>> variable that I had set to t in my .emacs file.
>>>>>>>
>>>>>>> --
>>>>>>> Darlan
>>>>>>>
>>>>>>> At Tue, 7 Sep 2010 06:05:54 -1000,
>>>>>>> "Thomas S. Dye" <tsd@tsdye.com> wrote:
>>>>>>>>
>>>>>>>> Hi Dan,
>>>>>>>>
>>>>>>>> Yes, I can confirm that (setq org-src-fontify-natively nil)  
>>>>>>>> makes
>>>>>>>> unfolding snappy again.
>>>>>>>>
>>>>>>>> All the best,
>>>>>>>> Tom
>>>>>>>>
>>>>>>>> On Sep 7, 2010, at 3:23 AM, Dan Davison wrote:
>>>>>>>>
>>>>>>>>> "Thomas S. Dye" <tsd@tsdye.com> writes:
>>>>>>>>>
>>>>>>>>>> Aloha Dan,
>>>>>>>>>>
>>>>>>>>>> This is really nice.  Thanks for shepherding it along.
>>>>>>>>>>
>>>>>>>>>> In some of my use cases there is a substantial delay when
>>>>>>>>>> opening a
>>>>>>>>>> large file and then unfolding sections with many source code
>>>>>>>>>> blocks.
>>>>>>>>>
>>>>>>>>> Hi Tom,
>>>>>>>>>
>>>>>>>>> I think this is a good point and probably as you say a reason
>>>>>>>>> for
>>>>>>>>> turning it off by default. Org should be (and was!)
>>>>>>>>> lightweight by
>>>>>>>>> default.
>>>>>>>>>
>>>>>>>>> I haven't had time to profile things properly. Before we  
>>>>>>>>> turn it
>>>>>>>>> off,
>>>>>>>>> could you please confirm that all your slowness problems go  
>>>>>>>>> away
>>>>>>>>> when
>>>>>>>>> you do (setq org-src-fontify-natively nil)?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> Dan
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> I don't mind this and intend to keep the feature on, but I do
>>>>>>>>>> think
>>>>>>>>>> it
>>>>>>>>>> should be off by default because the user potentially pays an
>>>>>>>>>> appreciable time penalty for the pleasure of semantic source
>>>>>>>>>> code
>>>>>>>>>> markup.
>>>>>>>>>>
>>>>>>>>>> Thanks again for this nice feature.
>>>>>>>>>>
>>>>>>>>>> All the best,
>>>>>>>>>> Tom
>>>>>>>>>>
>>>>>>>>>> On Sep 3, 2010, at 7:30 AM, Eric S Fraga wrote:
>>>>>>>>>>
>>>>>>>>>>> On Thu, 02 Sep 2010 08:51:16 -0700, Dan Davison
>>>>>>>>>>> <davison@stats.ox.ac.uk
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> I've just pushed changes which mean that Org now fontifies
>>>>>>>>>>>> code in
>>>>>>>>>>>> code
>>>>>>>>>>>> blocks. Currently, this is turned on by default, so it
>>>>>>>>>>>> would be
>>>>>>>>>>>> helpful
>>>>>>>>>>>> if people could report any problems, and opinions as to
>>>>>>>>>>>> whether it
>>>>>>>>>>>> should be on or off by default.<
>>>>>>>>>>>
>>>>>>>>>>> [...]
>>>>>>>>>>>
>>>>>>>>>>> This is brilliant!  Works very well on my notebook (with  
>>>>>>>>>>> small
>>>>>>>>>>> code
>>>>>>>>>>> blocks as that's all I tend to have).  Many thanks!
>>>>>>>>>>> --
>>>>>>>>>>> Eric S Fraga
>>>>>>>>>>> GnuPG: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Emacs-orgmode mailing list
>>>>>>>>>>> Please use `Reply All' to send replies to the list.
>>>>>>>>>>> Emacs-orgmode@gnu.org
>>>>>>>>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Emacs-orgmode mailing list
>>>>>>>>>> Please use `Reply All' to send replies to the list.
>>>>>>>>>> Emacs-orgmode@gnu.org
>>>>>>>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Emacs-orgmode mailing list
>>>>>>>> Please use `Reply All' to send replies to the list.
>>>>>>>> Emacs-orgmode@gnu.org
>>>>>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Emacs-orgmode mailing list
>>>>>>> Please use `Reply All' to send replies to the list.
>>>>>>> Emacs-orgmode@gnu.org
>>>>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>>
>>>>
>>>> _______________________________________________
>>>> Emacs-orgmode mailing list
>>>> Please use `Reply All' to send replies to the list.
>>>> Emacs-orgmode@gnu.org
>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2010-10-28 16:25 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03 23:12 [PATCH] Mode-specific fontification of babel source blocks David O'Toole
2010-08-03 23:14 ` David O'Toole
2010-08-03 23:23   ` Erik Iverson
2010-08-04  2:55 ` Dan Davison
2010-08-04  5:55   ` David O'Toole
2010-08-09 21:35   ` Dan Davison
2010-09-02 15:51     ` Org now fontifies code blocks Dan Davison
2010-09-02 17:04       ` Erik Iverson
2010-09-02 19:06         ` Native TAB in code blocks [WAS Re: Org now fontifies code blocks] Dan Davison
2010-09-02 19:18           ` Carsten Dominik
2010-09-02 20:36             ` Native TAB in code blocks Dan Davison
2010-09-03  8:11               ` Julien Fantin
2010-09-02 20:26       ` Org now fontifies " Sébastien Vauban
2010-09-03 17:30       ` Eric S Fraga
2010-09-03 19:10         ` Thomas S. Dye
2010-09-06 16:49           ` David O'Toole
2010-09-07 13:23           ` Dan Davison
2010-09-07 13:55             ` Richard Riley
2010-09-07 16:05             ` Thomas S. Dye
2010-09-08 16:36               ` Darlan Cavalcante Moreira
2010-09-08 17:41                 ` Dan Davison
2010-09-09 13:02                   ` Darlan Cavalcante Moreira
2010-09-09 21:40                     ` Thomas S. Dye
2010-09-09 22:35                       ` Dan Davison
2010-09-09 23:03                         ` Thomas S. Dye
2010-10-28 11:10                           ` Dan Davison
2010-10-28 12:08                             ` Jules Bean
2010-10-28 12:47                               ` Jambunathan K
2010-10-28 13:35                                 ` Dan Davison
2010-10-28 16:24                             ` Thomas S. Dye [this message]
2010-09-06 16:59         ` Richard Riley
2010-09-06 17:53           ` David O'Toole
2010-09-06 18:30             ` Bastien
2010-09-06 18:52               ` David O'Toole
2010-09-06 18:59                 ` Richard Riley
2010-09-07 13:43                 ` Dan Davison
2010-09-07 14:22                   ` Carsten Dominik
2010-09-07 14:33                     ` Bastien
2010-09-07 14:37                       ` Carsten Dominik
2010-09-07 14:41                       ` Sebastian Rose
2010-09-07 16:20                         ` Dan Davison
2010-09-07 15:03                       ` Sébastien Vauban
2010-09-07 16:54                     ` Dan Davison
2010-09-08 16:30                       ` Bastien
2010-09-08 18:35                         ` Sébastien Vauban
2010-09-08 18:42                           ` Erik Iverson
2010-09-08 19:17                             ` Dan Davison
2010-09-07 14:24                   ` Bastien
2010-09-07 14:33                   ` Tom Short
2010-09-07 14:47                     ` Richard Riley
2010-09-06 17:59           ` Erik Iverson
2010-09-06 18:23           ` Dan Davison
2010-09-06 18:49             ` Richard Riley
2010-09-07 13:33               ` Dan Davison
2010-09-07  7:24           ` Sébastien Vauban
2010-08-15  6:33 ` [PATCH] Mode-specific fontification of babel source blocks Dan Davison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FA50754F-C08F-4F53-B988-074B9284C615@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=dandavison7@gmail.com \
    --cc=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).