From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Francesco Pizzolante" Subject: Re: flyspell and code blocks Date: Fri, 21 Dec 2012 16:37:16 +0100 Message-ID: <87licr5scz.fsf@somewhere.org> References: <4F955FC4.7050600@hafro.is> <81397ua64z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <81397ua64z.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (Jambunathan K.'s message of "Mon, 23 Apr 2012 19:43:00 +0530") 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: Jambunathan K Cc: Julian Burgos , Org Mode Mailing List Hi, Jambunathan K wrote: > Julian Burgos writes: > >> It is possible to make flyspell to ignore (i.e. do not spell check) >> the text within code blocks (I mean blocks of texts separated by >> #+begin_src and #+end src)? I did my homework but could not find a >> good answer. > > See > http://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00162.html > > which links to the following bug report > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10804 I'm not sure whether this issue has been fixed or not. But, while I was testing Jambunathan's following code: =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 (defadvice org-mode-flyspell-verify =E2=94=82 (after my-org-mode-flyspell-verify activate) =E2=94=82 "Don't spell check src blocks." =E2=94=82 (setq ad-return-value =E2=94=82 (and ad-return-value =E2=94=82 (not (org-in-src-block-p)) =E2=94=82 (not (member 'org-block-begin-line (text-properties-at = (point)))) =E2=94=82 (not (member 'org-block-end-line (text-properties-at (p= oint))))))) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 I found that it only works when setting the org-src-fontify-natively variab= le: =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 (setq org-src-fontify-natively t) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 I hope this helps. An even better solution would be to use flyspell-prog-mode (to spellcheck comments and strings in source code) within the Org source blocks. Any idea how to achieve this? Thanks, Francesco