emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Francesco Pizzolante" <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org>
To: Jambunathan K <kjambunathan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Julian Burgos <julian-YmfcbN36PDQ@public.gmane.org>,
	Org Mode Mailing List
	<emacs-orgmode-mXXj517/zsQ@public.gmane.org>
Subject: Re: flyspell and code blocks
Date: Fri, 21 Dec 2012 16:37:16 +0100	[thread overview]
Message-ID: <87licr5scz.fsf@somewhere.org> (raw)
In-Reply-To: <81397ua64z.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (Jambunathan K.'s message of "Mon, 23 Apr 2012 19:43:00 +0530")

Hi,

Jambunathan K wrote:
> Julian Burgos <julian-YmfcbN36PDQ@public.gmane.org> 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

  parent reply	other threads:[~2012-12-21 15:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 13:57 flyspell and code blocks Julian Burgos
2012-04-23 14:13 ` Jambunathan K
     [not found]   ` <81397ua64z.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-21 15:37     ` Francesco Pizzolante [this message]
2012-12-22 14:04       ` Jambunathan K

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=87licr5scz.fsf@somewhere.org \
    --to=fpz-djc/ipccudyqhejpep6iedvlejwurmry@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    --cc=julian-YmfcbN36PDQ@public.gmane.org \
    --cc=kjambunathan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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).