[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] org.el: Don't flyspell check within source code blocks
From: |
Matt Lundin |
Subject: |
Re: [O] [PATCH] org.el: Don't flyspell check within source code blocks |
Date: |
Thu, 30 May 2013 10:54:16 -0500 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) |
Bastien <address@hidden> writes:
> Hi Trevor,
>
> Trevor Murphy <address@hidden> writes:
>
>> + (not (eq (org-element-type (org-element-at-point)) 'src-block)))))
>
> I think `org-in-src-block-p', while a bit less reliable, will be
> faster, and reliable/fast enough for this use-case.
>
> Let's see what others think/test.
For the record, here are the results of a very unscientific profiling of
the patch above. On my woefully under-powered and aging Atom processor,
For each scenario I typed without errors "The quick brown fox jumps over
the lazy dog."
With the old behavior (i.e., no test for source blocks):
org-mode-flyspell-verify 27 0.005580378 0.0002066806
With the patch above:
org-mode-flyspell-verify 27 0.35359755 0.0130962055
Using (not (org-in-src-block-p)), as Bastien suggests:
org-mode-flyspell-verify 27 0.0112581490 0.0004169684
With org-in-src-block-p, a half of a hundredth of a second spread over
27 characters causes no noticeable slowdowns.
But using org-element-at-point causes the cursor to lag a bit.
So +1 is for (not (org-in-src-block-p)).
Best,
Matt