Re: [O] flyspell and code blocks
"Francesco Pizzolante" writes: > 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=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. The following replacement wouldn't depend on fontification. (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 (eq (org-element-type (org-element-at-point)) 'src-block) > > 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 > > --
Re: [O] flyspell and code blocks
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=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
Re: [O] flyspell and code blocks
Julian Burgos writes: > Hello fellow org'ers, > > 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. > Many thanks, 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 > Julian --
[O] flyspell and code blocks
Hello fellow org'ers, 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. Many thanks, Julian -- Julian Mariano Burgos, PhD Hafrannsóknastofnunin/Marine Research Institute Skúlagata 4, 121 Reykjavík, Iceland Sími/Telephone : +354-5752037 Bréfsími/Telefax: +354-5752001 Netfang/Email: jul...@hafro.is