emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Unconditionally turn off Flyspell mode during export


From: Sebastien Vauban
Subject: Re: [O] Unconditionally turn off Flyspell mode during export
Date: Wed, 26 Mar 2014 16:16:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt)

Hi Bastien,

Bastien wrote:
> Sebastien Vauban writes:
>>
>>     (add-hook 'text-mode-hook
>>               (lambda ()
>>                 (message "Turning on Flyspell in buffer `%s'" (buffer-name))
>>                 (flyspell-mode 1)))
>>
>> Though, as you can see, that has the perverse impact that Flyspell
>> gets called (even multiple times) during the export process, when
>> creating copies of the source Org document:
>
> From master, you can check against `org-babel-exp-reference-buffer' to
> see if you are currently exporting, and then activate flyspell-mode
> only if you're not.

IIUC, I can't make use of it. Let me explain...

As that variable is only defined in Org mode, I must make such a check
in `org-mode-hook' only (not anymore in `text-mode-hook'):

--8<---------------cut here---------------start------------->8---
  (add-hook 'org-mode-hook
            (lambda ()
              (unless (and (boundp 'org-babel-exp-reference-buffer)
                           org-babel-exp-reference-buffer)
                (message "Turning on Flyspell in buffer `%s'" (buffer-name))
                (turn-on-flyspell))))
--8<---------------cut here---------------end--------------->8---

Hence, if I don't enable Flyspell anymore in Text mode, I don't have
Flyspelling for common text files (not in Org mode). Not what I want.

If I do enable Flyspell in Text mode, I'm back on square one: my problem
is not solved.

Am I missing something?

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

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