From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: [PATCH] org.el: Don't flyspell check within source code blocks Date: Thu, 30 May 2013 10:54:16 -0500 Message-ID: <87vc60o447.fsf@fastmail.fm> References: <1369466635-8217-1-git-send-email-trevor.m.murphy@gmail.com> <1369466635-8217-2-git-send-email-trevor.m.murphy@gmail.com> <87ppwf5a5o.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui5H1-0006Wp-OS for emacs-orgmode@gnu.org; Thu, 30 May 2013 12:00:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui5BQ-00010q-3s for emacs-orgmode@gnu.org; Thu, 30 May 2013 11:54:36 -0400 In-Reply-To: <87ppwf5a5o.fsf@bzg.ath.cx> (Bastien's message of "Sat, 25 May 2013 17:52:51 +0200") 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: Bastien Cc: Trevor Murphy , emacs-orgmode@gnu.org Bastien writes: > Hi Trevor, > > Trevor Murphy 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