From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Vauban Subject: Re: Unconditionally turn off Flyspell mode during export Date: Wed, 26 Mar 2014 16:16:20 +0100 Message-ID: <86siq5ng6z.fsf@somewhere.org> References: <86ha6mclcx.fsf@somewhere.org> <87wqfii6xf.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: 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: emacs-orgmode-mXXj517/zsQ@public.gmane.org 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