From: Matt Lundin <mdl@imapmail.org>
To: Bastien <bzg@gnu.org>
Cc: Trevor Murphy <trevor.m.murphy@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] org.el: Don't flyspell check within source code blocks
Date: Thu, 30 May 2013 10:54:16 -0500 [thread overview]
Message-ID: <87vc60o447.fsf@fastmail.fm> (raw)
In-Reply-To: <87ppwf5a5o.fsf@bzg.ath.cx> (Bastien's message of "Sat, 25 May 2013 17:52:51 +0200")
Bastien <bzg@gnu.org> writes:
> Hi Trevor,
>
> Trevor Murphy <trevor.m.murphy@gmail.com> 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
next prev parent reply other threads:[~2013-05-30 16:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-25 7:23 [PATCH] Take 2 on org.el: Don't flyspell check within source code blocks Trevor Murphy
2013-05-25 7:23 ` [PATCH] " Trevor Murphy
2013-05-25 15:52 ` Bastien
2013-05-30 0:55 ` Trevor Murphy
2013-05-30 15:54 ` Matt Lundin [this message]
2013-05-30 0:49 ` [PATCH v2] " Trevor Murphy
2013-06-01 6:15 ` Carsten Dominik
2013-06-01 6:35 ` Carsten Dominik
-- strict thread matches above, loose matches on Subject: below --
2013-05-25 7:17 [PATCH] " Trevor Murphy
2013-05-25 7:17 ` Trevor Murphy
2013-05-25 7:24 ` Trevor Murphy
2013-08-31 6:23 ` Carsten Dominik
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=87vc60o447.fsf@fastmail.fm \
--to=mdl@imapmail.org \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=trevor.m.murphy@gmail.com \
/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).