emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] flyspell and code blocks


From: Francesco Pizzolante
Subject: Re: [O] flyspell and code blocks
Date: Fri, 21 Dec 2012 16:37:16 +0100
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.2 (windows-nt)

Hi,

Jambunathan K wrote:
> Julian Burgos <address@hidden> 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=10804

I'm not sure whether this issue has been fixed or not.

But, while I was testing Jambunathan's following code:

    ╭────
    │ (defadvice org-mode-flyspell-verify
    │   (after my-org-mode-flyspell-verify activate)
    │   "Don't spell check src blocks."
    │   (setq ad-return-value
    │   (and ad-return-value
    │        (not (org-in-src-block-p))
    │        (not (member 'org-block-begin-line (text-properties-at (point))))
    │        (not (member 'org-block-end-line (text-properties-at (point)))))))
    ╰────

I found that it only works when setting the org-src-fontify-natively variable:

    ╭────
    │        (setq org-src-fontify-natively t)
    ╰────

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]